代码: 全选
ll /
谢谢!
代码: 全选
ll /
schizophrenia 写了:[command] | less
during you reading Terminal, you can up or down that :use N, n (click in your keyboard)
(if you said that "read" is what you done of commands :use history , and add ! to run that again)
but you must want to fine some words, but true alright :use / , ? (click in your keyboard)
that's better then | more, because "command more" cannot put that page up when you are read it
and detail, for flipping:
== more ==
(一頁一頁翻動)
空白鍵 (space):代表向下翻一頁;
Enter :代表向下翻『一行』;
/字串 :代表在這個顯示的內容當中,向下搜尋『字串』這個關鍵字;
:f :立刻顯示出檔名以及目前顯示的行數;
q :代表立刻離開 more ,不再顯示該檔案內容。
b 或 [ctrl]-b :代表往回翻頁,不過這動作只對檔案有用,對管線無用
== less ==
(一頁一頁翻動)
空白鍵 :向下翻動一頁;
[pagedown]:向下翻動一頁;
[pageup] :向上翻動一頁;
/字串 :向下搜尋『字串』的功能;
?字串 :向上搜尋『字串』的功能;
n :重複前一個搜尋 (與 / 或 ? 有關!)
N :反向的重複前一個搜尋 (與 / 或 ? 有關!)
q :離開 less 這個程式;
== head ==
[-n number] 檔案
選項與參數:
-n :後面接數字,代表顯示幾行的意思
另外那個 -n 選項後面的參數較有趣,如果接的是負數,例如上面範例的-n -100時,代表列前的所有行數, 但不包括後面100行。舉例來說,/etc/man.config共有141行,則上述的指令『head -n -100 /etc/man.config』 就會列出前面41行,後面100行不會列印出來了。這樣說,比較容易懂了吧? ^_^
== tail ==
[-n number] 檔案
選項與參數:
-n :後面接數字,代表顯示幾行的意思
-f :表示持續偵測後面所接的檔名,要等到按下[ctrl]-c才會結束tail的偵測
範例一:如果不知道/etc/man.config有幾行,卻只想列出100行以後的資料時?
[root@www ~]# tail -n +100 /etc/man.config
範例二:持續偵測/var/log/messages的內容
[root@www ~]# tail -f [[/var/log/messages]]