1837650 Members
2919 Online
110117 Solutions
New Discussion

file date/time

 
SOLVED
Go to solution
j773303
Super Advisor

file date/time

Does any command can show the date and time of a file?
Hero
5 REPLIES 5
Graham Cameron_1
Honored Contributor

Re: file date/time

ls -l [file] gives last modification time.
ls -lu gives last access time.
ls -lc gives creation time.
-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
j773303
Super Advisor

Re: file date/time

For example:
Using ll mylog,

-rw-r--r-- 1 root root 69196 Nov 24 17:42 mylog

I'd like to use command to show the mylog date/time is 11 24 17:42 not Nov 24 17:42,
Is it possible to do this?
Hero
Graham Cameron_1
Honored Contributor

Re: file date/time

LC_TIME can be used to influence the format of ls -l.
I'm not an expert in it's use.
Search the forums, or start here...
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=202019
-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Jean-Louis Phelix
Honored Contributor
Solution

Re: file date/time

Hi,

You could you a variant of the very simple attached C prog.

/home/phelix/FORUMS> ./e2 e.c
File 'e.c' :
Last access : 2003 11 24 14 53 30
Last modification : 2003 11 24 14 56 12
Last attr change : 2003 11 24 14 56 12
/home/phelix/FORUMS>

Regards,

Jean-Louis.
It works for me (© Bill McNAMARA ...)
Michael Schulte zur Sur
Honored Contributor

Re: file date/time