Header Ads

Breaking News

How to use the more and less commands: 2-Minute Linux Tips


Hi, this is Sandra Henry-Stocker, author of the “Unix as a Second Language” blog on NetworkWorld.
In this Linux tip, we’re going to look at the more and less commands. They each allow you to browse the content of text files. For example, to look through the words file, you might use a command like this:
The less command allows you to browse file content as well, but it also lets you move backwards or forwards in the display. It’s called “less”, but it actually does more than more. You would use the arrow keys on your keyboard to move up and then back down.
You need to type “q” to exit less.
You can also pipe the output from other commands to the more and less commands to view it a screenful at a time and, with less, to back up and down. Here’s the less command for browsing through a file listing:
Notice that we can move up and down the file listing when using less.
That’s your Linux tip for the more and less commands.
If you have questions or would like to suggest a topic, please add a comment below. And don’t forget to subscribe to the IDG Tech(talk) channel on YouTube.
If you liked this video, please hit the like and share buttons. For more Linux tips, be sure to follow us on Facebook, YouTube and NetworkWorld.com.

Source Link

No comments