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

7
votes
3answers
78 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 ...
0
votes
0answers
16 views

Why does SPACE sometimes not work with more (or less)

Usually with |more I press space to get another screenful. But with some commands space just does nothing, and I need to actually keep doing SPACE-ENTER to scroll forward a screen at a time. Both more ...
5
votes
2answers
159 views

less '+>' /path/to/file

So Gilles mentioned in the chat room that: less '+>' /path/to/file can be used with less in order to view a file in reverse. I've never seen it before. I'm curious - what's going on with the ...
4
votes
1answer
143 views

How can I get less or cat to use color in the output from .cat of my .bashrc, similar to vi 'ing it?

When I vi my .bashrc file it is colorized, i.e. but when I cat or less the file I get all white, i.e. How can I get cat (and less) to have color? cat does have color for my ruby .rb files but ...
5
votes
2answers
168 views

show colors and disable line wrap

Using the less paginator, you can use the -r option to properly display colored input and the -S option to disable line wrap. However, when using less -rS or equivalently less -r -S, colors are ...
2
votes
1answer
105 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; ...
0
votes
1answer
34 views

Piped search queries in vim or less

I would like to be able to search a log file for lines that being with ^2014-02-18 15:30:[0-9:,]* and have UserName:someguy much later in the same line. I am sure I could do a regex to include any ...
5
votes
2answers
103 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 ...
1
vote
1answer
54 views

Cat and Less give different output

I executed the following command # top > /home/user/top_output.txt Nothing Happened for a while and then i pressed Ctrl+C. When i checked the file that was created, it had the contents in it. So ...
3
votes
1answer
22 views

Have man pages display how far I am through the file

With less, the -m flag extends the prompt to include a percentage. But how do I get man to do the same thing?
2
votes
1answer
37 views

less command runs out of memory

When searching for string (no regex etc.) in large file less filename and less -b 1 filename quits or prints it cannot allocate memory. top shows less using roughly about 5% of memory before it dies ...
3
votes
1answer
46 views

Customizing less colors

When using less in OS X, how can I customize the colors with with things are displayed? When I run less within an ansi-term in Emacs the colors don't come out nicely. $ less --version less 418 ...
4
votes
2answers
36 views

Can less load lines which were appended to a file after opening?

When I am viewing a log file in less is it possible to make less reload the file to get lines which were appended to that file since it was opened?
2
votes
4answers
96 views

How to copy multi-page text from the terminal into the clipboard?

I was viewing a man page for a software on my machine and I needed to copy-paste some of that text but the text was much more than one page. I'm aware I can direct the output to a file and use UI ...
5
votes
1answer
163 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
1
vote
2answers
82 views

can I get the shell to decide ls or less depending on filetype?

Very often I find myself looking through directories using 'ls', then when I find the file I want, I use 'less' to look at the file. So for example to find a mysql log file I might type ls /var ...
1
vote
1answer
54 views

less --quit-if-one-screen without --no-init

I'm on a terminal that supports the alternate screen which is used by less, vim, etc. to restore the previous display after exiting. That's a nice feature, but it really breaks the ...
-2
votes
3answers
73 views

How to get an specific amount of lines in the console with less? [closed]

Can I get the specified number lines at a time by using the less command? I want just ex. show 20 lines even if my screen allows more.
2
votes
2answers
44 views

less freezes at last line when paging output from a running command

I have a CLI app that produces lots of debug output and I have a really big need to search in the output. I'm using less for that but it freezes when I reach the last line with j or G. And it returns ...
0
votes
2answers
107 views

How to exit file reading mode in linux terminal?

I appologize if its something really stupid i am asking. But this is my first day on linux commands infact I dotn have linux right now I have just installed CYGWIN for my learning. SO my question is ...
2
votes
1answer
34 views

Why does combining `less` and `script` disrupt line endings?

This bash snippet will print out the numbers 1 to 10: $ for i in $(seq 1 10); do echo $i; done 1 2 3 4 5 6 7 8 9 10 When I try to use this with script and less like so: $ script -q -c 'for i in ...
3
votes
1answer
116 views

less follow mode - clear screen

I use less follow mode (Shift-F) to follow a log as it is updated. Sometimes it would be useful to do some actions on my system, and then only see log output related to that action. Basically I would ...
2
votes
2answers
287 views

Case insensitive search in man pages

Is there a way to search man pages case-insensitively? Using the '/' search feature matches exact case.
1
vote
1answer
54 views

how to make less -S not take up the entire screen

suppose I have this: cat new_file.txt | less -FRSX Then suppose I press the right button in order to scroll to the right This will cause the contents of new_file.txt to move to the top of the ...
7
votes
3answers
316 views

How does less know the terminal resolution?

