Featured

    Featured Posts

HISTORY COMMAND

Linux shells maintain a record of the commands issued by the user. You can view the list of commands that you have entered before by using the history command. This is a neat shell feature because it enables you to repeat some complex commands you have entered eariler. By default, the last 500 commands are shown.
linux history command
You can also execute a command by its number in the history. For example, in the picture above, you can see that the “man -k shell” command is at number 17. To execute that command again, we would type “!17” (without quotes):
linux execute a command using the history command
The shell enables you to retrieves the previous entry from the command history by pressing the Uparrow on your keyboard. You can also press Ctrl+r to search your command history. For example, to search the history for commands that include “dd” we would press Ctrl+r and then type dd:
linux search the history using ctrl r
To find the next command in history that includes “dd” press Ctrl+r again.
NOTE – typing history -c clears the history. Use this option if you have typed commands that include passwords.
author

Author Name

Author Description!

Get Free Email Updates to your Inbox!

Post a Comment

www.ccna.ma

yu
Powered by Blogger.

Translate

Copyright © Learn Linux Th3pro.xyz | Blogger Templates | Designed By Code TAOUSSI