Redundant key strokes


Carrying on with my lazy steps, there are bits of code used with UNIX commands, which are completely redundant.



Save yourself some key strokes, remember these examples. Or come back to and check them out again. 🙂



chmod a+r filename

The “a” is redundant – if you just do a “+r” – all is implied.

ls -l | awk ' $4 > 1000 { print $0 } '

In awk printing $0 is default action.

find . -type f -print

With find default action is to print.

echo a b c | tr '[abcdef]' '[ABCDEF]'

Use a range: echo a b c | tr ‘[a-z]’ ‘[A-Z]’

In vi use ZZ instead of :wq 🙂

Only 2 chars less (including the shift) – but also just your little finger, instead of a hand span. 🙂



[tags]Redundant key strokes, UNIX shortcuts, Unix Coding School[/tags]


If you have found my website useful, please consider buying me a coffee below 😉

Leave a Reply

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