less is a terminal pager program used to view (but not change) the contents of a text file one screen at a time.

learn more… | top users | synonyms

26
votes
3answers
4k views

Colors in Man Pages

When I look at a man page in my 'console' (not an xterm) I see some coloration, but I don't get this in my xterm's (e.g. konsole) is there any way I can enable this? hopefully a fairly simple ...
32
votes
1answer
2k views

Is there any way to exit “less” without clearing the screen?

Relatively often, I find myself wanting to quit less but leave what I was viewing on the screen, to refer back to. Is there any way to do this? Workarounds? (My current workaround is to quit, then ...
17
votes
7answers
4k views

Isn't less just more?

When I do more filename and less filename, it would seem that the resulting terminals are quite similar. I can navigate and search through my files identically (j, Space, /pattern, etc.). I find it ...
17
votes
6answers
2k views

Is there a way to make tail -F beep?

Is there a way to make tail -F or less beep (ring the bell in a terminal) when new data comes in (a new line is added to the file). Or is there any other unix utility to do this on a linux or mac.
5
votes
3answers
334 views

How to scroll large datafile while keeping header

Suppose I have some large datafile, which overflow the screen in both vertical and horizontal direction. How can I browse this file, while the header-lines stay on the screen? For the moment, I am ...
8
votes
1answer
508 views

Documentation on LESS_TERMCAP_* variables?

I see these pretty colors in manpages viewed with less when setting a bunch of these variables. What do they mean, where is the documentation? Is this interpreted by less or termcap? screenshot
6
votes
2answers
212 views

How can I pipe colored tree result to less or more?

I get colored tree using tree -C but when I pipe it to less I get results like this: tree public/ -C | less How can I have colors in less in this case?
5
votes
2answers
290 views

Write lines to a file from less

While in vim I can write a range of lines from the file I'm viewing to another file. For example, :1,10 w outfile.txt will write lines 1 through 10 to outfile.txt. Can I do the same while I'm ...
4
votes
3answers
4k views

Characters encodings supported by more, cat and less

I have a text file encoded as following according to file: ISO-8859 text, with CRLF line terminators This file contains French's text with accents. My shell is able to display accent and emacs ...
32
votes
7answers
27k views

Is there a way to dynamically refresh the less command?

I like the watch command, but it has its limitations. I'm curious to know whether I could mimic the functionality of watch with less. I'm mainly looking for the ability to scroll through my directory ...
61
votes
3answers
16k views

Can less retain colored output?

Can I get less not to monochrome its output? E.g., the output from git diff is colored, but git diff | less is not.
20
votes
2answers
8k views

What are the differences between most, more and less?

I'm now using Arch Linux, and find a command most works like more and less. To understand the differences between them is a confusing problem. This Question has mentioned the differences between less ...
17
votes
4answers
2k views

How can I use man without less?

By default, man uses less to output text. How can I tell it to just output to stdout? My terminal emulator has a scroll bar and search function and I want to use those instead of the arrow keys.
6
votes
4answers
527 views

pager program like less, able to repeat top N lines

Is there any way to make less program repeat first line (or first 2 lines) on every displayed page? Is there any other pager program which can do this? This would be a killer-app for database table ...
12
votes
2answers
1k views

How to use `cat` or `less` depending on the line count?

When looking at the content of files, I'd like to automatically cat short files but less those that exceed the screen size. I could use something with wc -l, but is there a better way that maybe also ...
5
votes
3answers
673 views

Piping into less and editing: “cannot edit standard input” error. Workarounds?

I recently learned that if I page my files with less, I can press v and open the buffer in Emacs. This works as long as I have the environment variable $EDITOR set up correctly, which in my case I ...
3
votes
1answer
252 views

Use _roff to underline words

I currently have a file that I'd like to pass through a _roff to format with underline a few words in the file, and then view the file in less. Just a few, mind you, not whole sections or anything. ...
7
votes
3answers
110 views

Can I force `man` to do lower case sensitive matching?

When I search man pages, the search is case sensitive, but only with regard to upper case letters. E.g., x will match x and X whereas X only matches x. This is the man-db version of man, used on ...
5
votes
2answers
207 views

How do I less a filename rather than an inode number?

I have a piece of software that rotates its log files when it restarts. However, during development, I am restarting it a lot, so I would like to monitor the latest log file at any time. If I start ...
4
votes
4answers
2k views

less command and syntax highlighting

I need to use the less command with the syntax highlighting of the vim command for python, C, bash and other languages. How do I apply syntax highlighting colors according to vim colors for less ...
2
votes
1answer
763 views

less is always case-insensitive

Trying to find out how to use case-insensitive searches in less I found this on serverfault. That seems to perfectly answer my question. The problem is: It doesn't work like that here (openSUSE 13.1; ...
2
votes
1answer
471 views

What is the `less` command line option to page to the next file at the end of the current one?

I'm sure there used to be an option in less which allowed you to page onto the next file after you reached the end of the current file, so you could just keep *space*ing through a bunch of short files ...