Files generated by a particular user

Hi

I have the following files generated by different users on a directory

-rw-rw-r--   1 NAME1  database03    809 Nov 17 10:41 PCAS_CARD_TRANS_OFF.1111171041.lg
-rw-rw-r--   1 richard  ccsdba   10968411 Nov 17 10:43 load_123_RX0_0.1111171016.lg
-rw-rw-r--   1 DEV  db03   10713 Nov 17 10:10 CO0101_8066.1111171009.lg
-rw-rw-r--   1 richard  ccsdba    6457 Nov 17 10:09 CO02_8066.1111171009.lg

What is the command that I need to use to display the files generated by only the user 'richard' . The sample output looks like the following:

-rw-rw-r--   1 richard  ccsdba   10968411 Nov 17 10:43 load_123_RX0_0.1111171016.lg
-rw-rw-r--   1 richard  ccsdba    6457 Nov 17 10:09 CO02_8066.1111171009.lg

Thanks

Try this:

# find <path> -type f -user "richard"
find . -type f -user username -exec ls -l '{}' ';'
find /dir -user richard

Thanks all..

---------- Post updated at 11:53 AM ---------- Previous update was at 11:51 AM ----------

If i want to search all the files that has been generated for a particular date say for example Nov 16. How am I going to achieve this ? Appreciated your help.

you can use find command to find the files by access or modification date
so use find command with

-exec 

followed by

 
ls -ltr | grep 'Nov 16'

this may help you

not really sure with the exact command will test and let you know if possible

---------- Post updated at 10:17 PM ---------- Previous update was at 10:13 PM ----------

find / -ctime -10 -exec ls -ltr {} \; | grep -i 'nov 16'

use this

1 Like