split -d -b 1G big.file big.file.
合併檔案
cat big.file.* > big.file
參考來源
延伸閱讀
- 用 dd 應該也可以
tcpdump 透過 libpcap,使用 kernel 裡或 userspace 的 BPF 虛擬機器進行封包擷取工作,並將封包加以解釋後輸出。
指令格式tcpdump [參數] [過濾表示式]其中參數以「-」開頭,可能接著參數值,剩下的為過濾表示式。
遠端 tcpdump
多 thread 程式有一個好處是全域變數在 process 內是共用的,不需要跨 process 共用機制,但存取時要避免衝突產生,其中一種方式是使用 mutex (mutual exclusion) 來建立 critical section,來同步共用資源的使用。
如果變數只是一個 int 且只有一個 thread 會改變它,其它都只是讀 => 沒有同步問題
mutex 只有兩種狀態:locked 及 unlocked。一個 mutex,只有一個 thread 可以取得 lock,此時只有它可以 unlock。其它 thread 要 lock 需等候。一般不能有下列行為:
mutex 是資料型態為 pthread_mutex_t 的變數,可以靜態或動態初始化:
靜態,初始化為 unlock。
pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
動態初始化,可設 attr。如用預設值,attr 可為 NULL。不再使用時,應該要回到 unlocked 狀態後 destroy。
int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr); int pthread_mutex_destroy(pthread_mutex_t *mutex);
成功時回傳 0 或正的錯誤碼。
pthread_mutexattr_init()bootcmd,包括:run findfdt; run mmcboot; setenv mmcdev 1; setenv bootpart 1:2; run mmcboot; run nandboot;
findfdt 依板子名稱決定 dtb 檔,然後嘗試開機,先執行 mmcboot 嘗試從 mmc0 (µSD) 開機。如果失敗,設定後再次執行 mmcboot 嘗試從 mmc1 (eMMC) 開機,最後執行 nandboot 嘗試 NAND 開機。if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;board_name 讀自板子的 eeprom,決定 fdtfile 用哪個 dtb 檔。BBB 是 A335BNLT,dtb 檔是 am335x-boneblack.dtb。後續讀取的 uEnv.txt 可再修改 fdtfile。
mmc dev ${mmcdev};
if mmc rescan; then
echo SD/MMC found on device ${mmcdev};
if run loadbootscript; then
run bootscript;
else
if run loadbootenv; then
echo Loaded environment from ${bootenv};
run importbootenv;
fi;
if test -n $uenvcmd; then
echo Running uenvcmd ...;
run uenvcmd;
fi;
if run loadimage; then
run mmcloados;
fi;
fi ;
fi;
mmcdev 決定哪個 MMC device,一開始預設是 0,mmc rescan 有找到的話,才會執行相關動作。load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
預設載入的 bootfile 是位於第二分割的 boot/zImage。run args_mmc;
if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
if run loadfdt; then
bootz ${loadaddr} - ${fdtaddr};
else
if test ${boot_fdt} = try; then
bootz;
else
echo WARN: Cannot load the DT;
fi;
fi;
else
bootz;
fi;
run finduuid;
setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
part uuid mmc 0:2 uuid應該改成
part uuid mmc ${bootpart} uuid
load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
所有 SIP 訊息 都要有 Via,縮寫 v。一開始的 UAC 和後續途經的每個 proxy 都會疊加一個 Via 放傳送的位址,依序作為回應的路徑。 格式 sent-protocol sent-by [ ;branch= branch ][ ; 參數 ...] s...