📄 00000019.htm
字号:
<BR> eval `dircolors /etc/DIR_COLORS -b`
<BR> export LS_OPTIONS='-F -T 0 --color=tty'
<BR>
<BR> 这样就设定了LS_COLORS的环境叁数,其中存有 <BR>/etc/DIR_COLORS中的颜色变数表。注意:这项设置对rxvt的有些
<BR> 版本无效,原因不明。不妨改用xterm中的一些其他特性。可能 <BR>rxvt中仍有程序错误,以致有时不能运用设定
<BR> 的环境叁数。
<BR>
<BR> 3.3 less(1)
<BR>
<BR> 利用这个优越的页面调度程序不仅能浏览一般文字文档,也能 <BR>观看压缩的gzip文档和以tar和zip格式储存的
<BR> 档案文档,其设置如下:
<BR>
<BR> 如要配合使用方向键,则将以下以ASCII编写的一般文字 <BR>档.lesskey 置于home目录内:
<BR>
<BR> ^[[A back-line
<BR> ^[[B forw-line
<BR> ^[[C right-scroll
<BR> ^[[D left-scroll
<BR> ^[OA back-line
<BR> ^[OB forw-line
<BR> ^[OC right-scroll
<BR> ^[OD left-scroll
<BR> ^[[6~ forw-scroll
<BR> ^[[5~ back-scroll
<BR> ^[[1~ goto-line
<BR> ^[[4~ goto-end
<BR> ^[[7~ goto-line
<BR> ^[[8~ goto-end
<BR>
<BR> 然後运行指令lesskey。这会生成绑定键位的二进制文档 <BR>.less。
<BR> 编制下列称为/usr/bin/lesspipe.sh的文档:
<BR>
<BR>
<BR> #!/bin/sh
<BR> # This is a preprocessor for 'less'. It is used <BR>when this environment
<BR> # variable is set: LESSOPEN="|lesspipe.sh %s"
<BR> # 此为‘less’的预处理器。当环境叁数定为 <BR>LESSOPEN="|lesspipe.sh %s"
<BR> # 时,便起用这个预处理器。
<BR> #
<BR> #
<BR> lesspipe() {
<BR> case "$1" in
<BR> *.tar) tar tf $1 2>/dev/null ;; # View contents <BR>of .tar and .tgz files
<BR> <BR> # 阅读.tar和.tgz档的内容
<BR> *.tgz|*.tar.gz|*.tar.Z|*.tar.z) tar ztf $1 <BR>2>/dev/null ;;
<BR> *.Z|*.z|*.gz) gzip -dc $1 2>/dev/null ;; # <BR>View compressed files correctly
<BR> <BR> # 正确阅读压缩文档
<BR> *.zip) unzip -l $1 2>/dev/null ;; # View <BR>archives
<BR> <BR> # 阅读档案文档
<BR> *.arj) unarj -l $1 2>/dev/null ;;
<BR> *.rpm) rpm -q -p -i -l $1 2>/dev/null ;;
<BR> *.1|*.2|*.3|*.4|*.5|*.6|*.7|*.8|*.9|*.n|*.man) <BR>FILE=`file -L $1`
<BR> FILE=`echo $FILE | cut -d ' ' -f 2`
<BR> if [ "$FILE" = "troff" ]; then
<BR> groff -s -p -t -e -Tascii -mandoc $1
<BR> fi ;;
<BR> *) FILE=`file -L $1` ; # Check to see if <BR>binary
<BR> <BR> # 检查是否为二进制文档
<BR> FILE1=`echo $FILE | cut -d ' ' -f 2`
<BR> FILE2=`echo $FILE | cut -d ' ' -f 3`
<BR> if [ "$FILE1" = "Linux/i386" -o "$FILE2" = <BR>"Linux/i386" \
<BR> -o "$FILE1" = "ELF" -o "$FILE2" = "ELF" <BR>]; then
<BR> strings $1
<BR> fi ;;
<BR> esac
<BR> }
<BR>
<BR> lesspipe $1
<BR>
<BR>
<BR> &nb
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -