Science and technology

Using extra to view textual content information on the Linux command line

There are a lot of utilities that allow you to view textual content information while you’re on the command line. One of them is more.

extra is much like one other instrument I wrote about known as less. The predominant distinction is that extra solely means that you can transfer ahead in a file.

While which will appear limiting, it has some helpful options which might be good to learn about. Let’s take a fast have a look at what extra can do and how one can use it.

The fundamentals

Let’s say you might have a textual content file and need to learn it on the command line. Just open the terminal, pop into the listing that incorporates the file, and kind this command:

extra <filename>

For instance, extra jekyll-article.md.

Press the Spacebar in your keyboard to maneuver via the file or press q to stop.

If you need to seek for some textual content within the file, press the / key adopted by the phrase or time period you need to discover. For instance, to search out the phrase terminal, sort:

/terminal

Search is case-sensitive. Typing Terminal is not the identical as typing terminal.

Using extra with different utilities

You can pipe textual content from different command line utilities into extra. Why do this? Because typically the textual content that these instruments spew out spans a couple of web page.

To do this, sort the command and any choices, adopted by the pipe image (|), adopted by extra. For instance, as an example you might have a listing that has a lot of information in it. You can use extra with the ls command to get a full view of the contents of the listing:

ls | extra

You also can use extra with the grep command to search out textual content in a number of information. In this instance, I exploit grep to search out the textual content productiveness in a number of supply information for my articles:

**grep ‘productivity’ *.md | extra**

Another utility you possibly can mix with extra is ps (which lists processes which might be operating in your system). Again, this turns out to be useful when there are a lot of processes operating in your system and also you want a view of all of them—for instance, to search out one which that you must kill. To do this, use this command:

ps -u scott | extra

Note that you just’d exchange scott along with your username.

As I discussed initially of this text, extra is simple to make use of. It’s positively not as versatile as its cousin much less, however it may be helpful to know.

Most Popular

To Top