LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Get the epoch date of a file (https://www.linuxquestions.org/questions/linux-general-1/get-the-epoch-date-of-a-file-577246/)

helptonewbie 08-15-2007 07:01 AM

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

wjevans_7d1@yahoo.co 08-15-2007 07:39 AM

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"


helptonewbie 08-15-2007 07:44 AM

i just get the normal date output, date usage options basically, and i can't do date -d

helptonewbie 08-15-2007 07:46 AM

that good though, all i need now is a way to get the epoch date of a file, cheers for your help btw


All times are GMT -5. The time now is 06:11 AM.