We're an ISO27001:2013 Certified Supplier

not yet

Sometimes, when working at the shell prompt, we can be constructing a long command and then realise we’re not ready to run the command just yet.

We could hit the Home key, type a hash (#) to comment the line, and hit return. That would put the command in the history without running it, and we can recall it later (up arrow) and edit it when we’re ready to run it.

There’s a shortcut for the above: just type Alt-#

Example

Let’s imagine we’ve started to build a command line like this:

before

Then we realise we need to move some files first. At the point we’re at above, we type Alt-#. The display now looks like this:

after

Now we can do whatever we needed to do first, then recall this command, remove the hash and carry on.

Could This Linux Tip be Improved?

Let us know in the comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *

Secure. Reliable. Scalable.

If that doesn't describe your current Linux systems, check out our FREE Linux Survival Guide to help you get your systems up to scratch today!

  • This field is for validation purposes and should be left unchanged.