Can anyone tell me what is the command to print out file creation TIME and DATE in UNIX? I have searched a lot on Google and got the solution for Linux. But those commands are not working on Sun OS.
Unix doesn't have a file creation time. It has these:
ls
is the best option if you are not feeding the output to a program. man ls
is your friend.
ls -lu => show last access time
ls -lc => show last status change time
ls -l => show last modified time (default)
In general, it is not recommended that we feed the output of ls
into a program because of portability concerns. On macOS and Linux systems, we have a stat
command to extract file status information.
Related posts:
Print a file's last modified date in Bash