text 使用终端历史文件保存终端命令

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 使用终端历史文件保存终端命令相关的知识,希望对你有一定的参考价值。

There is already a hidden file in your home directory called .bash_history which you can print it. One observation here: this file, in a default configuration, doesn't contain the commands used in your current opened terminal session. So, close the terminal before to print it.

But if you want to save the terminal history in another file, then you can use the following command (this new file will contain also and the commands used in your currently opened terminal session):

history > history_for_print.txt
A new file called history_for_print.txt will be created in your currently working directory containing your last used commands (by default HISTSIZE=1000 and HISTFILESIZE=2000, but you can change these values in your ~/.bashrc file).

以上是关于text 使用终端历史文件保存终端命令的主要内容,如果未能解决你的问题,请参考以下文章

text WordPress文件权限命令(终端)

在Mac终端中使用vim编辑文件

[转]linux下终端常用命令和vi命令修改文件及保存的使用方法

kali终端如何保存并退出

linuxlog输出到终端怎么解决

如何使linux系统下的root用户不保存终端历史记录到.bash_history中?