Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [less]

The tag has no usage guidance.

0
votes
0answers
70 views

How to open multiple log files with less and logrotate?

I use logrotate for nginx and php logs. By default it names files like: access.log access.log.1 access.log.2.gz ... access.log.10.gz I want to open all of the log files in less so I can search ...
0
votes
1answer
102 views

How to set LESSCHARSET system wide?

This is a follow up on How to make the 'less' command handle UTF-8? If I want to set options for less globally, so that each user doesn't have to fiddle with their own env vars (.basrc, etc) ...
-1
votes
1answer
111 views

Bash script ctrl+c error

I have log file system that renames the latest log file with current time and i must set a less command to check log file easily. I can quit less sommand with q but i must follow the latest incoming ...
0
votes
0answers
73 views

*searching* for color changes in less

I have less already displaying colored output (e.g. from Vagrant or Packer) by having the LESS environment variable set to -R. What I'd like to be able to do now is to search for specific colors, e.g....
10
votes
2answers
3k views

journalctl - stop following without exiting pager

If I do: journalctl -u my-service then a Shift-F to follow while paging, how do I (interrupt to abort) without exiting the pager? With less, I typically just ^C, but if I do that in journalctl, it ...
0
votes
0answers
41 views

less doesn't work in LXC container

I'm experiencing some trouble running less and expect inside LXC container (whether using console or SSH) Expect won't work before I won't add an "interact" anywhere in the script, and less doesn't ...
4
votes
1answer
1k views

How to grep a continuous stream, with paging

I posted this to Superuser but got no takers: https://superuser.com/questions/832578/how-to-grep-a-continuous-stream-with-paging I want to take a log file and filter out some irrelevant log entries, ...
3
votes
3answers
499 views

Reopen a truncated file while following a file with less

Sometimes I am running a less +F on a log file, which I then truncate. I would like less to realize that the file has been truncated and start following the file as it is now. Currently, I am forced ...
8
votes
5answers
761 views

Adding tail behaviour where enter adds blank lines to less

I love less, which I can use to follow logs with the +F flag (or the ShiftF hotkey), search forwards and backwards, and generally move freely through the document. But there is one thing missing in ...
0
votes
1answer
134 views

Overwrote less command, how do I reinstall it?

I was trying to use the following command to pipe the results to less so that I could read a listing fully: ls -lh | less This, according to various sources pipe the contents to less and allow ...
8
votes
5answers
6k views

less with “update file” like functionality

I want to watch a file that gets overwritten every 5 minutes with less. How can I make less follow the new file descriptor instead of keeping the old one displayed? watch "cat file" won't do it ...
12
votes
3answers
5k views

How to get less to seek faster with large log files?

I am often dealing with incredibly large log files (>3 GB). I've noticed the performance of less is terrible with these files. Often I want to jump do the middle of the file, but when I tell less to ...
2
votes
2answers
1k views

`less` not able to display special characters

I stumbled upon bad special characters in some manpages: If your terminal is a "true" auto-margin terminal (it doesn▒<80><99>t allow the last position on the screen to be updated ...
0
votes
1answer
663 views

Following a file mixed with grep to exclude lines

Basically I want to combine the function whereby you can Less a file and then Shift+F to follow the file, as you would do with Apache's access.log. However I would like the output to ignore/hide ...
4
votes
2answers
2k views

“Chop lines” in `less` isn't working

I'm doing: less -S my_database_dump.sql In order to see the files with the lines chopped (i.e. line wrapping.) But it's not working, the lines aren't being wrapped and I need to scroll horizontally ...
0
votes
1answer
132 views

How do you jump to a particular line when using less from the command line?

I want something like: less -j 4567 file.txt
158
votes
10answers
216k views

How to read backward from the end of file in less or more?

I've found one way so far: less +G filename, but it's scroll up only with up key line by line. What's more powerful less usages which provide scrolling by page, pattern search backward and so on?
2
votes
1answer
2k views

Less - Use PageUp/PageDown keys in Solaris

I have been away from Solaris for the last 5 years. I am use to use pageup and pagedown rather than b and f. Anyone know a simple way to make this work? My shell is /bin/tcsh ( Im QA so I cannot ...
24
votes
10answers
5k views

Is there a paging version of `watch`?

Under a UNIX shell, how can I get a similar effect to the watch command, but with paging so that I can scroll around in the output if it takes up more than one screen? In other words, I want a ...
9
votes
1answer
4k views

How can you set the -R in your LESS environment variable?

The question is based on this answer. How can you set the -R in your LESS environment variable?
1
vote
1answer
1k views

Unable to understand a line of Less_termcap

This problem is related to the thread. The line in my .zshrc export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking The following seems to mean \$ starts the expression ' -- ' says everything ...
4
votes
3answers
752 views

What do you do when a command floods your terminal with too much output?

I'm trying to solve a common annoyance: when SSH'd into remote servers I often do things that produce a lot more output than I'm expecting. For example, grepping a large log file with a pattern that ...
98
votes
2answers
35k views

Colors in bash after piping through less?

When I have dircolors defined life is full of... color. When I pipe ls through less to scroll around I lose the colors. Any suggestions?