1

Re-run multiple history commands

view story
linux-howto

http://unix.stackexchange.com – Imagine you've just run a dozen commands. Say... $ cd foo/ # history cmd #10000 (my history is very long) $ ... more commands ... $ cd ../ # history cmd #10012 I know I can re-run them concatenated with !-12 && !-11 && !-10 && (and so on) && !! if they happen to have just been run (unlikely) or !10000 && !10001 && !10002 && (and so on), but is there a simpler way than hand-typing each history number with a bang and ampersands? Is there perhaps some kind of range thing I'm unaware of in bash? e.g. !{10000-10012} # something (HowTos)