From NCSU CC Consultant's Information at "http://www2.ncsu.edu" Unity/Doing it to a group of files How to do the same thing to a bunch of Unix files: To rename all of the files in a directory so that the names are prefixed with a specific string... change all files so that their names are junk.whatever.it.was.before: foreach i (*) mv $i junk.$i end -------------------------------------- To rename a bunch of arbitrarily named files in the current directory so that they are named 1.xyz, 2.xyz...: cd junk ls file_a file_z foreach i (*) foreach? @ c++ foreach? mv $i $c.xyz foreach? end ls 1.xyz 2.xyz Back to Consultant's Home Page Back to NCSU's Home Page Back to Unity Last updated : Wed Jun 1 17:01:37 EDT 1994 by makehtml Unity/Doing_it_to_a_group_of_files / NCSU Computing Center