more command
more command is used for retrieving analysis of text data in the file, it takes big size file and displays it in page format and one important thing we need to note is, page down and page up keys do not work and we need to click on enter key for the display of new records on screen. To apply more command and view its working functionality, we need to take any system folder on Linux Machines that contain a huge set of text data. For this reason, I have chosen /var/log/messages folder.
Syntax of more command:
more [-options] [-num] [+/pattern] [+linenum] [file_name]
what is /var/log/messages ?
/var/log/messages is a system-managed folder in Linux that contains all system messages and notifications recorded at System Boot, This folder has all logs of mail, kernel, auth, daemon, etc.
Sample code:
cat /var/log/messages | more
Output:
Explanation:
Here we can see the output as static text data representing a complex chunk of the input text data, in contrast, if we use the normal cat /var/log/messages command, we will see a continuous running logs output dynamically, we cannot capture that output in a picture and show you here, but you can try it useful with above-mentioned command, surely you would notice the difference and also please note that we have a “more” option, by clicking enter we can see the continuation of the output data.
Useful Commands For Filtering Text for Effective File Operations in Linux
In this article, let us learn about different commands used in Linux for filtering text to implement effective file operations on Linux Machines.