Move all junk files to the temp directory and append ".dat": ls junk* | awk '{print "mv "$0" ../temp/"$0".dat"}' | csh ------------------------------ Extract all the tar files in a directory: find . -name '*' -print -exec tar -xzf {} \;