In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you how to use the more command in Linux. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Basic usage of more command
The more command is easy to use, as long as the text name is followed by more:
More file_name
For example, to view the / var/log/dmesg file, simply:
More / var/log/dmesg
The implementation result is shown below, which should be familiar to friends who have the foundation of Linux.
In the lower-left corner of the terminal, the percentage of the displayed text in the full text is displayed. If we want to see the contents of the next screen, just press the spacebar. After turning the page, we will also see a corresponding increase in the percentage in the lower left corner.
Common buttons:
Spacebar: view the next screen
Enter key: scroll down one line
B key: view one screen forward
Q key: exit.
These are the basic uses of the more command, which many friends should be familiar with. Next, Liangxu takes you step by step into the advanced usage of the more command.
Display starts with the specified line
When using the more command, the default is to start at the first line. But sometimes we may want to start with 100 lines directly, so how do we do that? In fact, you only need to add a + 100.
More + N file_name
For example:
More + 100 / var/log/dmesg
Limit the number of rows displayed per page
The more command is displayed full screen by default. What should we do if we only want to view a few lines at a time? Just add a-N option, where N is the number of rows you want to view.
More-N file_name
For example, for the / var/log/dmesg file, we only want to view 10 lines at a time, we can do this:
More-10 / var/log/dmesg
In this way, in the terminal, we can only see 10 lines at a time. Press the spacebar and we will continue to display the next 10 lines.
Display operation prompt information
If we want to display some prompts for the more command, we can add the-d option.
More-10-d / var/log/dmesg
We can see that in the bottom line, in addition to the percentage, additional prompts are displayed. If we randomly press a button that will not be recognized by the more command, it will prompt you to press the h key to view help.
If we press the h button, it will display all the help information:
No scrolling
If we display 10 lines at a time, press the spacebar, and it will continue to display 10 lines down, like this:
This is the effect of pressing the spacebar once, and a total of 20 lines are displayed in the terminal, that is, it will keep scrolling down. What if we don't want to scroll like this and only look at 10 lines at a time? We just need to add the-c option.
More-10-c / var/log/dmesg
The above is how to use the more command in Linux. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
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.
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.