Hack 53. Execute a specific command from history

by Ramesh

In the following example, If you want to repeat the command #4, execute !4 as shown below.

# history | more
       1  service network restart
       2  exit
       3  id
       4  cat /etc/redhat-release

# !4
cat /etc/redhat-release
Fedora release 9 (Sulphur)

Leave a Comment

Previous post:

Next post: