LoginSignup
37
37

More than 5 years have passed since last update.

Linuxでファイルが作成された日時を詳細に表示する

Last updated at Posted at 2018-09-05

stat コマンドで詳細を表示できる。

ファイルを作る

touch hoge

stat コマンドで詳細を表示する。

stat hoge
出力結果
  File: ‘hoge’
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: ca10h/51369d    Inode: 369369369   Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 369/ reoring)   Gid: ( 369/ reoring)
Access: 2018-09-05 03:06:09.190763369 +0000
Modify: 2018-09-05 03:06:09.190763369 +0000
Change: 2018-09-05 03:06:09.190763369 +0000
 Birth: -

Modify が作成日時となる。

Access, Modify, Change の違い

Access

ファイルデータが最後にアクセスされた時刻。mknod(2), utimes(2) と read(2) システムコールによって変更される。

Modify

ファイルデータが最後に変更された時刻。mknod(2), utimes(2) と write(2) システムコールによって変更される。

Change

ファイルの状態が最後に変更された時刻(inodeデータの変更)。chmod(2), chown(2), link(2), mknod(2), rename(2), unlink(2), utimes(2) と write(2)システムコールによって変更される。

他の方法

lsの、--time-styleオプションに、 full-iso を指定する

ls -la --time-style=full-iso
37
37
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
37
37