Solved

finding a file

Posted on 2002-04-11
10
181 Views
Last Modified: 2013-12-16
How to find all files which is created in December ?
0
Comment
Question by:vrelhan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux Samba using Kerberos to Auth from Active Directory 9 121
AWS EC2 HTTP & HTTPS 2 120
RPM creation 6 49
grep command usage 10 34
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

752 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