Replaying Linux CLI commands with history

Very handy little snippet I discovered today, mostly here for my own reference in future. It’s handy to be able to re-play/re-submit commands that you’ve typed into the CLI before on your Linux box, to do this you can use the history command. Let’s take a look at my webserver hosting the site, just as an example: root@web:~# history 781 nano /etc/cron.hourly/.placeholder sess_ 782 crontab 783 crontab -e 784 nano /etc/cron....

June 20, 2015 · Myles Gray