Linux基础命令之-history

2018-08-18  本文已影响0人  醉馬長洲

history是用来查看命令历史记录的工具,系统默认保留1000条。该命令是通过shell自动记录在缓存中,退出后会自动保存在历史命令文件中。默认文件位置为 ~/.bash_history

[root@Centos7 ~]# history
    1  who a i
    2  who is sb
    3  who
    4  init 5
    5  runlevel
    6  tty
    7  init 0
    8  whoami
    9  who am i
   10  startx
   11  ifconfig

history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]

-p: 展开历史参数成多行,但不记录在历史列表中。操作但不记录历史


history -p
上一篇 下一篇

猜你喜欢

热点阅读