The more command on Linux may have a lot more options than you know and use. Credit: Thinkstock The Linux more command is a fairly obvious command to use when you want to scan through a text file a screen at a time, but there still might be quite a few things you don’t know about this command. For one thing, you don’t have to start at the top of the file if you don’t want to. Add an argument like +20 and you will start with the 20th line in the file with a command like that shown below. $ man +20 myfile Note that the more command automatically adjusts itself to the number of lines in your terminal window. In addition, the last line displayed will not be a line from the file by default, but an indication of what percentage of the text has been displayed thus far – at least if there’s more text to follow. It will look like this: --More--(14%) So, if your terminal window is 40 lines tall, more will display 39 lines from your file followed by the percentage of text displayed thus far. Use the -d option and you’ll see this instead of just the percentage indication shown above. --More--(45%)[Press space to continue, 'q' to quit.] Keep reading to check out some additional options. Moving up and down when viewing a file When viewing a file using the more command, you can move back up in the file using the up arrow or pressing “b”. You can move all the way to the beginning and then review the entire file a second time if you want. Automatically exit at the end of the file The more command will leave you staring at (END) when you reach the end of a file – and then continue adding a screenful of blank lines as long as you continue pressing the space bar. The benefit is that you’ll still be using more and that you will be able to move back up through the text using the up arrow key if you want. If, however, you simply want to exit as soon as you reach the end of the file, use the -e (exit) option like this: $ more -e myfile Squeezing out white space To turn multiple blank lines into a single line everywhere they appear in your file, use the -s (squeeze) option. $ more -s myfile Scrolling slowly through a file To scroll through a text file less than a screenful of lines at a time, use the -n (number of lines) option. This will add the number of lines you specify each time you press the enter key and can make it easier to focus on each section of the output. $ more -n 10 myfile Note that you can specify a number that exceeds the lines on your screen and the extra text will slide past the top of your window. Displaying multiple files You can ask the more command to display multiple files simply by listing them in this manner: $ more file1 file2 You will see each file name displayed before its content as shown in the example below. :::::::::::::: file1 :::::::::::::: This is a boring file. I can't even get my cat to look at it. How will she ever come to enjoy the Linux command line? To get to the next file, you have to press the 2-character string “:n” and then the enter key. ...Skipping ...Skipping to file file2 :::::::::::::: file2 :::::::::::::: This is a short file. Isn't it? Wrap-up The more command is one of a number of commands that will allow you to examine the content of files. Check out the post listed below to view some additional options. 5 ways to examine the content of files on Linux Related content how-to How to find files on Linux There are many options you can use to find files on Linux, including searching by file name (or partial name), age, owner, group, size, type and inode number. By Sandra Henry Stocker Jun 24, 2024 8 mins Linux opinion Linux in your car: Red Hat’s milestone collaboration with exida With contributions from Red Hat and critical collaborators, the safety and security of automotive vehicles has reached a new level of reliability. By Sandra Henry Stocker Jun 17, 2024 5 mins Linux how-to How to print from the Linux command line: double-sided, landscape and more There's a lot more to printing from the Linux command line than the lp command. Check out some of the many available options. By Sandra Henry Stocker Jun 11, 2024 6 mins Linux how-to Converting between uppercase and lowercase on the Linux command line Converting text between uppercase and lowercase can be very tedious, especially when you want to avoid inadvertent misspellings. Fortunately, Linux provides a handful of commands that can make the job very easy. By Sandra Henry Stocker Jun 07, 2024 5 mins Linux PODCASTS VIDEOS RESOURCES EVENTS NEWSLETTERS Newsletter Promo Module Test Description for newsletter promo module. Please enter a valid email address Subscribe