1 Cat: View file contents
Option:-B Displays line numbers, blank lines do not display line numbers
-N Displays line numbers, including blank lines
[[Email protected] ~] #cat-B a.txt
2 more: Page view the contents of the file, press space to view the next page, press Q to exit
[[Email protected] ~] #more a.txt
3 Less: Paging through the contents of the file, using the same way as VI, space (next page), B Key (previous), G (last line), G (first row)
[Email protected] ~]# LESS/ETC/PASSWD
4 Head: View the contents of the file header, default to the first 10 lines
Option:-N to display the contents of the top N rows
[Email protected] ~]# HEAD-20/ETC/PASSWD
5 Tail: View the contents of the end of the file, default to the last 10 lines
Option:-n Displays the contents of the end of the file n rows
-F Dynamic display of file contents, usually used to view the log, CTRL + C exit
[Email protected] ~]# TAIL-20/ETC/PASSWD
6 WC: Displays the statistics of the file's lines, words, and bytes
Option:-c displays statistics for bytes
-l Display Row count statistics
-W Display word statistics
[Email protected] ~]# wc-w a.txt
7 grep: Find keywords and print matching lines
Option:-I ignores case
-V to reverse match
--color Display Color
[Email protected] ~]# grep--color Minion A.txt
8 Echo: Displays the specified string
Option:-N does not wrap, the default echo output is wrapped.
[Email protected] ~]# echo-n C
This article from "10,000 years too long, seize" blog, please be sure to keep this source http://zengwj1949.blog.51cto.com/10747365/1916434
View file contents of Linux commands