Questions tagged [less]

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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
14 views

How to go to N-th file as described in the man file for less [duplicate]

I love using less to browse files. I often like to move through multiple files. In the man file it says that one can move N files forward: :n Examine the next file (from the list of files given in ...
user avatar
0 votes
1 answer
50 views

Indent wrapped lines using less

Using less you can wrap long lines with -S or --chop-long-lines. Is there any way to indent those wrapped lines?
user avatar
0 votes
0 answers
30 views

DIfference between `less mount` and `mount | less`

I was trying to look at the output of the mount command. less mount gave the following output: (base) jafar_isbarov@jafar-IdeaPad-3-15ADA05:~$ less mount mount: No such file or directory When I ran ...
user avatar
0 votes
0 answers
36 views

Change less pager screen size

I'm trying to change the number of rows less prints to screen. LINES Sets the number of lines on the screen. Takes precedence over the number of lines specified by the TERM variable. ...
user avatar
  • 127
3 votes
1 answer
65 views

How can I stop `less` from removing ANSI color sequences from stdin?

tree go | less -R Debian/Linux tree includes ANSI color escape sequences matching the form ESC]...m in its output. I would like less -R --RAW-CONTROL-CHARS to output the incoming ANSI "color&...
user avatar
  • 103
0 votes
1 answer
310 views

How to go to the next found result when using the less command on a log file in Linux?

I have a log file where I can use less on the file where I know how to go to the bottom of the log file with a shift+G and then use ? to query in the text file. What I don't know how to do is when I ...
user avatar
  • 155
0 votes
0 answers
141 views

Pressing q does not exit in less running in tmux

How to exit file reading mode (in less) in Linux terminal? To quit less, type q. I am using tmux on remotely connected node using ssh. I am connecting into host as follows: ssh -xt4C username@host. ...
user avatar
  • 147
2 votes
0 answers
33 views

How do I see current status of runtime options of less utility?

Less takes runtime options from LESS environment variable + system-wide lesskey file + $HOME/.less file + command line arguments + runtime commands invoked by user. Use case After toggling some ...
user avatar
  • 895
0 votes
1 answer
266 views

The closest thing to 'less -S' using pre-installed Windows command-line tools?

