Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to copy a list of files into a single directory, but make the target directory the first filename in the command, how can I do it with linux command.

share|improve this question
The cp command will do what you want but the target directory must come after the souce file(s). Why do you want to change from the accepted standard? Try man cp for more info. – Mike Fitzpatrick Sep 29 '11 at 4:55

2 Answers 2

Do you mean you the command to look like the following -

specialcopy destDir filetocopy1 filetocopy2 filetocopy3

if so, create a script called with below text


cp "$@" "$DEST"
share|improve this answer

On Linux, there is cp -t for xargs users.

xargs -d'\n' cp -t targetdir < filelist
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.