Linux常用命令: 內(nèi)容查看

放心~被指到的人一定能學(xué)會(huì)的~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~?
cat
打印和合并文件內(nèi)容
tac
倒序打印和合并文件內(nèi)容
less
交互式閱讀文件,允許滾動(dòng)和搜索
cut
從輸入或文件中剪切字段
tail
顯示文件末尾部分
grep
匹配輸入文件內(nèi)容
?
?
1. cat/tac
cat
Print and concatenate files.
打印和合并文件內(nèi)容
??Print the contents of a file to the standard output(打印文件內(nèi)容到屏幕):
??Concatenate several files into the target file(合并多個(gè)文件內(nèi)容到目標(biāo)文件中):
??Number all output lines(給輸出內(nèi)容加行號):
Print and concatenate files in reverse (last line first).
倒序打印和合并文件內(nèi)容
??Print the contents of?file1?reversed to the standard output(倒序打印文件內(nèi)容到屏幕):
??Print the contents of the standard input reversed to the standard output(倒序打印屏幕輸出內(nèi)容):
2. less
Open a file for interactive reading, allowing scrolling and search.
交互式閱讀文件,允許滾動(dòng)和搜索
??Open a file(打開文件):
??Page down / up(下翻頁/上翻頁):
??Go to end / start of file(去文件開始和結(jié)束):
??Forward search for a string (press?n/N?to go to next/previous match)(向前搜索字符串, 通過n/N下一個(gè)前一個(gè)切換):
??Follow the output of the currently opened file(動(dòng)態(tài)顯示文件輸入新內(nèi)容):
??Open the current file in an editor(在Vim打開當(dāng)前文件):
??Exit(退出):
3. cut
Cut out fields from?stdin?or files.
從輸入或文件中剪切字段
??Cut out the first sixteen characters of each line of the given files(將文件內(nèi)容剪切顯示前1到16個(gè)字符):
??Cut out the first sixteen characters of each line of?stdin(將輸入數(shù)據(jù)剪切顯示前1到16個(gè)字符):
??Cut out everything from the 3rd character to the end of each line(每行從第三個(gè)字符開始剪切顯示):
??Cut out the fifth field of each line, using a colon as a field delimiter (default delimiter is tab)(通過':'分割字段后,顯示第5列, 默認(rèn)通過tab分割):
??Cut out the 2nd and 10th fields of each line, using a semicolon as a delimiter(通過';'分割字段后,顯示第5和第10列):
??Cut out the fields 3 through to the end of each line, using a space as a delimiter(通過' '分割字段后,顯示第3列后的所有內(nèi)容):
4. tail
Display the last part of a file..
顯示文件末尾部分
??Show last 'num' lines in file(顯示文件的后num行):
??Show all file since line 'num'(從第num行顯示文件內(nèi)容):
??Keep reading file until?Ctrl + C(保持讀取文件直到Ctrl C):
5. grep
Matches patterns in input text.
匹配輸入文件內(nèi)容
Supports simple patterns and regular expressions.
支持正則表達(dá)式
??Search for an exact string(查找文件中的某個(gè)字符串):
??Search in case-insensitive mode(查找是不區(qū)分大小寫):
??Search recursively (ignoring non-text files) in current directory for an exact string(從指定位置匹配文件內(nèi)容, 忽略非文本文件):
??Use extended regular expressions (supporting??,?+,?{},?()?and?|)(支持?jǐn)U展正則):
??Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match(打印匹配內(nèi)容的前后三行/前三行/后三行):
??Print file name with the corresponding line number for each match(打印內(nèi)容時(shí)帶上文件名和行號):
??Use the standard input instead of a file(過濾輸入內(nèi)容):
??Invert match for excluding specific strings(過濾內(nèi)容取反顯示 -- 非):
?

自學(xué)筆記~
如果有錯(cuò)~
期待大佬指出~
感謝幫助提升~?