We're an ISO27001:2013 Certified Supplier

deleted command line

Here’s a really quick but very useful tip. You’re half way through writing a command line when you realise you need to do something before you run that command. For the sake of example, let’s say you’re in the wrong directory, so you type ^U to delete the current command line (the ^U isn’t echoed, but I’ve put it in for clarity) and you cd to the correct directory:

$ for a in *.py; do ^U
$ cd git/python
/home/kae/git/python
$

So now you have retype your original command, the for loop. Well, no: if you type ^Y, the last line that you deleted with ^U will be redisplayed for you to edit (again, the ^Y isn’t echoed but I’ve shown it for clarity):

$ ^Y
$ for a in *.py; do

Do You Have Any Similar Tips?

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.