Linux/Unix ファイルのアクセス日時・変更日時を確認する

atime mtime ctime を確認するには stat コマンドを使用します。

atime mtime ctime の確認方法

stat ファイル名
確認できる日時
略名 名称 意味
atime Access Time ファイルにアクセスした日時
mtime Modify Time ファイル内容・属性(パーミッションなど)を変更した日時
ctime Change Time ファイル属性(パーミッションなど)の変更日時

stat コマンドの実行例

# stat test.txt
File: test.txt
Size: 0               Blocks: 0          IO Block: 512    regular empty file
Device: 2dh/45d Inode: 143833713099184833  Links: 1
Access: (0777/-rwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2031-12-01 23:50:59.000000000 +0900
Modify: 2030-12-01 23:50:59.000000000 +0900
Change: 2021-10-06 10:27:05.630684900 +0900
Birth: -
#
stat コマンドの実行例
stat コマンドの実行例

検証環境