Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there a better way on the command line to essentially accomplish the following but with a single command

cp -r css/ ar/
cp -r images/ ar/
cp -r js/ ar/
cp -r backups/ ar/

I've just been stringing them together with a semicolon.

share|improve this question

migrated from serverfault.com Mar 19 '13 at 15:18

This question came from our site for professional system and network administrators.

1 Answer 1

up vote 14 down vote accepted

Copying folders into another folder (folder in folder):

cp -r css images js backups ar/

Note: this is different from copying just the contents themselves(contents of folders in folder):

cp -r css/ images/ js/ backups/ ar/
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.