Linux Tutorial | How to check history of Cent-OS Linux Commands

Опубликовано: 05 Апрель 2020
на канале: Linux Teaching House
0

650K Subscribers . 525K Views

How to check history of Centos Linux Commands

In Linux, you can view the history of executed commands on your CentOS system using the history command. Here are the steps to follow:

1) Open a terminal window or log in to the CentOS system using SSH.

2) Run the following command to view the list of executed commands:
history

This command will display a list of commands executed on the system, along with their line numbers.

3) To execute a previously executed command again, type the line number of the command and press Enter. For example, if you want to execute the command on line 4 again, type:

!4

This will execute the command on line 4.

4) You can also search for a specific command in the history by using the grep command. For example, to search for all instances of the ls command in the history, type:

history | grep ls

This command will display a list of all instances of the ls command executed on the system.

That's it! You have successfully viewed the history of executed commands on your CentOS system using the history command.

Keep Watching my videos

Please Subscribe and click the notification bell so you never miss a video
Thank You For Watching


#LinuxTipsandTricks2020 #LinuxServer #LinuxTeachingHouse