less is more than more

October 21st, 2006 mysurface Posted in Common, less, ls, Misc, more | Hits: 44470 | 2 Comments »

We usually do pipeline less or pipeline more to pause a long text results from standard output. But these days, do don’t use more, because less more efficient compare to more.

Let say if I want to pause the result of ls page by page, simply do this.

ls | less

Let say if I want to show a text file page by page, don’t use cat like this

cat file.txt | less

It is redundant, do this instead

less file.txt

By using arrow key, you can navigate the result, line by line backward and forward. By using page down and page up to view file page by page. By typing g to go back first line and G to goto last line. To quit, simply press q. To get more avalable command key, press h for help. less allow searching like vi, simply type / and consequently insert a keyword and press enter.

If you do not want to navigate backward and forward, then use more, vmplayer uses moreto display license agreement.

more agreement.txt

2 Responses to “less is more than more”

  1. Great post, thanks for this information….

  2. Jalal Hajigholamali Says:

    Thanks, simple and useful

Leave a Reply