Server IP : 85.214.239.14 / Your IP : 3.145.73.167 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/self/root/proc/2/cwd/proc/self/root/proc/3/root/proc/3/cwd/usr/share/doc/less/ |
Upload File : |
From the man page: You may define an "input preprocessor" for less. Before less opens a file, it first gives your input preprocessor a chance to modify the way the contents of the file are displayed. What this means is that less(1) can automatically open up tar files, uncompress gzipped files, and even display something reasonable for graphics files. You just need to put the following in your .zlogin/.login/.bash_profile/whatever: eval $(lesspipe) or eval $(lessfile) lesspipe will toss the contents/info on stdout and less will read them as they come across. This means that you don't have to wait for the decoding to finish before less shows you the file. This also means that you'll get a 'byte N' instead of an N% as your file position. You can seek to the end and back to get the N% but that means you have to wait for the pipe to finish. lessfile will toss the contents/info on a file which less will then read. After you're done, lessfile will then delete the file. This means that the process has to finish before you see it, but you get nice percentages (N%) up front. If you have some additional tests for binary files that I don't handle, go ahead and send them to me. Note that I will never integrate commands for text files. If you want to add man-ifying or html-izing commands to your copy of lesspipe, go ahead, they just won't be integrated in the main distribution. Here are two additional tests that you might like to use but aren't in the lesspipe script due to speed or principle of least surprise. # Decode directories: if [ -d "$1" ]; then echo "$1:"; ls -l $1 else # view strings inside of an executable if [ -x "$1" ]; then type=$(file "$1") case "$type" in *executable* ) echo -e "$type\n" strings "$1" ;; esac fi These two entries courtesy of Adrian Bridgett <adrian.bridgett@poboxes.com>. Please send in your entries as well. If you have any questions, send me e-mail at <torin@daft.com>. Mentioning less in the subject line will help.