- 论坛徽章:
- 0
|
LINUX下如何查看命令历史及输入时间?
export PROMPT_COMMAND='{
date "+: %c; `history 1 | { read x cmd; echo "$cmd"; }`";
} >;>; $HOME/.history-timestamp'
或者安装 Bash 3.0
http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz
bb. New HISTTIMEFORMAT variable; value is a format string to pass to
strftime(3). If set and not null, the `history' builtin prints out
timestamp information according to the specified format when displaying
history entries. If set, bash tells the history library to write out
timestamp information when the history file is written.
或者用Snare for Linux大炮打苍蝇  |
|