exam questions

Exam EX200 All Questions

View all questions & answers for the EX200 exam

Exam EX200 topic 1 question 5 discussion

Actual exam question from RedHat's EX200
Question #: 5
Topic #: 1
[All EX200 Questions]

SIMULATION -
Find the files owned by harry, and copy it to catalog: /opt/dir

Show Suggested Answer Hide Answer
Suggested Answer: See explanation below.
# cd /opt/
# mkdir dir
# find / -user harry -exec cp -rfp {} /opt/dir/ \;

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
airphreak
Highly Voted 3 years, 11 months ago
find / -user Harry -type f -exec cp {} /opt/dir \;
upvoted 20 times
...
loloski
Most Recent 4 months, 3 weeks ago
mkdir /opt/dir; find / -type f -user harry -exec cp -p '{ }' /opt/dir \;
upvoted 1 times
...
thomasstate
1 year ago
why does it take time to process the command
upvoted 1 times
TheServant
8 months, 1 week ago
May be its looking the entire '/' partition which might take time.
upvoted 1 times
...
MichaelChapoco
11 months, 2 weeks ago
add -rf to the exec command
upvoted 1 times
...
...
Abhilashasok
1 year, 3 months ago
# cd /opt/ # mkdir dir # find / -user harry -type f -exec cp -rfp {} /opt/dir/ \;
upvoted 2 times
...
ertgrty
1 year, 3 months ago
#mkdir /opt/dir #find / -type f -user Harry -exec cp {} -ar /opt/dir \;
upvoted 1 times
ertgrty
1 year, 3 months ago
sorry #mkdir /opt/dir #find / -type f -user Harry -exec cp -ar {} /opt/dir/ \;
upvoted 1 times
...
...
Rahul95
1 year, 6 months ago
#mkdir -p /opt/dir #find / -user harry -exec cp -rfp {} /opt/dir/ \; #ls ltr /opt/dir - to verify if files appeared or not
upvoted 1 times
...
jahmad0730
1 year, 6 months ago
What is the answer please? Syntax in the example is not working. [root@station /]# find / -user tom -exec cp {} /opt/dir/ \; cp: '/opt/dir/.bash_logout' and '/opt/dir/.bash_logout' are the same file cp: '/opt/dir/.bash_profile' and '/opt/dir/.bash_profile' are the same file cp: '/opt/dir/.bashrc' and '/opt/dir/.bashrc' are the same file cp: '/opt/dir/tom' and '/opt/dir/tom' are the same file cp: -r not specified; omitting directory '/home/tom' find: ‘/proc/8531/task/8531/fd/6’: No such file or directory find: ‘/proc/8531/task/8531/fdinfo/6’: No such file or directory find: ‘/proc/8531/fd/5’: No such file or directory find: ‘/proc/8531/fdinfo/5’: No such file or directory
upvoted 1 times
...
tinythings
1 year, 8 months ago
mkdir -p /opt/dir cp -nr --parents $(find / /home -xdev -user harry) /opt/dir
upvoted 1 times
...
Mayowa15
2 years ago
after copy them to /opt/dir , how can I verify that is really copy to that? please. I run #cat /opt/dir but don't really see what make me sure. thanks
upvoted 1 times
...
robust993
2 years, 2 months ago
it's very easy # find / -user harry -exec cp {} /opt/dir/ \;
upvoted 1 times
...
Hayder_Alobaidi
2 years, 4 months ago
find / -user hayder -type f 2>/dev/null -exec cp '{}' /opt/dir \;
upvoted 3 times
...
maxim_sk
2 years, 6 months ago
for i in $(find / -user harry -type -f);do cp -rpvf $i /opt/dir;done
upvoted 1 times
maxim_sk
2 years, 5 months ago
i cannot edit, but the same as solution is: for i in $(find / -user harry);do cp -rpvf $i /opt/dir;done
upvoted 1 times
...
...
brahmimedamine
2 years, 9 months ago
find / -user harry -type f -exec cp -rpvf {} /opt/dir \; 2> /dev/null
upvoted 3 times
...
kenkct
2 years, 10 months ago
find / -type f -user harry -exec cp {} /opt/dir \;
upvoted 2 times
...
eid
2 years, 11 months ago
find / -user Harry -type f -exec cp -fp {}/opt/dir \; or cp -fp $(find / -user Harry -type f) /opt/dir
upvoted 1 times
...
eid
2 years, 11 months ago
find / -user Harry -type f -exec cp -fp /opt/dir \; or cp -fp $(find / -user Harry -type f) /opt/dir
upvoted 1 times
...
eldny
3 years ago
find . -type d -user tester ! -path "./.*" -exec cp -rf {} I am excluding all the hidden files with ! -path "./.*"
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...