重學Linux 檔案處理命令

2021-10-02 13:05:52 字數 1043 閱讀 6418

檔案處理命令

@auther張念磊

@date 2020/1/29

touch

命令所在路徑:/bin/touch

執行許可權:所有使用者

語法:touch [filename]

功能描述:建立空檔案

範例:

touch japanlove.list
cat

語法:cat [filename]

功能描述:列印檔案內容

範例:

cat /tmp/boduo
帶有行號的顯示:

cat -n /tmp/boduo
tac

語法:tac [filename]

功能描述:倒序列印檔案內容

範例:

tac -n /tmp/boduo
more

功能描述:分批次檢視檔案

語法:more [filename]

範例:

more /tmp/boduo
功能鍵:

​ 空格 - 翻頁

​ enter - 下一行

less

功能簡述:功能類似more命令,比more命令多兩個功能,上翻頁和搜尋

語法:less /tmp/boduo

引數:​ -m 顯示百分比

​ -n 顯示行號

功能鍵:

​ b:前一頁

head -n

功能描述:檢視檔案頭部(預設10行)

語法:head /etc/cangjing

引數:​ -n 8 檢視前8行

示例:

head -n /etc/cangjing
tail

功能描述:檢視檔案尾部(預設10行)

語法:tail /etc/cangjing

引數:​ -f 動態顯示

示例:

tail -f cangjing

linux檔案處理命令 檔案處理命令

一 檔案處理命令 1 touch 命令名稱 touch 命令所在路徑 bin touch 執行許可權 所有使用者 語法 touch 檔名 功能描述 建立空檔案 touch 檔名 在linux建立檔案的時候,如果檔名帶空格,需喲使用雙引號括起來,不然會當兩個檔案處理,但是不建議檔名帶空格 2 cat ...

linux命令 檔案處理命令

1,建立帶空格的檔案 不建議這樣命名 touch name1 name2 注意 在對這個檔案進行刪除 複製 剪下等時,都必須帶上引號 語法 touch 檔名 2,顯示檔案內容 以 tmp services cat n 檔名 不適合檢視長的檔案 n 顯示行號 tac 檔名 倒著瀏覽檔案內容 more ...

linux檔案處理命令

只有root可以執行的命令放在 sbin目錄或者 usr sbin目錄 所有使用者可以執行的命令放在 bin目錄或者 usr bin目錄 命令名稱 ls 命令英文原來 list 命令所在路徑 bin ls 執行許可權 所有使用者 功能描述 顯示目錄檔案 語法 ls 選項 ald 檔案或目錄 a 顯示...