You're seeing the escape sequences that tell the terminal to change colors displayed with the escape character shown as ESC, whereas the desired behavior would be that the escape sequences have their intended effect.
Commands such as git diff and git log pipe their output into a pager, less by default. Git tries to tell less to allow control characters to ...
Yes, less can follow by file name
The feature has a fairly obscure syntax:
less --follow-name +F file.log
With less, --follow-name is different from the tail option --follow=name.
It does not make less follow the file, instead it modifies the behaviour of the command key F inside of less to follow based on the file name, not the file descriptor.
There are two worldviews here:
As far as programs using termcap/terminfo are concerned, your terminal potentially has two modes: cursor addressing mode and scrolling mode. The latter is the normal mode, and a program switches to cursor addressing mode when it needs to move the cursor around the screen by row and column addresses, treating the screen as a ...
When no other pager is specified, man uses less to display man pages.
The other answers that involve changing the pager command line are correct, but you can also type -i while less is running. From the less man page:
- Followed by one of the command line option letters (see OPTIONS
below), this will change the setting of that option and print a
Only if you use caps, not if you just use lower case letters. For example, run man bash and try:
/invoc <== case insensitive
/Invoc <== case sensitive
/INVOC <== case sensitive
As @manatwork poited out in the comments, you can also control this behavior by adding export MANPAGER='less -I' to your ~/.profile. The MANPAGER variable defines which ...
Yes, using J (as in ShiftJ). So you can go to the end of the file with G, then scroll down past the end with J until the last line of the file is at the top of the screen (less won’t let you scroll any further).
K and Y do the same at the top of the file, scrolling up past the beginning until the first line is at the bottom of the screen.
As David Ongaro ...
If you're familiar with vim, this is probably the best option for you. You can enable horizontal-scroll-bind-only by changing 'scrollopt':
So with vim -u NONE, you get the desired behavior with:
:windo set scrollbind
You may want to adjust 'sidescroll' and 'sidescrolloff' to change how many columns ...
There is a solution using Vim.
First, we need a Vim macro, which will do most of the work, I save it in ~/.vim/plugin/less.vim:
" turn vim into a pager for psql aligned results
execute 'above split'
" resize upper window to one line; two lines are not ...
The default underlines hurt my eyes. This setup greatly improves my man page reading:
Add the following in your `~.bashrc':
# Have less display colours
# from: https://wiki.archlinux.org/index.php/Color_output_in_console#man
export LESS_TERMCAP_mb=$'\e[1;31m' # begin bold
export LESS_TERMCAP_md=$'\e[1;33m' # begin blink
most hotkeys are highly configurable. The settings are customized with ~/.mostrc file.
Actually, your most package most likely comes with lesskeys.rc example configuration, somewhere in the documentation folder (it's /usr/share/doc/packages/most/lesskeys.rc for me on openSUSE Leap 42.1).
You just need to copy that file's contents into your ~/.mostrc and ...
The more command is considerably older than the less command (1978 vs 1983ish). The less command was introduced as a 'backwards more' (because you could scroll up). The more command is part of the OS binaries with most modern unix/linux OSs, while less is maintained externally as an open source project.
I'll often use more on systems with the bare minimum ...
iselect provides an up-down list, (as input from a prior pipe), in which the user can tag multiple entries, (as output to the next pipe):
# show some available executables ending in '*sh*' to run through `whatis`
find /bin /sbin /usr/bin -maxdepth 1 -type f -executable -name '*sh' |
iselect -t "select some executables to run 'whatis' on..." -a -m |
sets the shell variable PAGER to the value less. For man (or anything other than the current shell) to see this, you will have to additionally make PAGER an environment variable. You do this with export, either through
A shell variable is "exported into the environment" with export. This ...
Try this (you'll need to install multitail):
multitail -du -t "$(head -n 1 filename)" filename
or, for headers longer than one line:
multitail -wh 2 -l "head -n 2 filename" filename
If you want to follow command output instead of a file:
multitail -wh 2 -l "command | head -n 2" -l command
or use -t as appropriate. Note that you may need to use unbuffer ...
I think you've brought up a culture clash caused by a technical limitation. Since Shift+Space generates the same output as Space, the Unix terminal model treats them identically. To distinguish between the two, you need a programming environment that supports key up / key down events. That is possible in X11 and in terminal emulators that support ...
You can pipe the output of ls to pipe as follows
$ ls | less
Then you are able to use less to browse the output, for example with Page Up and Page Down. You can exit less by pressing q.
Type man less to find out more ways to scroll the output.
A library called curses, it knows what terminal type you are using, and sends the correct escape sequences. There terminal is asked to switch to a different vertical buffer, and mode that allows more control.
It's the shell that sets the pipeline up. less is not involved in that.
When you do ls | less, the shell starts ls and less concurrently after having made the stdout of the process that will eventually execute ls the writing end of a pipe and the stdin of the one that will execute less the reading end of that same pipe.
ls detects that its stdout is not a ...
The Linux kernel has options to restrict what physical address ranges it will use as RAM, but that won't prevent buggy drivers or access through /dev/mem to escape those ranges. You won't gain anything from modifying the MMU configuration during the boot stage, because the kernel will take control of the MMU after that anyway. If you want to be absolutely ...
It really depends on the application that is used to open a document. perldoc uses application defined in PERLDOC_PAGER, MANPAGER, or PAGER environment variable.
It defaults to less viewer on most systems, so you should press q when browsing the document. But if by accident you pressed other keys, you might need to finish the operation before q would allow ...
You can write vipe in a few lines of shell. Quick-and-dirty proof-of-concept that works for me:
EDITOR=vi # change to preferred editor as needed.
cat > .temp.$$
if $EDITOR .temp.$$ < /dev/tty > /dev/tty 2>&1 ; then
Source this into your shell and there it is. The purpose of the if is to ...
You can add a no-clear to this a couple of ways. You can resolve less from clearing the screen by calling it with the -X argument.
Note the $ symbol in the command lines below. This is specifying the terminal prompt of a normal user.
$ seq 1 200 | less -X
If that is your desired behavior you can alias less to this default with:
$ alias less='less -X'
The man page for systemctl (man systemctl) explains this behaviour clearly, and even offers options to change it:
$SYSTEMD_PAGER Pager to use when --no-pager is not given; overrides $PAGER. If neither $SYSTEMD_PAGER nor $PAGER are set, a set of well-known pager implementations are tried in turn, including less(1) and more(1), until one is found. If no ...
Solutions within Mutt
I'm not finding much in the way of how to do this. Mutt has *_format variables, I suspect you could use those to control pager_format and index_format, for example:
set index_format="%4C %Z %[!%y-%m%d] %-18.18F (%4c) %s"
set pager_format="%S [%C] %n (%l) %s"
But I don't think this will give you what you want. Also I found a ...