history命令技巧

Standard

查看命令历史的时间戳
export HISTTIMEFORMAT=’%F %T ‘
history

2008-12-11 18:01:22 service iptables start
2008-12-11 18:01:36 service mysqld start

清除所有命令历史
history -c

忽略特定命令
export HISTIGNORE=”pwd:ls:ll:”

我的~/.bash_profile

HISTSIZE=9999
HISTFILESIZE=9999
HISTFILE=/root/.history
export HISTTIMEFORMAT='%F %T '
export HISTCONTROL=ignoredups
export HISTIGNORE="ll:ls"

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.