News for hackers. Stuff that matters.
Re:The Fuck – Correct your previous console command by drone on Friday April 17, 2015 @08:13PM (#9397858)
Let us not forget, also substitution regexs in bash...

    $ ls -l /tmp/foo
    ls: cannot access /tmp/foo: No such file or directory
    $ !:s/foo/bar
    -rw-rw-r-- 1 user user 0 Apr 17 19:12 /tmp/bar
Re:The Fuck – Correct your previous console command by tsm on Friday April 17, 2015 @10:55PM (#9398165)
And the shorthand:

    $ ls -l /tmp/foo
    ls: cannot access /tmp/foo: No such file or directory
    $ ^foo^bar
    -rw-rw-r-- 1 user user 0 Apr 17 19:12 /tmp/bar
Re:The Fuck – Correct your previous console command by willthames on Saturday April 18, 2015 @12:59AM (#9398369)
And the reason for the other approach - global substitution (otherwise the caret approach is simpler)

    $ ls
    hello_world hi_there_world
    $ mv hello_world hello_everyone
    $ !!:gs/hello/hi_there
    mv hi_there_world hi_there_everyone
    $ ls
    hi_there_world hi_there_everyone