For my current issue I require listing all the files which have a different owner than the current owner. We have almost 600 000 files in current directory and ls -l
or any other ls
command will give us trouble.
[system@support forms]$ pwd
/u01/system/reports/foms
[system@support forms]$ ls -ltr|more
total 22066
-rwxrwxrwx 1 system sys 94208 Feb 5 2016 UTIL_COGS.rdf
-rwxrwxrwx 1 system sys 417792 Feb 5 2016 UTIL_AL.rdf
-rwxrwxrwx 1 system sys 212992 Feb 10 2016 UTIL_PE_BATCH.rdf
-rwxrwxrwx 1 system sys 311296 Feb 10 2016 UTIL_GF.rdf
-rwxrwxrwx 1 dev dev 307200 Feb 10 2016 UTIL_NO_ACCT.rdf >>>> this is my Issue
-rwxrwxrwx 1 system sys 1101824 Feb 10 2016 UTIL_NO_DETAIL_REPORT.rdf
-rwxrwxrwx 1 dev dev 614400 Feb 16 2016 UTIL_NO301.rdf >>>> this is my Issue
What do we need to show the files which do not have the expected owner?
You can use the
find
command:It will show all files not owned by
system
in the current directory.You can also choose to see recent files:
-mtime -10
will show only files modified less than 10 days ago.You can also restrict to files only, avoiding to display directories with
-type f
: