The less Command

Using the less command is similar to using the cat and more commands. As a matter of fact, the syntax is nearly identical. It's really what the tool does that makes it different. When using the less command, you have more control over the pager than ever before.

Here is a good example of the differences between more and less:

>more hosts.allow

If you try to use the arrow keys for navigation while using the more command, you will find that you can only move forward through the file with the Spacebar. There is not a back and forth as there is with the less command. Now try the same things using the less command.

>less hosts.allow

You can move up and down through the file using your arrow keys. You can even move to the right buffer if you are working on a terminal emulation program like telnet or secure shell. Either way, if you are connected to a Unix system and can use more or less, check them out and see what they can do for you. Other options that come with less are similar to those that come with cat and more. The Spacebar always moves you through the file via the page, and q will give you the ability to quit out of the program.

Ask for It If you are not using the less command at work and think it may be more productive for you, request it.


Now that you are comfortable with the fundamentals on how to read a file with cat, more, and less, there may be times when you only need to look at a section of a file. You may have a need to look at the bottom of a log file, or at the top of an email message header to get the source and destination addressing out of it. If you do not need to look at a complete file and just need to look at a section of it, then you can use the head and tail commands.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.140.206