filetime

On Unix systems the ls program can be used to display the creation times of files. However, the output of ls is not always useful within scripts because:

The filetime program displays the timestamps of files in a form which is easier to manipulate. Execute filetime as follows:

    filetime -[a|c|m] -[e|[s format]] [-h] [file...] 
The -a, -c and -m options indicate whether the access, status change or modification time should be displayed. The last modification time is displayed by default.

The -e (default) and -s parameters specify the display format. The -e parameter causes the number of seconds from the start of the Unix epoch to be displayed. The -s parameter requires a format string as specified for the strftime(3) function.

The -h parameter displays help information. Parameters are the names of files to be displayed.

Example

sms> filetime *.c
errno.c:        1133040153
filetime.c:     1133128901
sinfo.c:        1133040153
sizeof.c:       1133040153
sysconf.c:      1133040153
telltime.c:     1133040153
sms>
sms>
sms> filetime -s "%H %M %S" *.c
errno.c:        21 22 33
filetime.c:     22 01 41
sinfo.c:        21 22 33
sizeof.c:       21 22 33
sysconf.c:      21 22 33
telltime.c:     21 22 33
sms>

filetime.c

filetime.c processes each file in turn, calling stat(2) to find the file data. If formatted output is requested then this is formed using strftime(3).

Home