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

Use the fc command of linux to edit and execute history commands

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article will explain in detail about using linux's fc command to edit and execute history commands. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

The EXTENDED_HISTORY environment variable affects the execution of the fc command. If the variable is set to ON, the time is recorded, otherwise the time is not recorded.

Syntax format: fc [parameters]

Commonly used parameters: coach

-e specifies the text editor used to edit commands. By default, vi-l lists the history commands within the scope of the first and last commands. If you do not follow the command range, the default displays the 16 most recently used history commands.-n displays history commands without displaying the command sequence number-r shows all history commands in reverse order-s finds the specified command from the current position in the history command and executes it

Reference example

Display a list of historical commands (print the last 16 historical commands by default):

[root@linuxcool ~] # fc-l

Specify the editing commands using the ex text editor:

[root@linuxcool] # fc-e ex

Displays a list of historical commands but does not display the command sequence number:

[root@linuxcool ~] # fc-n

Display all historical commands in reverse order:

[root@linuxcool ~] # fc-r

Find the find command from the history command and execute:

[root@linuxcool ~] # fc-s find about using linux's fc command to edit and execute the history command is shared here. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

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

Servers

Wechat

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

12
Report