LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 08-15-2007, 08:01 AM   #1
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
Get the epoch date of a file


hello, i'm looking for a command that is able to output the epoch date of a file name. I cannot use date -r filename, the system i'm trying this on doesn't seem to support it or date +%s and all that stuff, must be using an older version of the date command. the man date command show me that the manual for the date command i've got here was september 2004

Is there any other methods to retreive the normal epoch of right now and then the epoch of a file.

Thanks cheers
Mark
 
Old 08-15-2007, 08:39 AM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 30
On Slackware 9.1, my date(1) man page bears the date March 2003, so it's older than yours. And my Slackware is about that old.

What are the exact error messages you get when you enter these commands?

Code:
date -r /
date "+%s"
date -d "$(date -r /)" "+%s"
 
Old 08-15-2007, 08:44 AM   #3
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
i just get the normal date output, date usage options basically, and i can't do date -d
 
Old 08-15-2007, 08:46 AM   #4
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
that good though, all i need now is a way to get the epoch date of a file, cheers for your help btw
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Epoch Converstion mudman69 AIX 1 05-30-2007 12:46 PM
PHP Time before Unix Epoch? wh33t Programming 2 08-29-2006 02:32 PM
Convert CCYYMMDDhhmmss to Unix Epoch. unreal128 Linux - General 1 07-22-2006 08:06 PM
Epoch time the other way! michedlp Programming 0 04-25-2004 04:51 AM
The End of the UNIX Epoch oulevon Programming 10 11-22-2003 03:42 AM


All times are GMT -5. The time now is 04:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration