18.9 Renaming, Copying, or Comparing a Set of FilesIf you have a group of files whose names end with .new and you want to rename them to end with .old , this won't work: % because
the shell can't match
That outputs a series of mv commands, one per file, and pipes them to a shell. The quotes help make sure that special characters (8.19 ) aren't touched by the shell - this isn't always needed, but it's a good idea if you aren't sure what files you'll be renaming: mv 'afile.new' 'afile.old' mv 'bfile.new' 'bfile.old' ... (To see the commands that will be generated rather than executing
them, leave off the This method works for any UNIX command that takes a pair of filenames. For instance, to compare a set of files in the current directory with the original files in the /usr/local/src directory, use diff (28.1 ) : % - |
|