I am trying to make a script that will copy files from a directory and place the copied files into a new directory.
I know that the cp command will copy the files and the mkdir command will create the directory but does anyone know how to combines these 2 commands into a single line?
So far I have
mkdir /root/newdir/ cp /root/*.doc /root/newdir
this gives the error message
mkdir: cannot create directory 'cp': Files exists
mkdir: cannot create directory '/root/files/wp.doc: File exists
mkdir: cannot create directory 'mkdir' : File exists
mkdir: cannot create directory '/root/files/new dir: file exists
However it does create the directory newdir