Skip to content

Comment on Time-saving tips for Linux

Comments

quora appears broken at the moment . . . I was going to suggest:

in many shells (bash, tcsh, etc), !foo will execute the most recent command from your history that matches foo, for example:

   > grep -lots -of -options /complicated_regex/ ./some/path/* | /pipe/filter
   # realize you are in the wrong directory
   > cd /the/right/directory
   > !g
and similarly, !! is the most recent command, which comes in handy for "sudo !!"[1]

[1] http://xkcd.com/149/

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.