Linux less command
The '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.
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 String
A 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.
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 Keys
The '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.
search navigtion keys will help you in forward and backward search.
Forward : /\/home\/sssit\/
Backward : /home/sssit
to move forward or backward line by line