1 / 7

Unix 指令 2

Unix 指令 2. ps Process status 用來看目前系統中正在跑的程式有哪些 參數說明 -a (all) -u 列出各程序的執行者 (user) -x 將沒有終端機控制的程序列出 -w (wide) kill 用來將某個正在執行的程序殺掉,而且只能殺自己所執行的程序 參數說明 -9 強制殺掉 su Switch user( 切換使用者身分 ) 語法 su -username. du 查詢檔案使用空間的容量大小 參數說明 -o 不含子目錄 grep 在檔案中搜尋某一特定字串 參數說明 -i 忽略大小寫

Télécharger la présentation

Unix 指令 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Unix 指令2

  2. ps • Process status用來看目前系統中正在跑的程式有哪些 • 參數說明 • -a (all) • -u列出各程序的執行者 (user) • -x將沒有終端機控制的程序列出 • -w (wide) • kill • 用來將某個正在執行的程序殺掉,而且只能殺自己所執行的程序 • 參數說明 • -9強制殺掉 • su • Switch user(切換使用者身分) • 語法 su -username

  3. du • 查詢檔案使用空間的容量大小 • 參數說明 • -o不含子目錄 • grep • 在檔案中搜尋某一特定字串 • 參數說明 • -i忽略大小寫 • -n列出行號 • -v將不含某個字樣的行列出 • 範例 grep “My” file1 file2 • find • 某個目錄下開始一層層找檔案 • 語法 find 路徑 –name 檔名 • 範例 find html –name index.htm

  4. talk • 利用終端機與另一個系統使用者進行「交談式」地傳達訊息 • 語法 talk username • 語法 talk username@hostname • write • 發送訊息給本機上指定的使用者 • 語法 write username • mesg • 控制是否接受其他使用者傳來的訊息 • 參數說明 • -n不接受 • -y接受

  5. 壓縮指令 • compress • Unix的標準壓縮程式,用來將一個檔案壓縮 • 副檔名.Z • 語法 compress filename 或 解壓縮compress –d filename • uncompress • Unix的標準解壓縮程式 • 語法 uncompress filename.Z • gzip • GNU出的,取代了 compress,支援度佳的壓縮指令 • 副檔名 .gz • 解壓縮語法 gzip –d filename.gz • bzip2 • 比 gzip 壓縮比更好 • 副檔名 .bz2 • 解壓縮語法 bzip2 –d filename.bz2

  6. 打包指令(1/2) • tar • 檔案的打包與壓縮 • 建立、解壓縮與查閱的參數 • -c建立一個打包(壓縮)檔案的參數指令(create) • -x解開一個包裹(壓縮)檔案的參數指令 • -t查看tarfile 裡面的檔案 • 是否進行壓縮的參數 • -j使用bzip2 壓縮/解壓縮 • -z使用gzip 壓縮/解壓縮 • 其他重要參數 • -p保持檔案原有的屬性/權限 • -v查閱打包過程的資訊 • -f file後續處理的檔名 • 語法 tar [-參數] 打包檔 原始檔

  7. 打包指令(2/2) • 將 /html 建立打包檔案到 /test 底下 • tar –cvf /test/html.tar /html • tar –pzcvf /test/html.tar.gz /html • tar –pjcvf /test/html.tar.bz2 /html • 查閱剛剛建立的檔案資訊 • tar –ztvf /test/html.tar.gz • 將該檔案解包 • tar –xvf /test/html.tar • 將該檔案解壓縮到 /temp 底下 • tar –xvf /test/html.tar –C /temp • tar –zxvf /test/html.tar.gz –C /temp

More Related