Linux command for viewing file content cat displays file content starting from the first line tac displays nl display from the last line at the same time output line number more one page display content less similar to more, however, its advantages are, you can go forward and flip the page. head: only the first few lines. tail: only the last few linux views the file content. command cat: Display the file content starting from the first line. tac: Display the nl display from the last line. output the row number more than one. the content displayed on one page is less and more similar, however, its advantages are, you can flip the page and head up to look at the first few lines. tail only looks at the last few lines. od reads the file content in binary mode. cat [-n]-n. the row number is output to the screen together with nl. more [file name] more test.txtdisplay test.txt on one page ls-al | more display ls content on one page less [file name] less usage is more flexible than more, if less is used, you can use pageup or pagedown to view less test.txt/word to search for the word string in test.txt: q exit less head [-n number] [file name]-n display number line head-n 20 test.txt display test.txt first 20 rows tail [-n number] [file name]-n display number line tail-n 20 test.txt: the last 20 rows of head-n 20 test.txt are displayed. | tail-n 10: take 11-20 rows of hexdump.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.