Tag Info

New answers tagged

1

less -M +G100g The manual +<linenumber> is a special case for +<linenumber>g (probably does not work in all contexts).


4

That goes back to tele-typewriters (ttys!) in the 70s. Sending X<backspace>X (^H being the ASCII BS character) to a tele-typewriter, causes it to write X, go back one character and write X again on top of itself. It being written twice makes it appear as bold. Similarly, for underline, you'd write _<backspace>X which would write X on top of an ...


2

Works OK for me when looking at a file that's being appended to but not when input comes from a pipe (using the F command - control-C works fine then). See discussion at Follow a pipe using less? - this is a known bug/shortcoming in less.


0

The less option --follow-name is only part of the solution; To replace tail -F, another argument is needed: less --follow-name +F file.log The option alone like less --follow-name file.log does not actually start following the file updates. You need to enter the follow mode be pressing ShiftF. (Exit the mode to navigate by ControlC.) Instead of following ...


1

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. Also, ...


1

With bash, globstar option enable, you can: shopt -s globstar less brscan/**/* But it also includes directories. With zsh, you can filter expansion to regular files only: less brscan/**/*(.) All of the above will fail if too many files return. The safe way is using find: find brscan -type f -exec less {} +


1

specify -not -type d to omit directories from the find result find -not -type d | xargs less or better: find -not -type d -print0 | xargs -0 less which handles filenames with spaces in them better.


0

The Two problems with less slowing your search are pipe wait and opening standard out/error for reading. In normal operation less will read enough to fill a screen and stop reading until you advance to the next page. This works fine unless you are reading from a pipe and the program writing to the pipe notices the pipe id full and sleeps until the pipe is ...


2

The search in less uses regular expressions. To accomplish the search you are looking for, simply replace the shell wildcard ? with .. /x 1..


3

I think you've covered the main point: less +F reads the whole file, whereas on many systems tail -f only reads the end of the file, and even on the systems where it does read the whole file, at least it doesn't keep the whole file in memory. That makes less +F impractical for very large files. You can however run less -n +F, which causes less to read only ...



Top 50 recent answers are included