Reputation: 48
lets say I have (linux/unix)
/directory/1/file.wmv
/directory/2/file.wmv
/directory/3/file.wmv
I want to copy these .wmv files into a single directory /example/ with files named after directory names they were in like so 1.wmv, 2.wmv, 3.wmv,
Upvotes: 0
Views: 287
Reputation: 2827
for i in {1..10}
do
cp /directory/$i/file.wmv /example/$i.wmv
done
Upvotes: 1