3 ms·
!!:s/sl/ls executes last command but replaces first occurence of sl with ls. (can also be written as ^sl^ls) !!:gs/sl/ls same as above, but now global repl
by nudded 17y ago
!!:s/sl/ls
executes last command but replaces first occurence of sl with ls. (can also be written as ^sl^ls)
!!:gs/sl/ls
same as above, but now global replace
- mtrimpe 17y agoI have that one aliased as sl2ls ...
- jrockway 17y agoSimilarly, !! refers to the last command, so you can write "sudo !!" to execute the last command as root. Helpful for apt-get, among other things. !$ refers to the arg to the last command, so you can write: $ ls -l /foo/bar # .oO(aha, it's a stale link i don't want) $ rm !$ rm /foo/bar $