How to get File creation date.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to get File creation date.
# 1  
Old 09-24-2008
Question How to get File creation date.

Hi All,

I need to get file creation date.

I have to access one file who's name is like...

abc.log092308

and the date changes as per current date. And i am accessing this file next day. meance in above case i will access above file on 09-24-2008

Also one problem is that this file in not created on Saturday and Sunday. so i cant use yesterday logic.

I am working on KSH.

Please suggest some code.

Thanks,
Jeevan S.
# 2  
Old 09-24-2008
Afaik there is no file creation time -> ctime, atime, and mtime

Maybe you have to do some workaround like if there is a script creating that file, storing that initial date into some separate file or something.
# 3  
Old 09-24-2008
hi jeevan,

please try the following:

echo touch abc.log092308 > log
echo `date` > log
touch abc.log092308

hence it will create a log file where it will show u the creation date and time...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to print file name and its creation date

Hello , I am looking for a script to print file name and its last updated time. FILE CREATION-TIME FILE-NAME 24/10/2017 12:34 TDR-IU-8-2017.10.24.07:40:00-2017.10.24.07:45:00 when we run l command it print the directory and the files with details like permission,... (1 Reply)
Discussion started by: sadique.manzar
1 Replies

2. UNIX for Advanced & Expert Users

Add file creation date as new column

Hi , I have a requirement to append file creation date to each row in a file for all the files in a directory. Please help Thanks, Pavan (2 Replies)
Discussion started by: Pavan Ram B S
2 Replies

3. OS X (Apple)

How to get the file creation date with find command

Is it possible to find all files based on the date of creation? And if so, how? I've been looking at the find command but it seems that only modification times are used as an option. (1 Reply)
Discussion started by: Straitsfan
1 Replies

4. Shell Programming and Scripting

finding creation date of a file

Hi, Can anyone tell me a process to find the creation date of a file in a directory. If suppose I have a file in a directory created in 2009 -rw-r--r-- 1 xyz guest 2480 Jul 16 2009 sample.txt The command should return the the file creation date as 16/07/2009 thanks, (2 Replies)
Discussion started by: swathich
2 Replies

5. Shell Programming and Scripting

how to find creation date of file

Hi, I just need to know way of getting date of file when it was created. eg i have a file abc created on 23 aug. Now i need to know date of file i.e. 23 aug. How can i get that data. Thanks Sarbjit (7 Replies)
Discussion started by: sarbjit
7 Replies

6. UNIX for Dummies Questions & Answers

Changing Creation Date to a Prespecified Date of a File In Unix

Dear Expert, Is there a command to do that in Unix? In such a way that we don't need to actually "write" or modified the content. -- monkfan (4 Replies)
Discussion started by: monkfan
4 Replies

7. UNIX for Dummies Questions & Answers

Displaying file names before a particular creation date

Hi!! I wanna display file names which are created before/after a particular date. I wud be glad if anybody can help me out in that. Thanx Dhruv (1 Reply)
Discussion started by: dhruv_saksena
1 Replies

8. UNIX for Dummies Questions & Answers

file creation date & time

Hi All, I have some files which are creates every day using a script. I want to create a log files which does write "filename,creation day and time" how can I do this ?? Alice (3 Replies)
Discussion started by: alisevA3
3 Replies

9. UNIX for Advanced & Expert Users

file creation date including seconds

Hi, Is anybody can help me to get the file creation date with seconds? -rw-r--r-- 1 opsc system 422550845 Aug 22 15:41 StatData.20020821 Thanks in advance Krishna (7 Replies)
Discussion started by: krishna
7 Replies

10. UNIX for Dummies Questions & Answers

Converting the File Creation Date to a new format

I need to capture a file's creation/modification date and time and convert this to a different format, whilst I can easily get the existing format from a ls -l | awk ' { print $......}' or a cut command I do not know how to convert it to a desired format? I should add that at present the ls -l... (1 Reply)
Discussion started by: barney_clough
1 Replies
Login or Register to Ask a Question