Solved

finding a file

Posted on 2002-04-11
10
178 Views
Last Modified: 2013-12-16
How to find all files which is created in December ?
0
Comment
Question by:vrelhan
  • 5
  • 4
10 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6933472
find / -ls|grep " Dec "
# the sring Dec may vary according to your language settings
0
 

Author Comment

by:vrelhan
ID: 6933609
can you please explain this command..
0
 

Author Comment

by:vrelhan
ID: 6933612
can you please explain this command..
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 6933628
man find
man grep
man sh     # if you need to know something about pipes
0
 

Author Comment

by:vrelhan
ID: 6933639
can you please explain this command..
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6934094
what should be explained? man?

man man

(it's not a word puzzle, but a real nice unix command)
0
 
LVL 1

Expert Comment

by:smisk
ID: 6949446
While ahoffman's idea works, it lists all files and only greps out those with a December date.  Here's a more straightforward way :

# assume today is 4/17/02.  this means that 12/1/01 was
# 137 days ago.  also, we know that 12/31/01 was 107 days
# ago.  the find command allows you to filter results based
# upon modification time with the '-ctime' option.
#
# try the following command :

find / -ctime +107 -ctime -137

This command will find every file (starting in the directory / but recursing onward) that was modified between 107*24 hours ago (12/1/01) and 137*24 hours ago (12/31/01) and print out the filename to the screen.

ahoffman is right.  'man find' will tell you a lot about the command and how it can be used.

Note : I'm assuming you want to find files modified (not created) between 12/1/01 and 12/31/01.  If you want to do the search for files modified between 12/1/00 and 12/31/00 you should add the proper number of days (365) to each date...

Hope I cleared this up.

Thanks,
Steve
0
 

Author Comment

by:vrelhan
ID: 6949681
Thanks for the help.. I understand from "man find"

-atime  will give file access time
-mtime  will give file modification time
-ctime  will give the time of last change of file


But as smisk is suspecting, I want file creation time.
Does Unix stores somewhere about the file creation time.

0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 20 total points
ID: 6960889
file creation time can only be accessed by low-level filesystem commands, AFAIK there are no user-level commands

0
 

Author Comment

by:vrelhan
ID: 6961896
Smisk and ahoffmann helped in my query..Thanks a ton to both of them.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
nagios remote hosts 9 56
Centos 7 User to Start Apache, MariaDB, LDAP 5 38
Hacked File Timestamps 4 61
VMware Workstation 12 Player 16 73
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question