Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

command displays all the commands ran previously on the terminal

history

# To search for a particular previously used command,
# pass history to grep with a search keyword
history | grep 'Betty'

# A command in history can be rerun by expansion using it's history number
# for Example, the command grep -rE -o --color "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,6}" ~
# is number 72 in history. To rerun it;
!72
 
PREVIOUS NEXT
Tagged: #command #displays #commands #ran #previously #terminal
ADD COMMENT
Topic
Name
5+7 =