Solved

finding a file

Posted on 2002-04-11
10
177 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
 
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now