[TAG] [TIPS] executing two different consecutive commands with same set of parameter
Mulyadi Santosa
mulyadi.santosa at gmail.com
Sat Dec 6 06:34:42 MSK 2008
Bash has feature called "word designators". I find it useful if you
want to execute a command following the previous one with same set of
parameters.
For example, instead of:
# ls -l /boot/vmlinuz-2.6.22-14-generic
# stat /boot/vmlinuz-2.6.22-14-generic
I could simply type:
# ls -l /boot/vmlinuz-2.6.22-14-generic
# stat !$
It would recall the last parameter of "ls"
Another variation. Let's say first you want to do:
# cat text-1.txt text-2.txt
but then you realize the text are too long, so you turn into "tail":
# tail text-1.txt text-2.txt
OR
# tail !*
It would recall all the parameters except the first one (technically,
the zeroth one actually).
regards,
Mulyadi.
More information about the TAG
mailing list