find files with a perticular year of access


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users find files with a perticular year of access
# 1  
Old 07-12-2005
Bug find files with a perticular year of access

Hello all,
Might be a silly question, on my AIX machine the year had changed to 2022 and some files were accessed on this date hence the time stamp on these files is with year 2022, there are many such files. i want to list all these file from the root dir and subdir with 2022 year time stamp. can any one help me on this. i tried using find command with expression but could not frame it.

Kindly help me with this.

Regards,
Pradeep Kulkarni. Smilie
# 2  
Old 07-12-2005
Try this.

Code:
find / -exec ls -la {} \; | awk '{ if ( $8==2003) printf $0"\n" }'

Vino
# 3  
Old 07-12-2005
hello Vino,
Thanks for the solution i think it works, and i think i should mention 2022 instead of 2003 in that command right.
ca you do a favour, can you elobrate this command for me i mean explain

Thanks Pradeep
# 4  
Old 07-12-2005
Quote:
Originally Posted by pradeepmacha
hello Vino,
Thanks for the solution i think it works, and i think i should mention 2022 instead of 2003 in that command right.
ca you do a favour, can you elobrate this command for me i mean explain

Thanks Pradeep
Yes, it should be 2022.

Mea culpa.

find /

Find all file starting from / directory.

-exec ls -la {} \;

For each file found, execute ls -la on that file.

| awk '{ if ( $8==2022) printf $0"\n" }'

Pipe each ls -la to awk. If the eight field is 2022, print the file name.

Look into man find for different possible uses of find.

Vino
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 find all files other than last two dates per month and year?

Hi All, lets say there are following files in directory -rwxr-xr-x 1 user userg 1596 Mar 19 2012 a.txt -rwxr-xr-x 1 user userg 1596 Mar 19 2012 b.txt -rwxr-xr-x 1 user userg 1596 Mar 22 2012 c.txt -rwxr-xr-x 1 user userg 1596 Mar 24 2012 d.txt... (16 Replies)
Discussion started by: Makarand Dodmis
16 Replies

2. Shell Programming and Scripting

How to find all files other than first two dates & last date per month and year?

how to find all files other than first two dates & last date per month and year Hi All, lets say there are following files in directory -rwxr-xr-x 1 user userg 1596 Mar 19 2012 a.txt -rwxr-xr-x 1 user userg 1596 Mar 19 2012 b.txt -rwxr-xr-x 1 user userg ... (6 Replies)
Discussion started by: Makarand Dodmis
6 Replies

3. Shell Programming and Scripting

How to find all files for same month and year?

Hi All, I find all files for same month and year lets say there are following files in directory -rwxr-xr-x 1 user userg 1596 Mar 19 2012 c.txt -rwxr-xr-x 1 user userg 1596 Mar 21 2012 d.txt -rwxr-xr-x 1 user userg 1596 Mar 22 2012 f.txt -rwxr-xr-x 1... (8 Replies)
Discussion started by: Makarand Dodmis
8 Replies

4. Linux

Find MSWord doc Files by Year and then Copy

I need to be able to find all *.doc files by year last modified and then perform an action such as copy to folder: /documents/2011 the 'find' command seems to show the path but not the full file details, which includes the date modified as the ls command does. I got this far with ls, but have... (2 Replies)
Discussion started by: jamarsh
2 Replies

5. AIX

Want to find the last access time for large group of files at one go

Dear All, I'm working as a DBA and dont have much knowledge at OS level commands.we have requirement that we need find the files which has been last accessed >= apr 2010and also access date <= apr 2010 for a large set of files.Do know some commands likeistat, ls -u.But can anyone provide me the... (4 Replies)
Discussion started by: dbanrb
4 Replies

6. Shell Programming and Scripting

How to FTP files of perticular pattern.

Hi, I have a almost 4000 files in a perticular directory, but i want to ftp only todays files to some other unix server, not all the files. could you please help me on this. file formates are, -rw-r--r-- 1 pipe pipe 341 Mar 9 12:35... (1 Reply)
Discussion started by: shivanete
1 Replies

7. Solaris

How to : Find last login year in solaris ?

Thanks AVKlinux (10 Replies)
Discussion started by: avklinux
10 Replies

8. Shell Programming and Scripting

How to : Find last login year ?

Friends , With "last root | head -1 " command , we can find the last loging date and month . But i want to find last login year. Help me if u have any idea regarding this issue. Thanks AVklinux (3 Replies)
Discussion started by: avklinux
3 Replies

9. Shell Programming and Scripting

shell script to find and copy the files creted in the year 2006 to another directory

Hi All, I am new to UNIX. I will be thankful if some one helps me. I have to write a shell script for one of the requirement. I have files created from Jan 2006 to March 2008. My requirement is to write a script in such a way that 1) To find and copy(not Moving) the files created in the... (2 Replies)
Discussion started by: manas6
2 Replies

10. Shell Programming and Scripting

to get list of files of a perticular range of time

hi, how to list the files which has been created or accessed before 6 months thanks (1 Reply)
Discussion started by: useless79
1 Replies
Login or Register to Ask a Question