CORRECT TEXT Find the files owned by harry, and copy it to catalog: /opt/dir
Answer: A
Explanation: # cd /opt/ # mkdir dir # find / -user harry -exec cp -rfp {} /opt/dir/ \;
4 Comments on “CORRECT TEXT Find the files owned by harry, and copy it to catalog: /opt/dir”
steven kunjachansays:
find / – user harry -exec cp -rfp {} /opt/dir/ \;
1
0
steven kunjachansays:
mkdir /opt/dir (this goes first obviously)
0
0
Romiosays:
In case someone doesn’t understand this, I would like to leave an explanation.
find: find command
where in root : /
how, files owned by a user: -user
name of user: harry
execute : -exec
copy: cp
results of previous command will go in {} so these brackets are just symbols that whatever result came from previous command will be copied now
path of destination : /opt/dir
end of line : \;
find / – user harry -exec cp -rfp {} /opt/dir/ \;
1
0
mkdir /opt/dir (this goes first obviously)
0
0
In case someone doesn’t understand this, I would like to leave an explanation.
find: find command
where in root : /
how, files owned by a user: -user
name of user: harry
execute : -exec
copy: cp
results of previous command will go in {} so these brackets are just symbols that whatever result came from previous command will be copied now
path of destination : /opt/dir
end of line : \;
6
2
this command should work also:
find / -user harry | xargs cp -t /opt/dir/
0
0