less is a terminal pager program on Unix, Windows, and Unix-like systems used to view (but not change) the contents of a text file one screen at a time.

learn more… | top users | synonyms

90
votes
10answers
41k views

Get colors in 'less'' command

when I read a file in Linux with the command 'less' or 'more', how can I get the content in colors?
0
votes
1answer
153 views

Enable wheel in mintty for cygwin comands: less and man

I'm using mintty and cygwin. How to can I enable the mouse wheel inside less and man?
92
votes
5answers
20k views

Less and Grep: Getting colored results when using a pipe from grep to less

I use the --colour option of grep a lot, but I often use less as well. How can I pipe grep results to less and still preserve the coloring. (Or is that possible?) grep "search-string" -R * --colour | ...
53
votes
10answers
17k views

How to syntax highlight via Less

is there a way to syntax highlight a file I see in Less? actually I'm using this command to open an xml file (and sometimes a series of them) less htmleditors/htmleditors_config.xml or less ...
130
votes
4answers
29k views

How to turn off word-wrap in less

Short version: How can I make the less utility in Linux not wrap lines? Long version: Often I need to view huge CSV files using less with hundreds of columns. I frequently only care about the first ...
44
votes
3answers
14k views

less is more? Is more less? I'm so confused

When I first heard their names, I got really confused when I tried to guess what these tools might do, I thought I'd misheard something. What's the difference between more and less, i.e. why ...
34
votes
1answer
21k views

Less: Quickly Jump to Line Number in Large File

I'm struggling to figure out a way to do this...I'm using less to view a large (~1GB) file. I want to jump to line "$n" in the file - preferably without having to wait for lines 1-($n-1) to scroll by ...
9
votes
3answers
2k views

Why does less tail mode stop working?

Using the less command on linux in tail mode (F command or less -f) consistently stops working on certain machines and/or certain files. New changes simply stop showing up. I know I've fixed this ...
3
votes
6answers
1k views

Linux less behavior and stderr

I'm watching the output of my complicated command with less, problem is the stderr gets lost. stderr lines normally get listed inbetween stdout lines inside less. I would like them to be printed to ...
1
vote
4answers
2k views

less emulate a TTY to preserve piped color output

When you pipe something through less, the program usually discards color codes because it's not outputting to a TTY. So you have to add --color=always to the options for it to work. ls -l ...
1
vote
3answers
3k views

Use `less` pager on file with non-standard encoding

I often use the less pager to view logfiles. Usually I use less -F to follow the progress of the log à la tail. However, some logfiles use national characters in a non-standard encoding (Latin-1, ...
8
votes
1answer
2k views

How do I include newlines in a search in less?

How can I search for newlines (or end of lines) as part of a search using less? For example, I'd like to search for length=9\n, but don't want to merely search for length==9 because that'd get ...
4
votes
2answers
402 views

on quit, 'less' does NOT clear its contents when run in a 'screen' session [duplicate]

Possible Duplicate: Using screen, commands like less and man don't clear the screen afterwards When I quit 'less' in a normal bash, it clears the previous contents displayed by 'less' ...
3
votes
3answers
433 views

Less interrupting in less

I often pipe program output to less, e.g. produce_output | less This works great, until produce_output produces large amounts of output. If I search for some text that is deep into the file, less ...
1
vote
7answers
295 views

How can I get file information in 'less' like with 'man'?

When I view a file in Linux with the 'less' command, I often only get a ":" prompt in the bottom left corner. There's no clue about how long the file will be, or at which location I am currently. When ...