Questions tagged [less]

26 questions
203
votes
11 answers

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?
yetanothercoder
  • 2,135
  • 2
  • 13
  • 6
127
votes
2 answers

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?
MathewC
  • 6,877
  • 9
  • 38
  • 53
30
votes
13 answers

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 program that is to watch what less is to cat. As an…
David Dean
  • 441
  • 6
  • 11
17
votes
3 answers

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 jump forward 15 M lines it takes minutes.. The…
UsAaR33
  • 1,036
  • 3
  • 11
  • 20
11
votes
2 answers

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 exits the entire pager.
MikeKusold
  • 231
  • 2
  • 5
11
votes
5 answers

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 because the file is too long to fit into one terminal…
d135-1r43
  • 411
  • 4
  • 13
10
votes
1 answer

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?
9
votes
5 answers

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 less: usually I am at the end of the file, and I…
blueFast
  • 4,000
  • 13
  • 36
  • 51
5
votes
1 answer

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, like ones at the INFO level. The above Stack…
phasetwenty
  • 198
  • 1
  • 7
5
votes
3 answers

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 turns out to be too general. As garbage churns by…
Ben Williams
  • 2,318
  • 4
  • 21
  • 17
4
votes
2 answers

"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 to see the entire line. What can I do?
Ram Rachum
  • 5,011
  • 6
  • 33
  • 44
3
votes
3 answers

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 to do the following: (terminal 1) > less +F…
blueFast
  • 4,000
  • 13
  • 36
  • 51
2
votes
3 answers

`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 without scrolling the screen) consider using a…
d135-1r43
  • 411
  • 4
  • 13
2
votes
1 answer

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 change this. ) if it matters
Brian G
  • 375
  • 2
  • 5
  • 19
1
vote
1 answer

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 know where the binaries are, I do the…
user2643864
  • 165
  • 1
  • 1
  • 4
1
2