标题:
cat 并不能使用, 该怎办呢?
[打印本页]
作者:
txfzq
时间:
2007-11-15 15:16
标题:
cat 并不能使用, 该怎办呢?
找找其他指令吧
UNIX指令篇 - 顯示文件內容 ( cat、more、pg、less、head、tail)
顯示檔案內容
顯示檔案全部內容
$ cat file
顯示檔案內容並在行首加入行號
$ cat -n file
顯示檔案內容並刪除連續空白行
$ cat -s file
分頁顯示檔案內容(more、pg、less)
分頁顯示檔案內容
$ more file
$ less file
使用按鍵q 離開,按鍵v 進入編輯模式
less 另外多了按鍵y 往上卷一行, 按鍵? 搜尋字串功能
除了 more、less之外,另外還有pg 顯示指令
$ pg file
使用按鍵q 離開,按鍵Enter翻頁,
按鍵$ 移到檔尾, +n 向前移動n頁, -n 向後移動n頁
從第30行開始分頁顯示檔案內容
$ more +30 file
$ less +30 file
每次顯示顯示檔案內容,遞增3行範圍
$ more -3 file
$ pg -3 file
head
顯示檔案前10行內容
$ head file
顯示檔案前3行內容
$ head -3 file
tail
顯示檔案最後10行內容
$ tail file
顯示檔案最後5行內容
$ tail -5 file
從第30行開始顯示檔案內容
$ tail +30 file
欢迎光临 骤雨打新荷 (http://txfzq.free.fr/bbs/)
Powered by Discuz! 2.5