Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

All these article links should just end up here:

http://www.commandlinefu.com/commands/browse

you can sort by date, #(votes) and also search

The top all-time popular one is:

* run last command as root: $ sudo !!



To be fair, that's not even a command; that's a shell expansion that automatically substitutes your previous command in place of the !! before executing it.


Thank you for another '...and this is why I love HN' moment.


Just be aware it may not execute the command you think. man bash for HISTIGNORE. Personally I never use it with sudo; it's too dangerous.


This is also why I disabled HISTIGNORE in both bash and zshell. zshell also allows me to press TAB to expand the command in-place before I press enter, so I can still use the shortcut without the danger.


Check this out -- CommandLineFu One-Liners Explained:

http://www.catonmat.net/blog/top-ten-one-liners-from-command...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: