access time & modification time

Asked by Federico

Hi everybody,
which is the correct command in Ubuntu that gives me the access time and the modification time of an existing file?
Thank you for patience!
Have a nice day/night ...

Federico

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu yelp Edit question
Assignee:
No assignee Edit question
Solved by:
Hilario J. Montoliu (hjmf)
Solved:
Last query:
Last reply:
Revision history for this message
Best Hilario J. Montoliu (hjmf) (hmontoliu) said :
#1

I'd suggest you to take a look to stat:

hmontoliu@ulises-devel:~$ touch foo
hmontoliu@ulises-devel:~$ stat foo
  File: `foo'
  Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 806h/2054d Inode: 852425 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1001/hmontoliu) Gid: ( 1001/hmontoliu)
Access: 2009-12-17 18:06:38.000000000 +0100
Modify: 2009-12-17 18:06:38.000000000 +0100
Change: 2009-12-17 18:06:38.000000000 +0100
hmontoliu@ulises-devel:~$ echo hi! > foo
hmontoliu@ulises-devel:~$ stat foo
  File: `foo'
  Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: 806h/2054d Inode: 852425 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1001/hmontoliu) Gid: ( 1001/hmontoliu)
Access: 2009-12-17 18:06:38.000000000 +0100
Modify: 2009-12-17 18:06:43.000000000 +0100
Change: 2009-12-17 18:06:43.000000000 +0100

Revision history for this message
Hilario J. Montoliu (hjmf) (hmontoliu) said :
#2

... of course if you mean a graphical tool you can use nautilus, just right-click on a file and you'll see created and modified times

Revision history for this message
Federico (federico-sibella) said :
#3

Thank you Hilario,
 I was in troubles with the touch command when I read that it forces the update of the access time and modification time without knowing what the hell they are!
Bye!:-)

Federico