Find the files owned by harry, and copy it to catalog: /opt/dir
Suggested Answer: A
Get Premium EX200 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
37 comments · newest first
CR
Crista
12 months ago
Good point, but it’s a solid way to get the job done!
SH
Shawnee
1 year ago
Just a heads up, you might need sudo for that.
JA
James
1 year ago
Wait, does that really copy all files? Seems risky!
VI
Vi
1 year ago
Agree, but be careful with `-exec cp`—it can overwrite files.
JA
Janey
1 year ago
That's the right command to find files owned by harry!
AN
Angelo
1 year ago
I recall that using `-user` with `find` is the right approach, but I wonder if I should specify the full path for `cp` to avoid any issues.
TR
Tracie
1 year ago
I feel confident about using `mkdir` to create the directory, but I’m not sure if I need to include `-rfp` in the `cp` command.
ST
Stephaine
1 year ago
I practiced a similar question where we had to find files by size. I think the `-exec` option is correct, but I might have mixed up the flags for `cp`.
TR
Truman
1 year ago
I think I remember that the `find` command is used to search for files, but I'm not entirely sure about the syntax for copying them.
TH
Thomasena
1 year ago
This seems like a good opportunity to demonstrate my Linux skills. I'll give it my best shot.
SO
Solange
1 year ago
Wait, do I need to create the /opt/dir directory first? I'm not totally clear on that.
EM
Emelda
1 year ago
Okay, the key is to find the files owned by harry and copy them to the /opt/dir directory. I've got this!
MA
Malissa
1 year ago
Hmm, I'm a bit unsure about the find command and the -exec option. I'll need to review that part.
ER
Erick
1 year ago
This looks straightforward, I think I can handle it.
AS
Ashton
2 years ago
This is a solid solution, but I'm wondering if I should bring my own chair to the exam room. These tests can be a real pain in the butt.
EL
Elsa
1 year ago
I never thought about bringing my own chair, but it's a good idea.
TO
Tonja
1 year ago
I always bring a cushion to exams, it helps with the discomfort.
CA
Catalina
1 year ago
You should definitely bring your own chair, just to be safe.
JU
Jules
2 years ago
Looks good, but I'm a little worried about the potential for copying sensitive files. Maybe we should add a check to skip any files in /etc or /var.
LA
Lawrence
1 year ago
That's a great idea, let's update the command to exclude /etc and /var.
MO
Mozell
1 year ago
Agreed, let's make sure to add that extra check to avoid copying any sensitive files.
SU
Susana
1 year ago
That's a good idea. We can modify the find command to include a check to skip any files in those directories.
AN
Annmarie
1 year ago
We can use the -path option in the find command to exclude those directories.
MA
Maryann
2 years ago
Good point, we definitely don't want to copy sensitive files. We can add a condition to exclude /etc and /var directories.
AV
Avery
2 years ago
Good point, we should definitely add a check to skip files in /etc or /var.
LA
Lauran
2 years ago
This is a great solution, but I wonder if there's a way to do it without using the root directory. Maybe we could start the search from /home/harry instead?
AR
Art
2 years ago
I like the use of find and exec to copy the files, but shouldn't we use -type f to only copy regular files?
GW
Gwenn
1 year ago
Great, let's update the command to include -type f for copying the files.
JO
Jordan
1 year ago
I agree, adding -type f will ensure we only copy regular files owned by harry.
KE
Kenia
1 year ago
Yes, that's a good idea. Let's make sure to include that in the command.
SC
Scarlet
2 years ago
Good point, we should definitely add -type f to only copy regular files.
TH
Therese
2 years ago
This looks like the right solution, but I'm not sure about the -rfp flags. Are they necessary?
TR
Truman
2 years ago
You can try running the command without the flags and see if it works, but it's recommended to include them for proper file copying.
RU
Rueben
2 years ago
Yes, the -rfp flags are necessary to preserve the file permissions and copy recursively.
CE
Celestina
2 years ago
Yes, we need to use 'find' command with '-user harry' option and then 'cp' command to copy the files to /opt/dir.
KI
Kimberlie
2 years ago
I agree, but I remember the command to find and copy files owned by harry.
CE
Celestina
2 years ago
I think this question is tricky.