• <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年7月>
            24252627282930
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234

            常用鏈接

            留言簿(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 聶文龍 閱讀(506) 評論(0)  編輯 收藏 引用 所屬分類: Linux
            精品久久久久久无码人妻热| 欧美一区二区久久精品| 久久精品麻豆日日躁夜夜躁| 久久久久久久亚洲Av无码| 久久精品国产亚洲av水果派 | 久久精品国产精品亚洲| 亚洲国产精品无码久久一线 | 国产精品久久久久久久久免费| 亚洲精品高清一二区久久| 伊人久久综在合线亚洲2019 | 久久亚洲中文字幕精品一区| 久久国产午夜精品一区二区三区| 亚洲天堂久久久| 久久不射电影网| 久久国产精品久久精品国产| 久久中文字幕无码专区 | 无码国内精品久久人妻蜜桃| 欧美亚洲国产精品久久蜜芽| 色欲av伊人久久大香线蕉影院| 99久久无码一区人妻| 亚洲色大成网站WWW久久九九| 久久久久国产精品人妻| 精品多毛少妇人妻AV免费久久| 99久久精品午夜一区二区 | 久久精品成人欧美大片| www.久久99| 久久国产高潮流白浆免费观看| 欧美精品福利视频一区二区三区久久久精品 | 亚洲国产日韩欧美综合久久| 精品久久久久中文字幕一区| 久久精品国产91久久综合麻豆自制| 精品伊人久久大线蕉色首页| 久久久久国产精品麻豆AR影院| 国产亚洲欧美成人久久片| 久久久无码精品亚洲日韩按摩| 777午夜精品久久av蜜臀| 国产香蕉久久精品综合网| 久久久噜噜噜久久中文字幕色伊伊| 免费一级欧美大片久久网| 怡红院日本一道日本久久| 久久亚洲国产欧洲精品一|