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. Questions regarding the use of less in Ubuntu should go by this tag

less emerged from a necessity of a pager for large files. vi couldn't open files over a certain size while more was impractical for navigate the files. This prompted Mark Nudelman to write less - opposite of more. Usage of this tool should use this tag.

Less was first written in 1983 by Mark Nudelman, and is the current maintainer of the project. The first public release was done in May, 1985 in the net.sources UseNet.

Why is it called less?

It is better that you read the author's FAQ, but in summary, it is about a joke that they needed "backward more" and someone he doesn't remember said that they need "less", hence the term was coined for the tool.

59 questions
68
votes
2 answers

"less" doesn't automatically decompress gzipped files

On Fedora/Redhat/CentOS the less command seems to magically detect a gzipped file and decompress it on the fly, so you can do: less my_stuff.csv.gz I've just noticed this doesn't work on Ubuntu 11 less my_stuff.csv.gz "my_stuff.csv.gz" may be a…
AndrewR
  • 791
61
votes
3 answers

How do I make `less` output colors?

When I run a program (for example grep or ls) without a pager, its output is colored. However when I run it piping its output to less, no colors are shown. For example, this command outputs colored output: grep -r something but this doesn't: grep…
61
votes
4 answers

What is the difference between "more" and "less" commands?

What is the difference between the two commands below? more file-name less file-name
BlueSkies
  • 2,365
30
votes
2 answers

What is the default PAGER used by man pages?

What is the default PAGER used by man pages. I,e what is the program runs the man pages? It look some like more or less. I'm sure it's not more since more doesn't support reverse backward.
Maythux
  • 87,123
20
votes
3 answers

How can I stop less from storing history?

Every time I search for a term in less, it stores my search in the file .lesshst. How can I stop this behavior?
fouric
  • 4,698
19
votes
1 answer

Why do vim and less have such similar keybindings?

Do they share code, or is that just a tradition? Are there any other programs with similar keybindings?
19
votes
1 answer

How can I redirect what is shown on Terminal to a file, when using the 'less' command?

How do I redirect the Terminal content (the content that currently I'm looking not the entire file, when using the less command) into a outfile until I press the Q to exit from less?
αғsнιη
  • 36,350
17
votes
3 answers

How can I stop following output in less, without affecting the command generating the output?

I am running a server and the log of this server gets logged in terminal, not in any file. I would like to use less to view this log. node server.js | less When I just want to see the log, I use press Shift+F to got to end of file and keep…
Ajay Kumar
  • 181
  • 1
  • 5
15
votes
5 answers

View files without lines with certain string

Searching for a program like tail or less which let me view my logs without lines that contain a certain string. For example view my syslog without UFW ([UFW BLOCK]) entry lines.
John Gr.
  • 153
15
votes
3 answers

After viewing logs with journalctl, how do I exit the screen that says "lines 1-2/2 (END)"?

When you use the command journalctl -p err -b for example, you get an answer that ends with "END". What command do I use to end this and get the opportunity to enter the next command without having to close the window and open a new one? erik@server…
Skalman65
  • 221
12
votes
1 answer

man pages - How to always show total lines and percentage in the bottom status / prompt line

I want to always see the total lines and % part ( line 1/773 0% ) in the bottom status / prompt for man pages immediately upon viewing one. When I open any man page I see this in the bottom line: Manual page man(1) line 1 (press h for help or q to…
Xen2050
  • 8,943
10
votes
3 answers

How do i install less css compiler?

I just installed less css compiler using npm. Now thelesscfile directory is /usr/local/bin/lessc . i'm not clear what i need to change in lessc file and how to understand that compiler has been correctly installed.
10
votes
2 answers

Less output does not show output in terminal after quitting it

Previously, if I ran something | less, and then press q, it used to return me to the prompt with the output of less still visible. $ seq 1 100 | less 1 2 3 4 :q $ But now, after I installed Zsh…
9
votes
1 answer

How does "less" switch to the text, then back to the prompt?

When I run less on some file, the prompt goes away, and I get the contents of the file on screen. Then when I press q, it goes back to the prompt. I think less does this by saving the current terminal buffer, opening a new buffer, outputting the…
wjandrea
  • 14,504
9
votes
3 answers

EDITOR environment variable changes after reboot

While running the less command, pressing v opens the file inside the editor. I have set the EDITOR environment variable to vi by running the command export EDITOR=vi. It works perfectly fine as expected. However when I reboot the computer, the…
Smile
  • 1,129
1
2 3 4