- 3,129 hits
Place for playing with commands…
ODOC: bala@bala:~ less
Less is a program similar to more, but which allows backward movement in the file as well as forward movement. Also, less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like vi.
Most options may be changed either on the command line, or from within less by using the – or — command. Options may be given in one of two forms: either a single character preceded by a -, or a name preceeded by –.
FINDING: -a ........ --search-skip-screen Forward search, skips current screen. -g ........ --hilite-search Highlight only last match for searches. -G ........ --HILITE-SEARCH Don't highlight any matches for searches. -h [N] .... --max-back-scroll=[N] Backward scroll limit. -i ........ --ignore-case Ignore case in searches. -I ........ --IGNORE-CASE Ignore case in searches and in search patterns. -j [N] .... --jump-target=[N] Screen position of target lines. -p [pattern] --pattern=[pattern] Start at pattern (from command line). -t [tag] .. --tag=[tag] Find a tag. -T [tagsfile] --tag-file=[tagsfile] Use an alternate tags file. -y [N] .... --max-forw-scroll=[N] Forward scroll limit. Line Editing: These keys can be used to edit text being entered on the "command line" at the bottom of the screen. RightArrow ESC-l Move cursor right one character. LeftArrow ESC-h Move cursor left one character. CNTL-RightArrow ESC-RightArrow ESC-w Move cursor right one word. CNTL-LeftArrow ESC-LeftArrow ESC-b Move cursor left one word. HOME ESC-0 Move cursor to start of line. END ESC-$ Move cursor to end of line. BACKSPACE Delete char to left of cursor. DELETE ESC-x Delete char under cursor. CNTL-BACKSPACE ESC-BACKSPACE Delete word to left of cursor. CNTL-DELETE ESC-DELETE ESC-X Delete word under cursor. CNTL-U ESC (MS-DOS only) Delete entire line. UpArrow ESC-k Retrieve previous command line. DownArrow ESC-j Retrieve next command line. TAB Complete filename & cycle. SHIFT-TAB ESC-TAB Complete filename & reverse cycle. CNTL-L Complete filename, list all.
Ex: $ man pwd | less +/print
Output: View the man page for the pwd command; begin at the first appearance of the word “print“