Questions tagged [less]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
75 views

MySQL client 8.0 showing "fwrite: Broken pipe" on large query when using a pager

I have always been using a pager (--pager="less -SFX" to be more specific) for MySQL client. Previously I was on version 5.6 of MySQL client/server and it was doing great. Recently I ...
0 votes
0 answers
49 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
0 answers
36 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,128
1 vote
1 answer
250 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
0 answers
314 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 ...
1 vote
1 answer
273 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) ...
  • 263
-1 votes
1 answer
186 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
0 answers
208 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....
11 votes
2 answers
5k 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
0 answers
50 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 ...
  • 1
5 votes
1 answer
3k 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
3 answers
885 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 ...
  • 4,040
9 votes
5 answers
1k 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 ...
  • 4,040
-1 votes
1 answer
215 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 ...
  • 141
11 votes
5 answers
8k 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 ...
  • 411
17 votes
3 answers
11k 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 ...
  • 1,076
2 votes
3 answers
2k 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 ...
  • 411
0 votes
1 answer
731 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 ...
  • 827
4 votes
2 answers
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 ...
  • 5,101
0 votes
1 answer
188 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
  • 113
208 votes
11 answers
319k 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 scrolls up line-by-line only with ↑. What's a more powerful less usage which provides scrolling by page, backward pattern search, and so on?
2 votes
1 answer
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 ...
  • 375
30 votes
13 answers
10k 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 ...
10 votes
1 answer
7k 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
1 answer
2k 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
3 answers
1k 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 ...
  • 2,346
127 votes
2 answers
47k 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?
  • 6,907