Sometimes you find yourself
wanting to move a bunch of
files into a new directory
that is to be created in the
current working directory.
Rather than using a temporary
directory, or grep and variable
substitution; use a subshell:
$ ( \ls; echo dir; mkdir dir ) | xargs mv
The trick is in using a subshell
to run a number of commands
_before_ the output is piped to
xargs. This idiom is also useful
for plenty of other applications.
NOTE: All tips provided are USE AT YOUR OWN RISK. Tips are submitted
by various unix admins around the globe. UGU suggest you read and
test each tip in a non-volitile environment before placing into
production.