Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am using Debian 7.2 and would like to know the shell command for finding the MAC time of a file or directory. I tried

man -k "MAC"

and got a lot of hits about macros. I then tried

man -k "MAC time"

and got nothing.

share|improve this question

closed as unclear what you're asking by Gilles, jasonwryan, Anthon, rahmu, paraxor Oct 18 '13 at 1:16

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Is stat yourfile working? –  Ivan Chau Oct 17 '13 at 2:59
    
What is a “MAC time”? –  Gilles Oct 17 '13 at 21:01
    
Modify, Access, Create time. –  OtagoHarbour Oct 17 '13 at 22:59
    
Yes. stat works. Thanks. –  OtagoHarbour Oct 17 '13 at 22:59
add comment

1 Answer 1

up vote 1 down vote accepted

By MAC I assume you're asking about Modify, Access, and Change timestamps. You can get these from the stat command.

Example

$ ls -l LICENSE 
-rw-rw-r-- 1 saml saml 810 Jul  5  2012 LICENSE

$ stat LICENSE 
  File: `LICENSE'
  Size: 810         Blocks: 8          IO Block: 4096   regular file
Device: fd02h/64770d    Inode: 11409231    Links: 1
Access: (0664/-rw-rw-r--)  Uid: (  500/    saml)   Gid: (  501/    saml)
Access: 2012-07-05 19:05:22.000000000 -0400
Modify: 2012-07-05 19:05:22.000000000 -0400
Change: 2013-10-16 21:17:31.148341667 -0400

Details

  • Access: 2012-07-05 19:05:22.000000000 -0400 – Last access time of the file.
  • Modify: 2012-07-05 19:05:22.000000000 -0400 – Last modification time of the file.
  • Change: 2013-10-16 21:17:31.148341667 -0400 – Last change time of the inode data of that file.
share|improve this answer
    
Create timestamps? Not on most unices. C is for inode Change. –  Gilles Oct 17 '13 at 21:01
    
@Gilles - thanks fixed. –  slm Oct 17 '13 at 21:26
    
That's it! Thanks very much! –  OtagoHarbour Oct 17 '13 at 23:00
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.