Saturday, August 19, 2023
HomeNetworkingThere's extra to greater than meets the attention

There’s extra to greater than meets the attention


The Linux extra command is a reasonably apparent command to make use of while you wish to scan via a textual content file a display at a time, however there nonetheless is perhaps fairly a couple of stuff you don’t learn about this command. For one factor, you don’t have to start out on the prime of the file in case you don’t wish to. Add an argument like +20 and you’ll begin with the twentieth line within the file with a command like that proven under.

$ man +20 myfile

Observe that the extra command routinely adjusts itself to the variety of strains in your terminal window. As well as, the final line displayed won’t be a line from the file by default, however a sign of what proportion of the textual content has been displayed to this point – at the least if there’s extra textual content to observe. It can seem like this:

--Extra--(14%)

So, in case your terminal window is 40 strains tall, extra will show 39 strains out of your file adopted by the proportion of textual content displayed to this point. Use the -d choice and also you’ll see this as an alternative of simply the proportion indication proven above.

--Extra--(45%)[Press space to continue, 'q' to quit.]

Maintain studying to take a look at some extra choices.

Shifting up and down when viewing a file

When viewing a file utilizing the extra command, you may transfer again up within the file utilizing the up arrow or urgent “b”. You’ll be able to transfer all the way in which to the start after which evaluation your complete file a second time if you need.

Robotically exit on the finish of the file

The extra command will go away you looking at (END) while you attain the top of a file – after which proceed including a screenful of clean strains so long as you proceed urgent the house bar. The profit is that you simply’ll nonetheless be utilizing extra and that it is possible for you to to maneuver again up via the textual content utilizing the up arrow key if you need. If, nevertheless, you merely wish to exit as quickly as you attain the top of the file, use the -e (exit) choice like this:

$ extra -e myfile

Squeezing out white house

To show a number of clean strains right into a single line all over the place they seem in your file, use the -s (squeeze) choice.

$ extra -s myfile

Scrolling slowly via a file

To scroll via a textual content file lower than a screenful of strains at a time, use the -n (variety of strains) choice. This can add the variety of strains you specify every time you press the enter key and may make it simpler to deal with every part of the output.

$ extra -n 10 myfile

Observe you could specify a quantity that exceeds the strains in your display and the additional textual content will slide previous the highest of your window.

Displaying a number of recordsdata

You’ll be able to ask the extra command to show a number of recordsdata just by itemizing them on this method:

$ extra file1 file2

You will note every file title displayed earlier than its content material as proven within the instance under.

::::::::::::::
file1
::::::::::::::
This can be a boring file.
I am unable to even get my cat to take a look at it.
How will she ever come to benefit from the Linux command line?

To get to the following file, you must press the 2-character string “:n” after which the enter key.

...Skipping
...Skipping to file file2

::::::::::::::
file2
::::::::::::::
This can be a quick file.
Is not it?

Wrap-up

The extra command is one in every of various instructions that can mean you can study the content material of recordsdata. Try the publish listed under to view some extra choices.

5 methods to look at the content material of recordsdata on Linux

Copyright © 2023 IDG Communications, Inc.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments