Linux less commandThe 'less' command is same as 'more' command but include some more features. It automatically adjust with the width and height of the teminal window, while 'more' command cuts the content as the width of the terminal window get shorter. Syntax: Example: Look at the above snapshot, we have given the command "less /var/log/udev". In the left corner, name of the file is displayed. Linux To Find A StringA particular string is searched by typing forward slash (/) and then followed by the string name, at place of file name in the lower left corner of the terminal box. Syntax: Example: Look at the above snapshot, we want to find string 'add' hence we have typed "/add" at the lower left corner. Output: Below snapshot, shows the output of command "/add". The string 'add' will be automatically highlighted. less Command Navigation KeysThe 'less' command have navigation keys similar to the 'vim' editor. Let's have a look on some of the navigation keys and other operations of less command. 1. Search Navigationsearch navigtion keys will help you in forward and backward search. Forward search
Backward search
Search path Forward : /\/home\/sssit\/ Backward : /home/sssit 2. Screen Navigation
3. Line Navigationto move forward or backward line by line
4. other Navigations
5. Count Keys
6. Marked Navigation
7. Multiple File
to navigate between files when more then two files are opened
Next TopicLinux strings command
|