In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "how to view the contents of files in Linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Cat displays the contents of the file from the first line
Tac displays from the last line, and you can see that tac is written backwards for cat!
When nl is displayed, output the line number by the way!
More displays the contents of the file page by page
Less is similar to more, but even better than more, it can turn the page forward!
Head only looks at the first few lines
Tail only looks at a few lines of tail.
Od reads the contents of the file in a binary way!
Cat views the contents of the file
Cat file_name
Show line number
Cat-n file_name
Tac file content flashback display
You can compare the contents of the cat above below. Tac outputs the contents of the file in reverse.
Nl displays the number of lines
The nl command is the same as cat-n file_name;, which is used to display line numbers.
More can turn the page to display
For testing, add more code
Then press enter to view the rest of the code.
Parameters:
Space: represents turning down one page
Enter: turn down one line
Q: leave more directly for viewing
B: turn back the page
The function of less page flip pen more can fully point the parameters:
[pagedown]: turn a page down
[pageup]: turn a page up
/ string: the function of searching down for "string"
? String: the function of searching up for "string"
N: repeat the previous search (and / or? It's about! )
N: reverse repetition of the previous search (and / or? It's about! )
Q: exit less file_name
Head data interception
Tail takes out the next few lines
This is the end of the content of "how to view the contents of a file in Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 238
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.