zip jackmainserver zip file adding file 1 deflated

  • Slides: 33
Download presentation

建立. zip檔 jack@main-server:~$ zip file* # 需指定壓縮檔名(但不一定需要副檔名) adding: file 1 (deflated 48%) 顯示壓縮比 adding:

建立. zip檔 jack@main-server:~$ zip file* # 需指定壓縮檔名(但不一定需要副檔名) adding: file 1 (deflated 48%) 顯示壓縮比 adding: file 2 (deflated 81%) adding: file 3 (deflated 1%) adding: file 4 (deflated 86%) adding: file 5 (deflated 55%)

zip檔解壓縮 jack@main-server:~$ unzip file. zip Archive: file. zip inflating:file 1 inflating:file 3

zip檔解壓縮 jack@main-server:~$ unzip file. zip Archive: file. zip inflating:file 1 inflating:file 3

gzip與tar

gzip與tar

結合tar與gzip jack@main-server:~$ tar cvf test. tar * file 1 file 2 file 3 jack@main-server:~$

結合tar與gzip jack@main-server:~$ tar cvf test. tar * file 1 file 2 file 3 jack@main-server:~$ gzip test. tar 或 jack@main-server:~$ tar cvf test. tar * | gzip test. tar (利用管線來一次執行二個指令)

在特定目錄下搜尋並顯示 jack@main-server:~$ sudo find /etc -name passwd -print /etc/pam. d/passwd /etc/passwd

在特定目錄下搜尋並顯示 jack@main-server:~$ sudo find /etc -name passwd -print /etc/pam. d/passwd /etc/passwd

搜尋一段時間內被存取/變更的檔案或目錄 jack@main-server:~$ sudo find /home –amin 10 # 10分鐘內存取的檔案及目錄 jack@main-server:~$ sudo find /home –atime

搜尋一段時間內被存取/變更的檔案或目錄 jack@main-server:~$ sudo find /home –amin 10 # 10分鐘內存取的檔案及目錄 jack@main-server:~$ sudo find /home –atime 10 # 10小時內存取的檔案及目錄 jack@main-server:~$ sudo find /home –cmin 10 # 10分鐘內變更的檔案及目錄 jack@main-server:~$ sudo find /home –ctime 10 # 10小時內變更的檔案及目錄

搜尋由指定使用者建立的檔案或目錄 jack@main-server:~$ sudo find /home -user root /home/jack/testfile 1

搜尋由指定使用者建立的檔案或目錄 jack@main-server:~$ sudo find /home -user root /home/jack/testfile 1

搜尋後執行指定的指令 n jack@main-server:~$ sudo find / -name core -print -exec rm -rf {} ;

搜尋後執行指定的指令 n jack@main-server:~$ sudo find / -name core -print -exec rm -rf {} ;

搜尋特定權限的檔案或目錄 n jack@main-server:~$ sudo find /home perm 600

搜尋特定權限的檔案或目錄 n jack@main-server:~$ sudo find /home perm 600

搜尋特定大小的檔案 n jack@main-server:~$ sudo find /etc -size +3500 k -print

搜尋特定大小的檔案 n jack@main-server:~$ sudo find /etc -size +3500 k -print

whereis指令會在以下的目錄中進行搜尋 n /bin n /etc n /sbin n /usr/etc n /usr/games n /usr/include n

whereis指令會在以下的目錄中進行搜尋 n /bin n /etc n /sbin n /usr/etc n /usr/games n /usr/include n /usr/lib

whereis指令 /usr/local n /usr/man n /usr/sbin n /usr/src n /usr/local/bin n /usr/local/etc n /usr/local/games

whereis指令 /usr/local n /usr/man n /usr/sbin n /usr/src n /usr/local/bin n /usr/local/etc n /usr/local/games n /usr/local/lib n usr/local/man jack@main-server:~$ whereis man n

which指令 jack@main-server:~$ which ping find who reboot /bin/ping /usr/bin/find /usr/bin/who /sbin/reboot

which指令 jack@main-server:~$ which ping find who reboot /bin/ping /usr/bin/find /usr/bin/who /sbin/reboot

搜尋包含指定字串的檔案 n jack@main-server:~$ sudo grep -n 'security issues' /etc/*. *

搜尋包含指定字串的檔案 n jack@main-server:~$ sudo grep -n 'security issues' /etc/*. *

篩選前一指令執行的結果 n jack@main-server:~$ ls -al /usr/bin | grep install

篩選前一指令執行的結果 n jack@main-server:~$ ls -al /usr/bin | grep install