The !! event designator is substituted with the last command entered. !-2 is substituted with the one before that, and so on. For example:
which script.pl
less `!!`
If you find yourself running a sequence of commands repeatedly, Ctrl-O is your friend. Press the up arrow to find the first command in the sequence, then repeatedly press Ctrl-O to run each command in the history.
If you have a variable $FILE which contains a full path and filename, for example, "/home/fred/myfile.txt", then the following code:
${FILE##/*/}
will evaluate to the filename without the path, e.g. "myfile.txt". The ## string operator deletes the longest match of the specified regular expression.
For loops are a useful feature in Bash for performing the same operation on a number of files. For example:
for FILE in *.dv; do dv2avi $FILE; rm $FILE; done
might convert all the .dv video files to .avi and delete the original file. Such commands can also be split across multiple lines whether in a shell script or interactively on the command line.