Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does Linux view the contents of a file?

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "Linux how to view the contents of the file", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Linux how to view the contents of the file" bar!

Cat command (display and connect file contents)

After using the 'cat' command, only the last screen is displayed, regardless of the contents of the file.

More command (paging to view the contents of the file)

Press Enter to scroll down line by line

Press the spacebar to flip down one screen

Press Q key to exit

Less command (paging to view the contents of the file)

Same as the more command, but with more extended features

Page Up page up, Page Down page down

Press the "/" key to find the content, "n" next content, "N" last content

Other functions are basically similar to the more command

Head command (view the beginning of the file)

Head-15 / lisi1

# View the first 15 lines of the lisi1 file (default 10 lines)

Tail command (view the end of the file)

Tail-15 / lisi1

# View the last 15 lines of the lisi1 file

Head and tail can be used in combination with "|"

Such as:

Head-15 / lisi1 | tail-5

# look at the first 15 lines of the lisi1 file and look at the last 5 lines within the 15 lines

Wc command (information such as the number of words in the statistics file (Word Count))

-l: count the number of rows

-w: count the number of words

-c: count the number of bytes

Thank you for your reading, the above is the content of "Linux how to view the contents of the file", after the study of this article, I believe you have a deeper understanding of how to view the contents of the file Linux, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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: 0

*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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report