Questions tagged [less]
less is a terminal pager program used to view (but not change) the contents of a text file one screen at a time.
422 questions
0
votes
1
answer
84
views
Using "less" as a pager with conditional exit and input forwarding
How can I use less with the following requirements?
I want to use less and scroll up and down with the arrow keys.
If the entire output fits on the screen, less should automatically exit.
When I type ...
0
votes
1
answer
40
views
Why does this display output: ls 1>/dev/null | less
If I do this: ls 1>/dev/null then as expected there is no output to the screen because it's been redirected to /dev/null
However, if I do this ls 1>/dev/null | less I see the file listing of the ...
5
votes
1
answer
278
views
Cannot fg a zsh function including less
I have this zsh function:
f() {
/usr/bin/find . -type f | less
}
When I run this function, suspend with Ctrl+z, and then run fg, it displays zsh: suspended (tty output) /usr/bin/find . -type f | and ...
0
votes
1
answer
83
views
Does "less" have "--retry" option like "tail"?
I'm using less to continuously trace Squid log file (as well as UFW log) with this command:
less --follow-name -K +F /var/log/squid/access.log
And at the time of rotation of Squid log less quits. I ...
0
votes
0
answers
32
views
less - how to make it not split lines for lines that are too wide when it starts?
I have output that is very wide (output from a sql query) and that, when I start less, is split into multiple lines, difficult to understand what is what... If I press on the right arrow, less will ...
8
votes
1
answer
854
views
Customize the man command's status prompt to show percentage read
I like the man command's status prompt to be customized. The default as picked from its own man page is like this,
Manual page name(sec) line x
But, having it show me the percentage of contents read ...
1
vote
1
answer
364
views
less on MacOS and zsh not showing colors
Solved, problem was in ls binary, that I replaced with (for some unknown reason) and its colorizing options are different to ls. However, leaving this post since it contains very useful debugging tips....
0
votes
0
answers
85
views
Tmux copy-paste with mouse mode on while using the `less` command
Hopefully this is not already answered, given that there are 100s of question specifically about tmux copy-paste on mouse mode.
I am specifically trying to copy text using mouse selection while using ...
7
votes
3
answers
1k
views
How can I make a custom header in less? Or alternatively, how can I open two files simultaneously in less?
How can I prepend some custom text when opening a file in less?
For example, I would like to see something like:
My custom title
Content of the opened file goes here...
I want a command for that ...
7
votes
2
answers
1k
views
Is it possible to dynamically refresh journalctl with less?
I'm using less to view my journalctl logs because it's more convenient. It doesn't clutter the console window with logs after you exit less and you can scroll using your mouse wheel.
journalctl --unit ...
7
votes
1
answer
697
views
Why does `less` show "This account is not available" when run on a file from a root login shell?
This is not really a problem, just a peculiarity that I'd like to understand.
If I get a root shell with sudo bash -l and then run less somefilename I get less only showing:
This account is currently ...
6
votes
4
answers
2k
views
How do I add line numbers to the man page?
How can I add line numbers to man pages or info pages in Linux?
I want to use line numbers to navigate in man pages.
I can write the man page in a file and then open it with Vim, but is there a better ...
0
votes
0
answers
102
views
LESSOPEN not working
LESSOPEN not working for me, don't know why.
In ~/.bashrc currently I have:
export LESSOPEN='| nl %s'
export LESS=' -R -i --use-color'
export LESSSECURE=1
but LESSOPEN doesn't seem to work. LESS ...
0
votes
1
answer
92
views
Restrict the number of colums for man (or less)
I use man pages in the console a lot (no GUI), but the wide screen I use really has a lot of columns in text mode. The lines are too long and unpleasant to read.
Is there a way to limit the number of ...
0
votes
3
answers
217
views
open man (or info) pages from the same position where you left off last time
I treat man pages is the primary source of documentation about installed software.
I would like to use them not only as a reference, but actually read them from beginning to end.
And here comes the ...