Skip to content

Repeating commands on Linux with or without changes

Life on the command line on Linux is clearly something most of us enjoy, but typing the same command again and again can become tiresome. To avoid that boredom, this post explains a number of ways that you can make repeating commands – or repeating commands but with some changes – a lot easier than you might expect.

Rerunning the previous command

First, the easiest way to repeat a command is simply by typing !!. If you were logged into a Linux server and waiting for a coworker to log in, for example, you might want to repeat the who command shown below until you see your coworker’s username. Typing !! after the initial who command will do this for you.

To read this article in full, please click here

Source:: Network World – Linux