Get the App
SLTechnology News&Howtos  ›  Servers  › 

Which is the command for linux to clear history?

Shulou Source: shulou.com Published: 2022-05-31 12:33:35 10月03日 Update

Today, the editor will share with you the relevant knowledge points about which the linux order to clear history is. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

In linux, the command to clear history is "history-c"; the function of the history command is to record the commands that have been executed, and when the parameter is set to "- c", it means that the history output command of the current window can be cleared.

The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What is the command for linux to clear history?

History [- c] [- d offset] [n]

Or history-anrw [file name]

Or history-ps parameter [parameter.]

-c: clear the command history in memory, not the record in the history file

-d: delete the history of the making command and will not empty the record in the history file

-r: read history commands from the history command file to memory

-w: appends in-memory history commands to the history command file

Use the-c option to clear all command history

If you want to erase all command history, you can execute:

# history-c

This command clears all output commands for this login, but not the. bash_history file, so the old command will appear again after the next login, and the history command exists in the. / bash_history file in the root directory of the current user.

These are all the contents of the article "which is the order for linux to clear history?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Tags: Commands history files knowledge articles memory parameters content history files that is output different great useful most tutorials file names more root directory environment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi NVidia Apple vpn Microsoft