Hi,
I am having trouble copying or moving files from one directory to another using terminal and the cp or mv command.
I have a directory with a large number of assorted document files of various extensions. I am trying to copy files of extension *.txt and *.pdf to another directory. This is the command I am using:
$ cp /home/pat/t1/*.txt *.pdf /home/pat/t2/
where the originating directory is named t1 and the destination is t2. Note the spaces - *.txt[space]*.pdf[space]/.......
I am getting the message: cp: cannot stat '*pdf': No such file or directory.
I can list the files using the ls command and the files are definitely there.... I have tried rewriting the command but whichever extension I list secondly is the one rejected whether it be pdf or txt. If I try to copy (or move) the files using individual separate extensions one after the other I don't have a problem.
I have searched various solutions and I am unable to see my error. Can anyone help me with correct syntax please?
Many thanks.
[ubuntu] Copy / move files - help with wildcards please...
Aucun commentaire:
Enregistrer un commentaire