• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 298  文章 - 377  trackbacks - 0
            <2007年8月>
            2930311234
            567891011
            12131415161718
            19202122232425
            2627282930311
            2345678

            常用鏈接

            留言簿(34)

            隨筆分類

            隨筆檔案

            文章檔案

            相冊

            收藏夾

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            關于Unix/Linux下查看命令行歷史記錄(history/.bash_history)

            1.vi .bash_history

            關于.bash_history的配置

            export HISTCONTROL=ignoreboth

            Don’t save duplicates

            export HISTSIZE=10000

            這個是針對history命令的設置,The number of commands to remember in the command history. The default value is 500.

            export HISTFILESIZE=10000

            這個是針對history文件(.bash_history)的設置,The maximum number of lines contained  in  the  history file.  When this variable is assigned a value, the his-tory file is truncated, if necessary, by  removing  the oldest  entries, to contain no more than that number of lines.  The default value is 500.  The history file  is also  truncated  to  this size after writing it when an interactive shell exits.
            export HISTIGNORE='ls'

            A colon-separated list of patterns used to decide which command lines should be saved on the history list.Each pattern is anchored at the beginning  of the line and must match the complete line 

            以上的關于history的說明都可以使用man bash查的到,如果想要讓你的配置永久生效,可以把export命令寫到.bash_profile或者全局配置文件/etc/profile里

            2.history

            模糊查詢,history | grep -i "xxx"

            [oracle@bej301441 ~]$ history | grep -i "FND"
               34  2012-07-04 01:29:15 history | grep -i "FND"
               35  2012-07-04 01:29:30 FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct PT_CUSTOM_FUC.ldt FND_FORM_CUSTOM_RULES function_name="INV_INVTOMAI"
               36  2012-07-04 01:29:33 history | grep -i "FND"
            [oracle@bej301441 ~]$

            如何讓history可以有時間戳顯示

            # export HISTTIMEFORMAT='%F %T '

             ....

             1027  2012-07-04 01:12:53 ls /etc/bash*
             1028  2012-07-04 01:13:17 vi /etc/bashrc
             1029  2012-07-04 01:16:04 history
            [oracle@bej301441 ~]$

            清除history記錄

            [oracle@bej301441 ~]$ history -c
            [oracle@bej301441 ~]$ history
               32  2012-07-04 01:20:40 history
            [oracle@bej301441 ~]$
            注:清除history之后,.bash_history里仍會有歷史記錄

            如何不讓系統記錄歷史命令

            # export HISTSIZE=0
            # history
            # [Note that history did not display anything]

            3.使用Control+R來搜索命令

            命令行中輸入Control+R,然后輸入過往命令的key word,你就很容易找到以前執行過的命令了

            (reverse-i-search)`FND': FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct PT_CUSTOM_FUC.ldt FND_FORM_CUSTOM_RULES function_name="INV_INVTOMAI"
            posted on 2013-06-02 14:46 聶文龍 閱讀(501) 評論(0)  編輯 收藏 引用 所屬分類: Linux
            国产精品热久久毛片| 2021久久国自产拍精品| 97精品伊人久久久大香线蕉| 亚洲综合日韩久久成人AV| 四虎亚洲国产成人久久精品| 久久久久久久综合综合狠狠| 九九久久精品国产| 久久精品国产99久久香蕉| 久久se精品一区二区影院| 久久综合九色综合97_久久久| 97久久久精品综合88久久| 国产精品久久精品| 亚洲成人精品久久| 亚洲欧美日韩精品久久| 久久乐国产精品亚洲综合| 久久亚洲国产精品五月天婷| 午夜福利91久久福利| 狠狠色丁香久久婷婷综合图片| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区 | 精品国产乱码久久久久久呢| 免费无码国产欧美久久18| 亚洲AV无码一区东京热久久| 国内精品久久久久影院一蜜桃| 久久精品无码一区二区三区| 精品熟女少妇aⅴ免费久久| 日本加勒比久久精品| 99蜜桃臀久久久欧美精品网站 | 久久精品欧美日韩精品| 久久久久免费精品国产| 久久免费视频6| 亚洲精品美女久久777777| 精品国产一区二区三区久久| 久久国产精品二国产精品| 国产毛片欧美毛片久久久| 国产精品99精品久久免费| 久久高清一级毛片| 伊人久久精品无码av一区| 国产一区二区精品久久| 久久中文字幕精品| 久久免费美女视频| 2021最新久久久视精品爱 |