1. 程式人生 > >linux命令學習隨記

linux命令學習隨記

tail -n 500 portal.log 檢視portal檔案最後500行內容,按住Shift+PgUp,Shift+PgDn 上下翻頁;

more -s portal.log   Ctrl+F,Ctrl+B上下翻頁,more +20 portal.log 從20行開始展示檔案內容;

mv /test/portal.log /home/test 將檔案移到test目錄下面;

mv file1 file2 將 file1更名為file2;

tar zcvf test.tar.gz file1 file2 將檔案1檔案2壓縮到 test.tar.gz包中;

tar zxvf test.tar.gz  先cd  /test/f1 再執行tar zxvf tar包命令, 將包解壓到 f1資料夾中;

du -sh /home/test 檢視test目錄的大小;

scp [email protected]:/home/test.txt /myfile/file/ 將10.80.25.26伺服器上的test.txt檔案遠端複製到file目錄下面;

date -s "2007-08-03 14:15:00" 設定系統時間;

./test.sh > test.log 將test.sh執行的結果輸出到test.log檔案中,

./test.sh >> test.log 將test.sh執行結果追加到test.log檔案中;