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
24 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
34 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
75 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
19 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
71 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
88 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
1answer
152 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
0answers
90 views

Need help troubleshooting less and less-watch-compiler

Today I was setting up less and less-watch-compiler and ran into a few problems. So after downloading node, I then downloaded yarn. From GitBash, I wanted to download less and less-watch-compiler, so ...
0
votes
1answer
50 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
53 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 prompt back, ...
0
votes
1answer
18 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
24 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
32 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
21 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
700 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
26 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
72 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
21 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
483 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
61 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
65 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
100 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
513 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
48 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 ...
4
votes
1answer
9k 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
2k 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
60 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
51 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 ...
6
votes
2answers
2k 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
36 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
127 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
105 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
89 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
184 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
192 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
78 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
394 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
544 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 ...
1
vote
0answers
27 views

lesspipe.sh doesn't save tabstop setting

I like to use 4 spaces for tabstop, so my less settings is: export LESS="-x4 -FRS" export LESSOPEN='|lesspipe.sh %s' But when I view source file with less src.c I see 8 spaces which is not what I ...
-1
votes
1answer
45 views

Which CSS pre processor is better and most used: SASS or LESS? [closed]

Before someone may asks, I searched for questions about this but didn't find anything close to that subject. Additionally, if my question is in the wrong place, please let me know and point the ...
3
votes
1answer
736 views

Display Ruler Information in less (cursor position)

Sometimes, if I know I'm not going to do any edits in a window, I use less instead of vi. However, vi displays percentage and cursor position in the bottom right corner. Is there a way to mimic this ...
0
votes
1answer
2k views

Scrolling down while selecting text in PuTTY

Is there anyway we can copy large amount of text to Windows clipboard from file opened through less command? While it's easy to select text that is appearing on the screen, but how to continue ...
1
vote
2answers
129 views

Watching logs with less +F freezes after a while

less +F is a great command for watching logs, but it has very annoying issue. After a while it stops updating log file and requires restart. Is there any way to make it follow file forever?
1
vote
0answers
96 views

Multi-page output :: text select with tmux over ssh

I have a local terminal within tmux. Now I connect to a remote server via SSH and run some command piped to less. With tmux I can easily select part or the entire screen, however I can not select text ...
7
votes
2answers
3k views

Keep color in less after make and pipe

I would like to keep color in less command after using "make 2>&1" to compile some program. There are similar topics with "grep" and "ls" commands but solutions do not work with this command. For ...