Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.
sudo su
mkdir /root/findresults (create folder if doesn't exist)
find / -user jack -type f -exec cp {} /root/findresults/ \;
ls /root/findresults (to verify)
I have heard from several people that they encountered a slightly modified version of this question, where it was required to include all files with SUID permission. Just add -perm u=s in the command to do so. One person also had this question made so that it must be made into a shell script. So take note ;)
No that won't copy the files that will just copy the results from the find command to a file. The solution is: find / -type f -user jack -exec cp -v {} /root/findresults \;
[root@abc ~]# find / -user jack -type f -exec cp -rp {} /root/findfiles/ \;
find: ‘/proc/3337/task/3337/fdinfo/6’: No such file or directory
find: ‘/proc/3337/fdinfo/7’: No such file or directory
cp: cannot create regular file '/root/findfiles/': Not a directory
cp: cannot create regular file '/root/findfiles/': Not a directory
cp: cannot create regular file '/root/findfiles/': Not a directory
cp: cannot create regular file '/root/findfiles/': Not a directory
# find / -user jack -type f -exec cp -rp {} /root/findfiles/\;
find: missing argument to `-exec'
When you search for files only why do you need -r for cp command.
The cp -r mean recursively copy directories. It's not an error but why?
upvoted 4 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.
kenkct
Highly Voted 2 years agowizojlo
Most Recent 2 weeks, 4 days agoschwarztrinker
2 years agobrahmimedamine
2 years, 1 month agocb52
2 years, 2 months agoifbaibz
2 years, 3 months agovira5489
2 years, 4 months agoANI_04
2 years, 5 months agosirasdf
1 year, 8 months agosugisho
2 years, 8 months agoStachomir
2 years, 8 months agoxXxM__JxXx
2 years agoLeepipes101
3 years agorsebayang
3 years, 6 months agocytron
3 years, 4 months agodanielmaziarczyk
3 years, 3 months agodanielmaziarczyk
3 years, 3 months agoms200
3 years, 2 months agoPTom
3 years ago