New answers tagged less
I'm going to assume you're using ls --color=auto, which tells ls to use color in 'automatic' mode. 'Automatic' mode tells less to see if STDOUT is a terminal, and if so, use color, otherwise don't use color. When you pipe ls into less, STDOUT is not a terminal, it's connected to STDIN of less, which is a normal pipe. The solution, use ls --color or ls ...
You can use Alt+u to remove the highlight on last search results. You can highlight them again with Alt+u, it's a toggle. Switching off the highlight does not switch off the status column, showing marks on each line containing a match, if the column is enabled using options -J or --status-column or keys -J. To hide the status column, use -+J. To show ...
less normally refuses to open non regular files like pipes or also binaries. You can use the -f operator to force less to open non regular files: less -f <(command) Another approach is to use process substitution: less < <(command) This causes the pipe that was created with <() to act as standard input (STDIN) for less.
less tends to complain /dev/fd/63 is not a regular file The solution to that, under GNU less at least, is the use of the -f option: less -f <(command) Under normal circumstances, less will not open non-regular files (stdin excepted, obviously). This is for your protection. -f forces non-regular files to be opened.
Top 50 recent answers are included