Everytime someone set a different size for a virtual console, less recognize window-resolution (I'm assuming that ...); according to that it changes how many lines of text it should visualize. How ...
1
vote
3answers
507 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 ...
5
votes
2answers
137 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?
4
votes
2answers
84 views

Shift-Space in less

In modern web browsers and other software with text content, Space scrolls down more or less a screenful. ShiftSpace scrolls up in everything but less. How can one use ShiftSpace to scroll up in ...
3
votes
2answers
100 views

Viewing very wide files

I need to view some 5,200 byte wide files. Is there any tool to make this practical without modifying the file? Ideally, I'd like to specify which columns I'm viewing.
5
votes
2answers
146 views

Can I get vim-stlye (hjkl) navigation for GNU info?

The layout of my netbook's keyboard means that using the arrow keys for navigation is slightly uncomfortable. Is there a way to make GNU Info pages use vim-style hjkl navigation? I know I can info ...
0
votes
1answer
78 views

less or more - which to use when? [duplicate]

less and more seem to have very similar functionality in that they both page through text a screen at a time. What reasons are there to use one over the other?
12
votes
1answer
2k 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 ...
3
votes
1answer
89 views

How to follow and seek in a file being piped through a filter, in less

I basically wish to seek, search and follow a growing log file after passing it through a sed filter. I figured I need to follow a file with tail -f pipe it to sed and then pipe that to less. For ...
3
votes
2answers
268 views

Get 'less' to display filename

Something that seemed quite useful to me when looking for a certain var in a bunch of config files: less * | grep some_var So this returns the value of some_var without manually looking through all ...
3
votes
3answers
2k 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 ...
0
votes
1answer
104 views

Man displaying groff control characters

Man is displaying groff control characters after I compiled a later version of groff. For example, when I try to view groff's man page: GROFF(1) General Commands Manual ...
1
vote
2answers
828 views

How do I pipe colored diff output to less?

I've been using git diff, which produces colored output. However, I now find I need to use ordinary diff for something, and it's producing a lot of output that is hard to read because of the lack of ...
2
votes
1answer
71 views

Making less's follow option show line movement

I often find myself using less to display log files that contain hundreds of contiguous, identical lines that are appended to the files at set intervals. For example, something happened something ...
5
votes
1answer
219 views

Making less print to stdout if an entire file can be displayed on one screen

When more is passed a file whose contents can be displayed on one screen, it just writes the file's contents to stdout without pagination. If the file cannot fit on one screen, more paginates it. ...
4
votes
2answers
161 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 ...
2
votes
2answers
159 views

Stop Git submodule foreach from opening less for each module

I occasionally need to grep through git submodules for which I use: git submodule foreach 'git grep x' However, since switching to zsh I find a less prompt is opened for each submodule, even when ...
3
votes
4answers
343 views

Colored output in less when tailing a logfile

I am in dire need of a way to color my less output while reading a file that is constantly being appended. The file in questions is a Resin servlet container log. My current "implementation" of the ...
2
votes
1answer
1k views

Is GREP_OPTIONS= --color=always ignored?

I was playing around with setting GREP_OPTIONS and couldn't get it to work. Just curious as to why. Simple test commands output: richard@ubuntu:~$ echo $GREP_OPTIONS richard@ubuntu:~$ ...
2
votes
0answers
123 views

Using Unison with colordiff

I want Unison to show the diffs with colordiff. I’ve got diff = colordiff -u CURRENT2 CURRENT1 | less -R in my config file but it seems like Unison pipes the output to plain less nonetheless, so I ...
2
votes
0answers
98 views

Command-line file reader (like “less”) that can tell the line where the user stopped reading

[Context] I'm developing a little app, as a hobby to learn ncurses, that catalogs and lists and searches within a set of documents (for now, they are the HOWTOs from TLDP). The most tricky part of ...
3
votes
1answer
157 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 ...
6
votes
2answers
180 views

How to set up hjkl for less?

less already uses j/k for vertical scrolling, but not h/l for horizontal scrolling (in --ch mode). The l key isn't bound to anything anyway, and h is just a synonym for H, so I wouldn't overwrite any ...
4
votes
1answer
860 views

Instant search in less command? (Similar to incsearch in VIM)

Is there a way to search, while I'm typing in less? Just like the vim option, set incsearch. As I didn't find a proper way to do it, is there any similar tool that can do it?
3
votes
1answer
152 views

Why doesn't “cvs --help | less” work?

I don't know why, but piping cvs --help to less doesn't work. Probably it's because cvs --help outputs not to standard output(1) or error output(2), but somewhere else. Could you tell me where does it ...
7
votes
1answer
1k views

Get colors in less command with ccze: Shift + g doesn't go to the end of file?

In all the tools to get colors with less command: -R, Pygments, GNU Source-highlight, vless, ... ccze make me sastified with below command: ccze -A < /path/to/log/file | less -R but Shift+g ...