Files generated by a particular user


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Files generated by a particular user
# 1  
Old 11-17-2011
Files generated by a particular user

Hi

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

Code:
-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:

Code:
-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
# 2  
Old 11-17-2011
Try this:
Code:
# find <path> -type f -user "richard"

# 3  
Old 11-17-2011
Code:
find . -type f -user username -exec ls -l '{}' ';'

# 4  
Old 11-17-2011
Code:
find /dir -user richard

# 5  
Old 11-17-2011
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.
# 6  
Old 11-17-2011
Quote:
Originally Posted by bobby1015
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
Code:
-exec

followed by
Code:
 
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 ----------

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

use this
This User Gave Thanks to robo For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to pick only the files which are generated in one hour?

Hello Masters, I need one help. I want to copy the files which are continuously generating on one server. But this would be on hourly basis. e.g. -rw-rw-r-- 1 akore akore 0 Feb 12 03:20 test1.log -rw-rw-r-- 1 akore akore 0 Feb 12 03:42 test2.log -rw-rw-r-- 1 akore akore 0 Feb 12 04:22... (2 Replies)
Discussion started by: akore83
2 Replies

2. Shell Programming and Scripting

Files generated today

I would like to find the Files which are generated today in the current directory: I use the commad ls -lrt * | egrep " `date "+%b"` * `date "+%d"` to acheive this. Is there any better way to acquire the same. Multiple answers will be great. Thanks (3 Replies)
Discussion started by: kusathy
3 Replies

3. Shell Programming and Scripting

Getting list of files generated last 10 seconds

I was trying to figure out in Korn shell but this may apply elsewhere how to generate a list of files from a directory created in the last 10 seconds or less. I have used the find command in the past with -mtime which is measured in days to get a list of files older than say 7 days for example. ... (1 Reply)
Discussion started by: lee_murray
1 Replies

4. Solaris

core files not getting generated

Hi, We have an application ASPA . The application related processes are running in /ASPA/bin directory . now whenever a process terminates abruptly , a core file should be generated (correct me if i am wrong) in the /ASPA/bin directory . But i am not able to see any such files . The... (4 Replies)
Discussion started by: asalman.qazi
4 Replies

5. Shell Programming and Scripting

How can i remove the files generated on 10 days before!!!

Dear Friends! i am wirking on the IBM AIX version 5.3. and i wrote a script to delete the files whicha re generated on 10 days before to the present day. but iam not able to delete the files with the below script so please check and correct me. dt=`TZ=aaa480 date +%d`... (2 Replies)
Discussion started by: innamuri.ravi
2 Replies

6. UNIX for Advanced & Expert Users

Type v for generated files

Hi All, I was checking some of the files and I got the following entries:- =============== v, 664, serv, serv, version.txt, exe L, 775, serv, serv, start.sh, eventserv ================ Could someone please tell me what does the type"v" and "L" represent to. I have not... (2 Replies)
Discussion started by: shubhranshu
2 Replies

7. UNIX for Advanced & Expert Users

Q on <user> of syslog message generated by logger command

Generally(at least on AIX5.3, Solaris9, OS X)'logger' command would create syslog messages which carry <login name> . On Solaris9, I have experienced two circumstances in which 'logname' command fails. In this circumstance I saw the 'logger' command generated syslog messages which carry... (0 Replies)
Discussion started by: masaki
0 Replies

8. Shell Programming and Scripting

Ftp all the generated files

Hi All, I'm working on a ftp shell script in which I'm tranfering files from one sever to another using ftp. Some program generates files at undefined time & throughout the day. I have to transfer the files time to time.. i.e. once the file is generated, it should be transfered at the very... (3 Replies)
Discussion started by: im_new
3 Replies

9. UNIX for Dummies Questions & Answers

How to list all the files which are not generated today

How to list all the files which are not generated today, and move all the above files to backup dir. (2 Replies)
Discussion started by: redlotus72
2 Replies

10. Post Here to Contact Site Administrators and Moderators

User generated FAQ and Best Practices section

There are some common tasks and best practices that could be shared with the group by all the good people on the board. Having a admin approved/user generated section of this sort might be nice. Often there are lots of tidbits that could be grown into a useful document. Just a thought. ... (5 Replies)
Discussion started by: kduffin
5 Replies
Login or Register to Ask a Question