How to Use Unix MORE Command

In this tutorial we will show you how to use the unix more command. The more command is used in Linux for displaying the text on the screen.
It is basically a filter that can be combined with other attributes, for example paging through the text etc.
In this tutorial w e will explore the different variations that come along with the unix commands of more.


Step 1 – List the directory contents

First of all, let’s list the contents of the directory over here. You can see a text file is present in the directory.

Display the contents of the directory

Step 2 – Use the “more” command

Now let’s type “more” along with the file name, which in this case is “TextFile”. Once we hit enter, the contents of this text file is displayed on the screen.

Type in the “more” command

Step 3 – Enter command with the c attribute

Now let’s try this command with the c attribute
For that type “more –c TextFile” and hit enter
You will notice that the screen will get cleared and the contents of the file would be displayed here

Type a command with the c attribute

Step 4 – View the output

You will notice that the screen will get cleared and the contents of the file would be displayed here.

See the output

Step 5 – Associate numbers with the command

You can also associate numbers with the unix more command. Let’s look at an example.
If we type “more -10 TextFile” and hit enter, you will see that only the data till line number ten is displayed. This is actually what the num tag does. It only displays the text up till the number specified. If you want to see additional data in the file, you will have to press the Enter key.

Link numbers with the command

Step 6 – Exclude the first 10 lines

Similarly to exclude the first 10 lines of your data, you can use the “+10” attribute along with the more command. Here you will observe that the first 10 lines of the text file would be excluded and the rest of the data would be displayed.
And that’s it, from the above steps you can understand the attributes of the unix commads of more.

Remove the first 10 lines from the output