Questions tagged [less]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
40 views

less gives a bunch of files opened

I tried to open a file using less: less /home/me/Desktop/file1 This is returning unexpected result like this: /usr/bin/less: 1: [: missing ] At least one file or directory argument required. Use --...
0
votes
0answers
11 views

Is there any way to “stop following” in less without pressing Ctrl+C?

If I pipe the output of a long-running command to less, for example: foreman start | less -SR And I now press F to follow the output of foreman, is there any way to tell less to stop following, ...
1
vote
1answer
78 views

Jailkit/Chroot - Allow Less and More

I have the need to add the LESS and MORE commands to a jailed-user. I've attempted the following and can't quite get it to work: # which less;which more /usr/bin/less /usr/bin/more Now that I ...
0
votes
0answers
196 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
153 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
135 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
113 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
4k 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
45 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 ...
5
votes
1answer
2k 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
619 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
900 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
149 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 ...
9
votes
5answers
7k 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 ...
15
votes
3answers
7k 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
3answers
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
684 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
136 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
177
votes
10answers
260k 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 ...
26
votes
10answers
6k 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
5k 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 ...
5
votes
3answers
903 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 ...
114
votes
2answers
41k 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?