What would be the best way to chop long lines of output (and do some horizontal scrolling perhaps, but I'm not holding my breath) on Windows, using Windows command-line tools like more. I want to ...
user avatar
1 vote
1 answer
83 views

Tuning vim's less.sh: enabling persistent search history

So, I'm using vim's less.sh in place of standard less pager: alias less=/usr/share/vim/vim81/macros/less.sh However, I have a major and a minor problem with it. The major issue is that it does not ...
user avatar
  • 131
0 votes
2 answers
341 views

less command does not open zip files on debian

Here I am using debian/testing distribution on my machine but there is something interesting. # less file.zip "./file.zip" may be a binary file. See it anyway? Do I need to install some ...
user avatar
  • 25
0 votes
1 answer
101 views

How to exit less follow mode without exiting less when xargs is used?

ls -rt *.log | tail -1 | xargs less +GF I use this command to tail -f my logs, but when I ctrl+c to exit follow mode, it quits less too. I think it is caused by xargs, because if you just less <...
user avatar
  • 221
1 vote
1 answer
142 views

Unblock "less" after follow mode / scrolling past end of buffer

I'm using less to capture the output of a live program. Using F activates follow mode, showing me real-time output. However, after entering follow mode (or, more generally, scrolling past the buffered ...
user avatar
  • 1,381
0 votes
2 answers
176 views

less -R does not show colors when processing ANSI colored text via a pipe

The command terraform show does NOT show colored text but the command terraform show | less shows output with what seem to be text color codes: ESC[0m#module.vpc.module.label.data.null_data_source....
user avatar
  • 143
3 votes
0 answers
168 views

How can I paginate Docker commands?

The output of some Docker commands (such as docker container ls) takes a lot of space of my terminal, causing a lot of line breaks, which makes the reading to be a frustrating task. So I wondered if ...
user avatar
1 vote
2 answers
241 views

Italics work everywhere except in less(1)

I followed (and modified) this Reddit post to get italics working in Terminal.app and in tmux(1). Italics work The command echo -e "\e[3mfoo\e[23m" outputs foo (with italics) in both a regular ...
user avatar
1 vote
1 answer
133 views

git log -<number> does not work in Combination with LESS env Variable

I want git log or git diff to clear the screen when I quit. I followed this instruction and added export LESS="FR" to my .bashrc, so that git does not add the X option to the less command (see pager ...
user avatar
  • 172
1 vote
2 answers
677 views

Mouse scrolling less pager output in tmux session

I use export LESS=-R to enable scrolling through less output using mouse scroll. It doesn’t work in tmux. For vim, the solution was to add set mouse=a. What is the equivalent option for less assuming ...
user avatar
0 votes
1 answer
88 views

Have utilities like vim and less source .bash_login or .bashrc for command lines

When I try to enter an alias into the less or vim command lines, they both print “/bin/bash: [MY ALIAS]: command not found” This alias is defined in .bashrc or .bash_login and is there a way to ...
user avatar
1 vote
2 answers
110 views

`vim | less` breaks things

This is the best place I found for my question. Running vim | less from inside gitbash will cause it to do something that I can only describe as "breaking." Usually I can get the less ...
user avatar
1 vote
3 answers
194 views

`less`: multiple commands, including a search

Imagine you would want less to auto scroll to the end. Easy, as its manual states, do less +G. Imagine you would want less to start at the beginning but after soaking its whole input. Easy, do less +...
user avatar
  • 68
0 votes
1 answer
33 views

When I press up-arrow in 'less' in mintty (cygwin), only the top line changes. How do I fix this?

Here is what is happening: How do I fix this? (Just to be clear, the issue occurs when I type less <any filename>. The man less in the gif is just an arbitrary command to demonstrate the ...
user avatar
  • 101
0 votes
0 answers
69 views

less showing ^M instead of going to a new line

I have a log file where borg --progress adds many lines separated by ^M. Weirdly, less puts the ^M in the screen "as it is", instead of producing a new line. Is there a reason for that? How can I ...
user avatar
1 vote
0 answers
39 views

Print content and exit if the content can fit in one screen in less command

I have the following in my ~/.gitconfig: [core] pager = less -+$LESS -MR This makes less to be used for git commands. git commands output contents in less irrespective of the size of the content. ...
user avatar
  • 119
0 votes
1 answer
25 views

Is there a way to run less without reverting the screen afterward? [duplicate]

I much prefer less over more for paging output since it has a much nicer command interface. However, it has the very annoying feature of clearing the screen back to its original state on exit. The one ...
user avatar
0 votes
2 answers
2k views

Less Compiler is not working in PHPStrom 2018.3

I am using PHPstrom 2018.3 (latest Version). I am getting this error while I am using less to compile through file watcher. Failed to run File Watcher ', Less'. The watcher has been disabled. Error: ...
user avatar
0 votes
1 answer
33 views

less +F but tracking file by name, not inode

I'm looking at log file but it's renamed (logs rotation mechanism). How do I see actual logging file in less-like fashion, so I can stop updating for a while and then continue?
user avatar
1 vote
1 answer
122 views

less -+Option documentation

In this answer less -+S is used, to toggle the -S option off. I am wondering where this behaviour of less is documented, as scrolling less --help only yields +cmd Execute the less cmd ...
user avatar
  • 166
0 votes
0 answers
28 views

Have pager (less) re-run git log upon keypress

Sometimes I find it handy to have the git commit graph (given by git log) displayed side-by-side to the terminal pane I'm working in. git log is run with the less pager by default and only shows the ...
user avatar
  • 171
11 votes
2 answers
508 views

What does `LESS=+/EXAMPLE\:` mean?

In man parallel_tutorial (for GNU parallel) I’ve found the following black magic: LESS=+/EXAMPLE\: man parallel Searching around in the man pages for man, less, and bash, it appears this may have ...
user avatar
0 votes
1 answer
101 views

Graphical less alternative (log file viewer) [closed]

While I'm comfortable in the command line, I find a GUI easier to navigate and able to fit/scroll more information at a time. In the Windows world I'm used to TotalCommander, which has a really nice ...
user avatar
  • 121
1 vote
1 answer
231 views

why is `less` command using too `much` ram

I was using less to examine a rather large file (8GB on a machine with 4GB RAM). I told it to "scroll to the end" (shift+G) and it ran for quite awhile then was killed for using up RAM. I thought ...
user avatar
  • 1,847
0 votes
0 answers
21 views

Less program rendering breaks

I've been experiencing this problem on multiple computers, over a long time, but I could never find any mention of it anywhere so I thought I should ask it to understand whether it's only me once and ...
user avatar
  • 113
0 votes
1 answer
127 views

what's the least-painfull way to have less on Windows?

I want to use less, instead of more, on a Windows machine. I know I can install Cygwin and use its less. But I've also noticed there's GnuWin which offers a less, a stand-alone less, and there are ...
user avatar
  • 7,392
1 vote
1 answer
1k views

Append to compressed log

There is a couple of z-utilities (zless, zcat), which are able to read contents of zipped file in transparent manner. Is it possible to append to compressed log file (in either format, not ...
user avatar
1 vote
2 answers
52 views

Less - How to jump to a part in a large pdf?

I am using less to view a large (Think over 5k page) pdf in my terminal. The pdf is divided up into chapters. I am curious to know, how do I go to a certain chapter in the pdf without knowing the line ...
user avatar
7 votes
2 answers
18k views

`less` "search backward" command line switch?

I know less +/pattern filename will open the file and navigate to the first occurrence of the pattern. Is there a way to tell less to search from the end backwards? Does it even accept more than one + ...
user avatar
1 vote
2 answers
4k views

Pipe grep to less showing the grep command as file name

less -M will show the file name as a prompt, as in: 1 asdf test.txt lines 1-1/1 (END) I like to pipe grep into less for easier reading. Can I get less to interpret the grep command as file ...
user avatar
0 votes
3 answers
114 views

Telling `less` where to break pages

Is there some way to tell less where to break pages? I was hoping that ^L (form feed / page break) would do it, but found it doesn't. I tried the following: The first page. It is three lines long. ^...
user avatar
  • 3,556
0 votes
1 answer
121 views

Special characters in less log file make it useless

I want to save the output of the Python help command to a file. Since it uses less, the obvious way is to "s file" while in less. It works, but the words which less shows in bold are screwed up. Any ...
user avatar
11 votes
3 answers
5k views

Command for reloading file from disk to show changes when using “less?”

In less is there a command for reloading a file from disk, so that less will show any changes made to a file since less was started? This would saving me have to terminate and restart less if I want ...
user avatar
1 vote
1 answer
43 views

less -z option: the manpage refers to it, but does not document it

Simply put, what does the -z flag to less do? In the prezto (zsh shell) config, the $LESS env var is set with flags and the last one is -z-4. What does this do? Is there a version of a less manpage ...
user avatar
  • 3,440
4 votes
1 answer
3k views

regular expression search within command less

Exactly what kind of regular expression search is supported by less (e.g. can I use \d+)? man less isn't clear on that, and my primarily google on that didn't return much good hit either. Thx.
user avatar
  • 7,249
1 vote
1 answer
159 views

Piped output wierdness with 'COMMAND | less', FreeBSD

I'm using FreeNAS 9.2.10 console, which is based on FreeBSD. I'm trying to pipe the output of commands through less as a pager: zfs list -v <poolname> | less. What I get is the tail of the file ...
user avatar
  • 1,505
2 votes
1 answer
148 views

G in less doesn't go to the bottom

when I use G in less it's only scrolling down one screen length, rather than going to the bottom. vim on the otherhand will scroll to the bottom. Is there a reason for this behaviour?
user avatar
  • 1,420
3 votes
1 answer
131 views

How do I close "less" from the outside without it leaving my terminal in a mess?

I'm writing a utility that automatically launches less as a subcommand with its output. Some times an error occurs while writing the output, and I would like to automatically close less and display ...
user avatar
  • 5,347
0 votes
3 answers
305 views

Why does less +F say "can't open '+F'"?

I just read about the advantages of using less +F over tail -f and wanted to try it out. When I do I get the following: less +F /log/nginx_error.log less: can't open '+F': No such file or directory ...
user avatar
0 votes
1 answer
204 views

How to use `less` as default pager for `--help`?

I use --help option a lot. It's annoying how it jumps to the end with help. It can be done with |less option. I want |less to be my default option. Can I use less as default paging for --help? I use ...
user avatar
2 votes
1 answer
119 views

How to map function keys in less?

Is it possible to map function keys (F1-F12) in less with lesskey? This doesn't seem to work: #command F1 forw-line
user avatar
  • 291
1 vote
2 answers
2k views

how to search in all file using less

In less / search for the next pattern and ? search for the previous pattern. Is there any way to search pattern from the start of the file to the end? (I useually search forward and then backward but ...
user avatar
  • 113