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
Solved

finding a file

Posted on 2002-04-11
10
179 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
winscp where are logs stored 3 52
Run Secure WMI query from CentOS 5 83
EXCHANGE. LINUX, SYMANTEC MESSAGING GATEWAY 2 38
HOw To Install Docker on VMware Workstation 19 175
Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
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…
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…

829 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