Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the history command of Linux

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the Linux history command how to use the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will have something to gain after reading this Linux history command article, let's take a look.

Linux common commands history commands are used to display historical commands that users have executed before, and can append and delete historical commands.

Syntax format: history [parameters] [directory]

Common parameter:-an appends the history command of the current shell session to the command history file The command history file is the configuration file that saves the history command-c clear the current history command list-d delete the command number specified in the history command list-n read the history command that was not read at the beginning of this Shell session from the command history file-r read the command history file to the current Shell history command memory buffer-s add the specified command to the command history memory buffer as a separate entry. Delete the last command in the command history memory buffer before adding-w writes the contents of the current shell history command memory buffer to the command history file reference instance

Show the last 10 commands:

[root@linuxcool ~] # history 10 writes the login command to the history file:

[root@linuxcool ~] # history-w reads the contents of the command history file into the history memory of the current shell:

[root@linuxcool ~] # history-r appends the history commands of the current Shell session to the command history file:

[root@linuxcool ~] # history-a clears the list of current historical commands:

[root@linuxcool ~] # history-c this article on "how to use the history command of Linux" ends here, thank you for reading! I believe you all have a certain understanding of the knowledge of "how to use the history command of Linux". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report