• <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
            <2017年5月>
            30123456
            78910111213
            14151617181920
            21222324252627
            28293031123
            45678910

            常用鏈接

            留言簿(34)

            隨筆分類

            隨筆檔案

            文章檔案

            相冊

            收藏夾

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

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

            1.vi .bash_history

            關(guān)于.bash_history的配置

            export HISTCONTROL=ignoreboth

            Don’t save duplicates

            export HISTSIZE=10000

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

            export HISTFILESIZE=10000

            這個是針對history文件(.bash_history)的設(shè)置,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 

            以上的關(guān)于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里仍會有歷史記錄

            如何不讓系統(tǒng)記錄歷史命令

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

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

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

            (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 聶文龍 閱讀(509) 評論(0)  編輯 收藏 引用 所屬分類: Linux
            亚洲va国产va天堂va久久| 天天综合久久久网| 久久人人爽人人爽人人av东京热 | 久久综合国产乱子伦精品免费| 少妇久久久久久被弄高潮| 久久综合欧美成人| 久久强奷乱码老熟女网站| 久久精品无码午夜福利理论片 | 久久人人爽爽爽人久久久| 久久国产高清一区二区三区| 久久99精品久久久大学生| 久久久久久久综合日本| 久久精品国产99久久久| 漂亮人妻被中出中文字幕久久| 久久天天躁狠狠躁夜夜96流白浆| 一97日本道伊人久久综合影院| 久久99精品国产| 久久久久亚洲AV无码永不| 久久久国产视频| 伊人情人综合成人久久网小说| 国产福利电影一区二区三区,免费久久久久久久精 | 亚洲国产精品高清久久久| 久久青青草原亚洲av无码| 国产精品热久久无码av| av无码久久久久久不卡网站| 99久久99久久精品国产片果冻| 伊人色综合九久久天天蜜桃| 国产伊人久久| 久久久精品视频免费观看 | 久久久久99精品成人片| 精品久久久无码中文字幕| 99久久99久久精品国产| 伊人久久免费视频| 亚洲国产精久久久久久久| 日本久久久久久中文字幕| 久久综合久久综合九色| 欧美亚洲国产精品久久蜜芽| 青青草原综合久久大伊人精品| 国产精品免费久久久久久久久 | 亚洲精品国精品久久99热一| 色婷婷综合久久久中文字幕|