[Ilugc] One Day One GNU/Linux Command (LESS)

  • From: sbharathi@xxxxxxxxxxxxx (Bharathi Subramanian)
  • Date: Wed Jun 4 11:35:18 2008

One Day One GNU/Linux Command 
=============================

less -- Filter for paging through text one screen full at a time.

Summary:

It is a filter for showing the text in page by page format to user. It
supports No. of commands for screen operations, different prompts and
Input Preprocessing. Less will show big files in faster manner.

Example:

$ less f1 f2 -- Show the file content in page by page format.

$ less -c myfile -- Clear the screen before showing next screen.

$ less -q myfile -- Exit after 2nd time reaches end-of-file.

$ less -G myfile -- High-lite all searched strings.

$ less -pILUGC myfile -- Start at 1st occurrence of pattern "ILUGC".

$ less -P%B myfile -- Last line prompt will show the file size.

$ less xyz.rpm -- RPM file infos.

$ less xyz.tar -- List all files in the tar file.

$ less xyz.zip -- List all files in the Zip file.

Commands:

1) Press q to exit from less.
2) Press ! to execute the shell command
3) Press !! to rerun the last shell command
4) Press ^l to refresh the screen.
5) Press /pattern for search.
6) Press v to to edit the file being viewed

Note:

1) User can write own preprocessing script by editing lessopen.sh.
2) User can build own key mapping by running lesskey command.
3) If env variable LESSSECURE is set to 1, then it runs in a "Secure"
   mode. No Shell, Pipe, Examine and Editing command are disabled.
4) Less will not read entire file content in 1st read.

Read: man less

Bye :)
--
Bharathi S

Today the usage of 'less' is more and usage of 'more' is less. The
functionality of 'more' and 'less' is more or less same. But 'less'
provides more options/features then 'more'.

Other related posts:

  • » [Ilugc] One Day One GNU/Linux Command (LESS) - Bharathi Subramanian