<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # 練習 2:文本瀏覽器,少即是多 > 原文:[Exercise 2. Text Viewer, The: less is More](https://archive.fo/nFH4J) > 譯者:[飛龍](https://github.com/wizardforcel) > 協議:[CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/) > 自豪地采用[谷歌翻譯](https://translate.google.cn/) 現在你可以編輯文本文件,這很好。但是如果你只想查看一個文本文件呢?當然,你可以使用 vim,但很多時候它是過度的。還有兩件事要考慮: + 如果你想查看非常大的文件,你將需要在盡可能快的程序中查看它。 + 通常你不想意外地改變文件中的某些東西。 所以,我向你介紹強大的`less`,少即是多。“比什么多呢?”你可能會問。嗯...有一次,有一個被稱為`more`的瀏覽器。它很簡單,只是向你顯示你要求它顯示的文本文件。它是如此簡單,只能以一個方向顯示文本文件,也就是向前。 馬克·恩德爾曼(Mark Nudelman)發現它并不那么令人滿意 ,1983 年至 1985 年,他編寫了`less`。從那以后,它擁有了許多先進的功能。因為它比`more`更先進,一句話就誕生了:“少即是多,多即是少”。 好吧,讓我們試試吧。 輸入: ``` less .bashrc ``` 你應該看到: ``` user1@vm1:~$ less .bashrc # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # If not running interactively, don't do anything [ -z "$PS1" ] && return # don't put duplicate lines in the history. See bash(1) for more options # don't overwrite GNU Midnight Commander's setting of `ignorespace'. HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups .bashrc ``` 如果你的終端不是足夠寬,文本將看起來像一團糟,因為它放不下整行。要修復它,請鍵入`- -ch<ENTER><ENTER>`。是的,`dash-dash-ch-ENTER-ENTER`。這將開啟水平滾動。 為了向上向下文瀏覽文字,使用已經熟悉的`j`和`k`。退出按`q`。 現在我將向你展示`less`的高級功能,這樣你只能看到所需的那些行。鍵入`&enable<ENTER>`。你應該看到這個: ``` # enable color support of ls and also add hand # enable programmable completion features (you # this, if it's already enabled in /etc/bash.b ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ & (END) ``` 注意看!為了移除過濾器,只需鍵入`&<ENTER>`。同樣,要記住的命令: + `j` - 向上移動 + `k` - 向下移動 + `q` - 退出`less`。 + `- -chop-long-lines或`- -ch<ENTER><ENTER>` - 開啟水平滾動。 + `/` - 搜索。 + `&something` - 只顯示文件中包含某些內容的行。 ## 附加題 + Linux 具有在線手冊,通過鍵入`man`來調用。默認情況下,在我們的系統中,本手冊將使用`less`來查看。 鍵入`man man`并閱讀,然后退出。 + 就是這樣,沒有更多的附加題了。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看