SIMULATION - 1. Find all sizes of 10k file or directory under the /etc directory, and copy to /tmp/findfiles directory. 2. Find all the files or directories with Lucy as the owner, and copy to /tmp/findfiles directory.
Suggested Answer:See explanation below.
(1)find /etc -size 10k -exec cp {} /tmp/findfiles \; (2)find / -user lucy -exec cp -a {} /tmp/findfiles \; Note: If find users and permissions, you need to use cp - a options, to keep file permissions and user attributes etc.
I would NOT use -a as ownership is not carried over, better use -P
-p => Preserves file characteristics (modification time, access time, ownership, permission-bits).
-a, --archive Preserve the source's metadata, such as creation date, permissions, and extended attributes
This is just redirecting your command output to a file, but not copying the files to a directory
upvoted 3 times
...
...
Log in to ExamTopics
Sign in:
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.
jjknow85
Highly Voted 3 years agoly01
4 months, 3 weeks agoLazylinux
3 months, 2 weeks agoFrenzy
Most Recent 2 years, 6 months agomattd81
2 years, 7 months agoSTFN2019
3 years, 2 months agoatilade
3 years, 2 months agoreemartan
3 years, 1 month ago