less

Is it possible to dynamically refresh journalctl with less?

Is it possible to dynamically refresh journalctl with less? I’m using less to view my journalctl logs because it’s more convenient. It doesn’t clutter the console window with logs after you exit less and you can scroll using your mouse wheel. journalctl –unit xyz | less +G But it’s very annoying that I cannot refresh …

Total answers: 2

How do I add line numbers to the man page?

How do I add line numbers to the man page? How can I add line numbers to man pages or info pages in Linux? I want to use line numbers to navigate in man pages. I can write the man page in a file and then open it with Vim, but is there a better …

Total answers: 4

Restrict the number of colums for man (or less)

Restrict the number of colums for man (or less) I use man pages in the console a lot (no GUI), but the wide screen I use really has a lot of columns in text mode. The lines are too long and unpleasant to read. Is there a way to limit the number of columns used …

Total answers: 1

Why don't these LESS_TERMCAP variables work on Oracle Linux?

Why don't these LESS_TERMCAP variables work on Oracle Linux? I’ve been using these variables for a long time to colourise man pages: # Colourise man pages export LESS_TERMCAP_mb=$’E[1;31m’ # begin bold export LESS_TERMCAP_md=$’E[1;36m’ # begin blink export LESS_TERMCAP_me=$’E[0m’ # reset bold/blink export LESS_TERMCAP_so=$’E[01;44;30m’ # begin reverse video export LESS_TERMCAP_se=$’E[0m’ # reset reverse video export LESS_TERMCAP_us=$’E[1;32m’ …

Total answers: 1

How can I disable `v` keybinding in less?

How can I disable `v` keybinding in less? When I use less and press v it switches into the currently set editor (Emacs or vim). MISCELLANEOUS COMMANDS v Edit the current file with $VISUAL or $EDITOR. Is it possible to prevent this behavior where I don’t want current file to be open in the editor? …

Total answers: 2

How can I keep colouring when piping man to less?

How can I keep colouring when piping man to less? I have this in my .zshrc file export MANLESS="" export LESS="–RAW-CONTROL-CHARS" export LESS_TERMCAP_mb=$(tput bold; tput setaf 5) export LESS_TERMCAP_md=$(tput bold; tput setaf 1) export LESS_TERMCAP_so=$(tput setaf 1; tput setab 3) export LESS_TERMCAP_se=$(tput rmso; tput sgr0) export LESS_TERMCAP_us=$(tput setaf 3) export LESS_TERMCAP_ue=$(tput sgr0) When I use …

Total answers: 2

less command: b/f vs w/s

less command: b/f vs w/s About the less and according with: Less command Linux / Unix Colored Man Pages With less Command indicates the following: f ^F ^V SPACE * Forward one window (or N lines). b ^B ESC-v * Backward one window (or N lines). z * Forward one window (and set window to …

Total answers: 1

less command g vs p option

less command g vs p option In less for navigation purposes according with this tutorial Less Command in Linux indicates: g Go to the first line in the file. p Go to the beginning of the file. I tested both, and of course the result is the same (of course using G to go bottom) …

Total answers: 2

How to make less +F follow symbolic link if link changes

How to make less +F follow symbolic link if link changes When you tail a file that is a symbolic link you can make tail follow the link if it changes with tail -F. Is there someone that have a solution to make less behave the same way if you’re opening a symbolic link in …

Total answers: 1

Is `git branch` using `less` a recent change? Or is `less` behaving differently recently?

Is `git branch` using `less` a recent change? Or is `less` behaving differently recently? Appologies for the vague title. I frequently execute git branch throughout the day, and it seems at some point recently (perhaps in the past month?) the behavior has changed. I recall previously git branch would print the list of branches and …

Total answers: 2

Command-line variable assignment and command execution

Command-line variable assignment and command execution While researching more in-depth information about Bash subshells, I ran into an interesting execution that I would like to understand why it works. The execution involves assigning a string to a variable that is then used when man is called, link to original example. I have already read about …

Total answers: 1

less – How to get matching line not be the top line on screen?

less – How to get matching line not be the top line on screen? Very often happens that I do $ man someprogram to inspect the manual for some program. Often I also want to search for something in there, and I simply hit / and write whatever I want to search for. Unfortunately, whatever …

Total answers: 1

less -R (-r) doesn't produce colored output

less -R (-r) doesn't produce colored output I’m trying to get colored less output in my terminal. Below is how I expect the output to look, and underneath that what “less -r” or “less -R” actually produces. I’m using a build of suckless st that’s collected here: https://github.com/Lukesmithxyz/st And I haven’t really customized it at …

Total answers: 1

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

What is the difference between "more" and "less" commands? What is the difference between the two commands below? more file-name less file-name Asked By: BlueSkies || Source more is the oldest, less is an improvement and most is an improvement on that. Short comparison: more: forward navigation and limited backward navigation. less: both forward and …

Total answers: 3

less search: show match with context before match (within less)

less search: show match with context before match (within less) I would like to modify the search behavior when inside less: By default next match is shown at the very top line. Instead show me next match of word at 5th line of screen/ show 4 lines before match. Like so: yadda yadda yadda more …

Total answers: 1

How do I search a file using "less" for a value with a decimal point?

How do I search a file using "less" for a value with a decimal point? So I less my file: less myFile.log Then I try to search for a value: /70.5 I’ve since learned less uses regex, so . is a wildcard. I’ve tried to escape it with no success. Asked By: notAChance || Source …

Total answers: 3

`less` performs differently when invoked from Bash and from Git

`less` performs differently when invoked from Bash and from Git When I view a large diff with git diff, it gets paged with less. This is confirmed by opening another window and checking data from ps -aux and /proc. However, when less is invoked by Git, it does not revert the terminal content to its …

Total answers: 1

Where is less search pattern reference?

Where is less search pattern reference? Where can I find reference for less regex search patterns? I want to search file with less using d to find digits, but it does not seem to understand this wildcard. I tried to find a reference for less regex patterns, but could not find anything, not on man …

Total answers: 3