|
INTERVIEW QUESTIONS
OPERATING SYSTEMS
UNIX PROGRAMMING
DETAILS
Question: How do I find the creation time of a file?
Answer: You can't - it isn't stored anywhere. Files have a last-modified time (shown by "ls -l"), a last-accessed time (shown by "ls -lu") and an inode change time (shown by "ls -lc"). The latter is often referred to as the "creation time" - even in some man pages - but that's wrong; it's also set by such operations as mv, ln, chmod, chown and chgrp. The man page for "stat(2)" discusses this.
|
|
|
Category |
Unix Programming Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8334 users |
Added on |
8/26/2014 |
Views |
71380 |
Rate it! |
|
|
Question:
How do I find the creation time of a file?
Answer:
You can't - it isn't stored anywhere. Files have a last-modified time (shown by "ls -l"), a last-accessed time (shown by "ls -lu") and an inode change time (shown by "ls -lc"). The latter is often referred to as the "creation time" - even in some man pages - but that's wrong; it's also set by such operations as mv, ln, chmod, chown and chgrp. The man page for "stat(2)" discusses this. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
How do I ring the terminal bell during a shell script?
|
View Answer
|
|
How do I find the creation time of a file?
|
View Answer
|
|
How do I construct a shell glob-pattern that matches all files except "." and ".." ?
|
View Answer
|
|
How do I tell inside .cshrc if I'm a login shell?
|
View Answer
|
|
How do I redirect stdout and stderr separately in csh?
|
View Answer
|
|
How do I {set an environment variable, change directory} inside a program or shell script and have that change affect my current shell?
|
View Answer
|
|
Why do I get [some strange error message] when I "rsh host command" ?
|
View Answer
|
|
How do I rename "*.foo" to "*.bar", or change file names to lowercase?
|
View Answer
|
|
How do I get the current directory into my prompt?
|
View Answer
|
|
How do I get a recursive directory listing?
|
View Answer
|
|
How do I remove a file with funny characters in the filename ?
|
View Answer
|
|
How do I remove a file whose name begins with a "-" ?
|
View Answer
|
|
What happened to the pronunciation list that used to be part of this document?
|
View Answer
|
|
What are some useful Unix or C books?
|
View Answer
|
|
How does the gateway between "comp.unix.questions" and the "info-unix" mailing list work?
|
View Answer
|
|
What does {some strange unix command name} stand for?
|
View Answer
|
|
When someone refers to 'rn(1)' or 'ctime(3)', what does the number in parentheses mean?
|
View Answer
|
|
Who helped you put this list together?
|
View Answer
|
|
Describe about awk and sed?
|
View Answer
|
|
Explain the basic forms of each loop?
|
View Answer
|