您的位置首页百科知识

linux怎么清除history记录

linux怎么清除history记录

的有关信息介绍如下:

1、history -a将当前shell会话的历史命令追加到命令历史文件中,命令历史文件是保存历史命令的配置文件。

linux怎么清除history记录

2、history -c清空当前历史命令列表。

linux怎么清除history记录

3、history -d删除历史命令列表中指定序号的命令。

linux怎么清除history记录

4、history -n从命令历史文件中读取本次Shell会话开始时没有读取的历史命令。

linux怎么清除history记录

5、history -s将指定的命令作为单独的条目加入命令历史内存缓冲区。在执行添加之前先删除命令历史内存缓冲区中最后一条命令。

linux怎么清除history记录

6、history -w把当前的shell历史命令内存缓冲区的内容写入命令历史文件。

linux怎么清除history记录

7、显示最近的10条命令: history 10。最后可以根据需求从上述命令中,选择一个命令进行清除记录。

linux怎么清除history记录