command to know last modified user of a file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting command to know last modified user of a file
# 1  
Old 03-21-2012
Shell script for auditing

Hi

I have below requirement.

There are set of files to be monitored for audit purpose.
Source file contains the file name and its location on server.
Need to have shell script which generate a output file which is having the details of above files ( last modified user name ,lat update date,size) if its modified in last 1 day.
This shell script runs once a in day and generate the output and will mail this to set of user.

If any one have reusable code for this please share .
Appreciate your quick help on this.


Thanks,

Last edited by karnatis; 03-21-2012 at 08:04 PM..
# 2  
Old 03-21-2012
shell script requirement

Hi

I need to save the owner ,size and last modified date of a files into local variables of my shell script.
So that i can write this info into a different file.

Thanks,
-Suman K
# 3  
Old 03-21-2012
Use stat if it's available, otherwise use Perl or parse the output of ls.
# 4  
Old 03-21-2012
command to know last modified user of a file

Hi

Is there any command to know the last modified user of a file.

Need to use this in my shellscript.


Thanks,
# 5  
Old 03-21-2012
Thanks for your reply......
is there any way to find the last modifed user of a file,,,
# 6  
Old 03-21-2012
Do you mean the last user who changed some file? There is no Unix filesystem I'm aware of that stores this sort of meta-information.
# 7  
Old 03-21-2012
Yes....my context is we have a audit requirement and need to develop shell script which generates a output with the details like
Last modified date, File Size, and User ID (for last modifier) .

Here we need to monitor only pre defined set of files not all files.

So I am developing shell script and need this command.

Please let me know is there any other way to find this.

Thanks,

Suman
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Du command and modified date in ssh

Hello, I am a new user to linux and having trouble completing this task. I want to list a directory of files and folders including the name, human readable size, and last modified date. So far I can get two of the three but not all together. For example: Using ls -lh gives me drwxr-xr-x... (7 Replies)
Discussion started by: Newuzer
7 Replies

2. UNIX for Dummies Questions & Answers

Find command to get the modified files past 2 hours

Hello, How to get the modified/created files past 2 hours in Solaris with find command? Thank you. (7 Replies)
Discussion started by: balareddy
7 Replies

3. Shell Programming and Scripting

Trying to modified files using sed command

hi all, i will like to modified some files with the extension .gjf . All this files have in first line this #P PM3 Opt and i want to change that to this : %nproc=2 %chk=filename.chk #p B3LYP /6-31G** opt in order to do that i have try to do a script with the sed command but i... (4 Replies)
Discussion started by: juanchy
4 Replies

4. UNIX for Advanced & Expert Users

command for recently modified files - "find" command not working

I have three files a.txt , b.txt , c.txt in a directory called my_dir1 .These files were created before two or three months . I have a tar file called my_tar1.tar which contains three files a.txt , b.txt , d.txt . Somebody untarred the my_tar1.tar into my_dir1 directory. So existing two files were... (1 Reply)
Discussion started by: joe.mani
1 Replies

5. Shell Programming and Scripting

command to know files modified morethan 30 min

Hi, i use ksh and want to know the command for gettting the files which were not modified in last 30 min. find . -name <filename > -mtime 0.0209 is not giving the results. Thanks , Mohan (3 Replies)
Discussion started by: mohanpadamata
3 Replies

6. Shell Programming and Scripting

How to get a filename modified by attaching modified timestamp

Hi, I want to modify a filename in AIX by attaching the last modified timestamp. I want the timestamp completely in numerical format (eg:200905081210. yr-2009, mnth - 05, date -08, hr - 12, mins - 10). For example if the filename is a.log and it was modified on April 6th 2008 at 21.00. I... (16 Replies)
Discussion started by: Ruks
16 Replies

7. UNIX for Dummies Questions & Answers

how to retrieve original contents of a modified file (modified using vi)

Made changes to a file using vi editor and saved those changes now realised that the changes are not required How can I get the previous version of the file.i.e the one which was there on which I had made changes (3 Replies)
Discussion started by: novice100
3 Replies

8. UNIX for Dummies Questions & Answers

chmod command for recently modified files

hello! is there a way for me to use the chmod command to change permissions for several files all at once -based on the fact that these files were all most recently modified TODAY ? I can't use a wildcard on their filenames because the filenames are varied. But I was hoping I could somehow do... (2 Replies)
Discussion started by: polka_friend
2 Replies

9. UNIX for Advanced & Expert Users

Modified dates to a file without the cut command

how can i write the modified dates of all of the files in my directory to a file. i dont want any of the other junk from ls in there. i cant use the cut command (4 Replies)
Discussion started by: cypher
4 Replies
Login or Register to Ask a Question