Finding the date a file was created


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Finding the date a file was created
# 1  
Old 04-02-2009
Finding the date a file was created

how do i find the date a file was created?
# 2  
Old 04-03-2009
The "c" switch to "ls".

ls -lac filename

Beware: I have seen backup software change this timestamp.
# 3  
Old 04-03-2009
From man ls (emphasis added):
Code:
       -c     with -lt: sort by, and show, ctime (time of last modification of
              file status information) with -l: show ctime and  sort  by  name
              otherwise: sort by ctime

UNIX systems do not store the creation time of any file, you can choose between the time of the last access (atime), modification (mtime), or change time (ctime), but that's about it.
# 4  
Old 04-04-2009
I stand corrected. "ls -alc" only reflects the last change of status of the inode (e.g. touch, chmod, chown, mv, etc. etc..). After a "mv" for example it is possible for the "ctime" to be after the "mtime".
So, if absolutely nothing changes the status of the file after the file was created, the "ctime" is the time the file was created.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find the file created on current date

Hi All, I'm trying to find a file which is created on current day.... I searched in unix.com and i found, below command. find /land/ -mtime -1 -type f -print | grep "FF_Member_STG.dat" The command checks if the file with name "FF_Member_STG.dat" is created today then exit else proceed. ... (3 Replies)
Discussion started by: ace_friends22
3 Replies

2. UNIX for Dummies Questions & Answers

How to get year part from file created date?

Hi Gurus, I need to get year part of file created date. when using ls -l , it only show month, day and time. is there any option I can add to get year portition? Thanks in advance (7 Replies)
Discussion started by: ken6503
7 Replies

3. UNIX for Dummies Questions & Answers

Can we change the file created date?

Hi, I am creating a file in unix today. Is it possible to make the file created as 2 days older (or some past date)? P.S: i dont want to change the system date to older one and try.:rolleyes: Thanks, Pandeeswaran (6 Replies)
Discussion started by: pandeesh
6 Replies

4. Shell Programming and Scripting

finding date numeral from file and check the validity of date format

hi there I have file names in different format as below triss_20111117_fxcb.csv triss_fxcb_20111117.csv xpnl_hypo_reu_miplvdone_11172011.csv xpnl_hypo_reu_miplvdone_11-17-2011.csv xpnl_hypo_reu_miplvdone_20111117.csv xpnl_hypo_reu_miplvdone_20111117xfb.csv... (10 Replies)
Discussion started by: manas_ranjan
10 Replies

5. Shell Programming and Scripting

finding the previous day date and creating a file with date

Hi guys, I had a scenario... 1. I had to get the previous days date in yyyymmdd format 2. i had to create a file with Date inthe format yyyymmdd.txt format both are different thanks guys in advance.. (4 Replies)
Discussion started by: apple2685
4 Replies

6. Shell Programming and Scripting

Find first created file date in YYYYMMDD format

Hi All, We are copying all the files into ARCHIVE directory after we process them. We are doing this process from last 2 years, now we have a lot of files in ARCHIVE directory. Now I need to find when the first file is copied into this directory? If I Issue, ls -l /ARCHIVE/*.* | tail -1... (3 Replies)
Discussion started by: Raamc
3 Replies

7. Shell Programming and Scripting

Rename File Based on Created Date

I am trying to rename files based on the created/born date of the file. I Have a total of 4000 files that i am trying to do this with and would like it to be log_yyyymmddhh.gz right now the files are maillog.???.gz. Can anyone point me in the right direction of how to get this done via scipt? ... (4 Replies)
Discussion started by: Paulb
4 Replies

8. UNIX for Dummies Questions & Answers

Finding a file created within the last 24 hours

which out of atime, ctime, or mtime are the closest to diplaying only the files created within the last 24 hours. is it even possible to find only the files created in the last 24 hours, because I heard that unix files don't hold the creation time as a property of the file. (3 Replies)
Discussion started by: raidkridley
3 Replies

9. Shell Programming and Scripting

Need to find created date of file in UNIX

I need to write a script which has to list all the files which are created before six months from now. kindly help on this ... (7 Replies)
Discussion started by: amirthraj_12
7 Replies

10. UNIX for Dummies Questions & Answers

File management based on date created

Hi There, I was wondering how to manage files (ie. rm, cp , mv) based on date last modified and date created. ie. Say i want to: mv ./* ./temp/* (where the date created < 29/1/2006 ) or mv ./* ./temp/* (where the date modified > 27/1/2006 && date modified < 29/1/2006) Thanks in... (1 Reply)
Discussion started by: Geehog_Rare
1 Replies
Login or Register to Ask a Question