Bang Bang (!!)
Much like https://coderwall.com/p/lc8h3q, this is another basic shell tip that everyone should know about...
Using !! from the shell will expand to the last executed command.
This one is a good one for when you forget to use your manners.
So, let's say you attempted to
>> chmod x /usr/local/bin/someexecutable
>> chmod: ... : Permission denied
Oops, someone forgot to ask nicely. Let's try that again, with manners, and we'll use Bang Bang to avoid any unnecessary typing or messing around.
>> sudo !! # expands to: sudo chmod x /usr/local/bin/someexecutable
Bang Bang!! You're done.
Written by Robin Curry
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Related Tags
#shell
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#