I have a directory containing files that are owned by root, from this directory I wish to copy all the files ending with errorAll
to another directory. My wildcard syntax is correct because performing a ls -latr *errorAll
shows all the files that I want to copy.
Attempting to copy (as non root level user) using cp *errorAll ~/Target/
gives me the expected warning of cp: cannot create regular file /home/tarskin/errorAlls/calibrated_20130903_healthy#1-b_IgA_again_1401_C10.errorAll: Permission denied
, I just added this step to show that the command should be working (in my opinion).
However when I then run it as a root level user using sudo cp *errorAll ~/Target/
it doesn't give any message or error and just claims it's done within seconds without having actually copied anything.
Does anyone know why this occurs?
EDIT
The following information was requested, output of ls -ld .
is drwxr-xr-x 2 root root 3342336 Oct 22 10:09 .
The output of ls -ld ~/errorAlls/
is drwxr-xr-x 2 root root 3342336 Oct 22 10:09 .
.
Adding -v
to the cp
command for verbose output doesn't change anything, the command 'finishes' without doing anything.
ls -ld .
andls -ld ~/Target/
to your question.tarskin's
home owned by root?sudo chown tarskin /home/tarskin/errorAlls
and thencp *errorAll ~/errorAlls
.