歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux命令 >> Linux uuencode命令參數及使用方法詳解

Linux uuencode命令參數及使用方法詳解

日期:2017/2/27 16:39:22   编辑:Linux命令
使用權限:所有使用者
  
使用方式:uuencode [-hv] [sourcefile] targetfile
  
說明:   
  早期在許多 unix 系統的傳送協定只能傳送七位元字元,並不支援二進位檔案,像中文文字檔就有用到八位元,所以無法完整地送到另一架機器上。 uuencode 指令,可以將二進位檔轉換成七位元的檔案,傳送到另一架機器上再以 uudecode 還原。最常見的是用在以電子郵件傳送二進位檔。uuencode 編碼後的資料都以 begin 開始,以 end 作為結束。
  
   begin 644 decode.dat
  (內容編碼)
  `
  end
  
  begin 後的 644 是 unix 檔案的調用權限代碼。而 decode.dat 則是還原後的檔名。
  
參數:
  h 列出指令使用格式 (help)
  v 列出版本訊息 (version)
  
范例:  
  將 source.dat 編碼後存成 file.uud 檔。由於 uuencode 會將編碼後的資料在熒幕上列出,所以必須將資料導入 file.uud 中,而 target.dat 是 file.uud 還原後的檔案名字,而不是編碼後的檔案。
   uuencode source.dat target.dat > file.uud
  
  執行指令後,由標准輸入裝置讀入資料,簡單地說是由鍵盤輸入後在熒幕顯示的資料,按 Crtl + d 鍵後就會被編碼,輸出至 file.uud 中。由於程序是以行為處理單位,若無法跳出程序,請多按幾次 Ctrl + d 直到程序結束為止。
  
   uuencode target.dat > file.uud
  
  類似上一個指令,不過使用一個導入的技巧,將 source.dat 壓縮後的資料傳送給 uuencode 處理之後,存成 file.uud 檔。 file.uud 檔還原後就是 source.dat.Z 檔。
  
   compress -c source.dat | uuencode source.dat.Z > file.uud
  
  顯示版本訊息後,結束執行程序。
  
   uuencode -v
Copyright © Linux教程網 All Rights Reserved