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
0answers
19 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. ...
0
votes
0answers
11 views

When enter pressed lines keeps repeating itsef in less running in tmux

I am using tmux on remotely connected node using ssh. I am connecting into host as follows: ssh -xt4C username@host. When I press enter to do scroll down, lines 59-101/3163 3% keeps repeating itself ...
1
vote
0answers
20 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 ...
0
votes
1answer
114 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 ...
1
vote
1answer
46 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 ...
0
votes
2answers
111 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 ...
0
votes
0answers
10 views

How to make less not repeat line number for wrapped lines

I like less -N. However, it would be much greater if it doesn't repeat same line number for wrapped long line. Is there any way to achieve it? Thanks!
0
votes
0answers
19 views

multiple man arguments -> multiple files in less

When I type the following: man task taskrc The first man page is displayed and then once I've closed it, it presents me with some options: --Man-- next: taskrc(5) [ view (return) | skip (Ctrl-D) | ...
0
votes
1answer
46 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 <...
1
vote
1answer
53 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 ...
0
votes
2answers
122 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....
1
vote
0answers
29 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 ...
1
vote
2answers
135 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 ...
1
vote
1answer
103 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 ...
0
votes
2answers
297 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 ...
0
votes
1answer
60 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 ...
1
vote
2answers
76 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 ...
1
vote
3answers
160 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 +...
0
votes
1answer
27 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 ...
0
votes
0answers
45 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 ...
1
vote
0answers
22 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. ...
0
votes
1answer
22 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 ...
0
votes
2answers
1k 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: ...
0
votes
1answer
28 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?
1
vote
1answer
87 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 ...
0
votes
0answers
23 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 ...
11
votes
2answers
490 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 ...
0
votes
1answer
75 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 ...
0
votes
1answer
120 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 ...
0
votes
0answers
19 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 ...
0
votes
1answer
115 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 ...
1
vote
1answer
841 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 ...
1
vote
2answers
49 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 ...
5
votes
2answers
13k 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 + ...
1
vote
2answers
3k 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 ...
0
votes
3answers
85 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. ^...
0
votes
1answer
63 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 ...
9
votes
3answers
3k 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 ...
1
vote
1answer
38 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 ...
3
votes
1answer
2k 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.
1
vote
1answer
149 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 ...
2
votes
1answer
118 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?
3
votes
1answer
113 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 ...
0
votes
3answers
236 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 ...
0
votes
1answer
197 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 ...
2
votes
1answer
93 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
1
vote
2answers
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 ...
1
vote
1answer
473 views

how to delete a file with the `less` pager

Usage I'm viewing a file with less and I want to delete it. (I go over my day's scratch notes in less because it's fast and can easily handle dozens of notes, and sometimes I want to delete a note.) ...
0
votes
1answer
24 views

Open a protected file form within man page/less?

I was reading the man page for firewalld.service and I wanted to open up the service.xml from within the man page (which I believe is less). I know :e would do the job if I had permissions, but ...
2
votes
3answers
765 views

Smart word wrapping in `less`?

I use the Python package rtv as a terminal client to read Reddit. When it gets to a large text box, it calls less display the text. Currently, less wraps the words according to column width, meaning ...