develog

[bash] stat, 파일 상세 날짜 확인하기 본문

카테고리 없음

[bash] stat, 파일 상세 날짜 확인하기

냐옴 2024. 4. 13. 08:51

stat 명령어로 파일의 상세 날짜 정보를 확인할 수 있다

$ stat aa.sh
  File: aa.sh
  Size: 19        	Blocks: 8          IO Block: 4096   regular file
Device: fd02h/64770d	Inode: 2083852     Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Context: unconfined_u:object_r:admin_home_t:s0
Access: 2024-04-12 23:48:06.253449914 +0000
Modify: 2024-04-12 23:46:07.252815178 +0000
Change: 2024-04-12 23:47:06.749132530 +0000
 Birth: 2024-04-12 23:44:31.982307016 +0000

ls 명령어로 확인되는 날짜는 Modify 일시

$ ls -al aa.sh
-rwxr--r--. 1 root root 47 Apr 12 23:46 aa.sh

Birth 는 파일의 생성 일시

$ touch aa.sh

$ stat aa.sh
 Birth: 2024-04-12 23:44:31.982307016 +0000

Modify  파일 자체 내용의 변경 일시

$ cat > aa.sh
08:45 add new line
^C

$ stat aa.sh
Modify: 2024-04-12 23:46:07.252815178 +0000

Change  파일 메타데이터의 수정 일시

$ chmod 755 aa.sh

$ stat aa.sh
Change: 2024-04-12 23:47:06.749132530 +0000

Access  파일 접근 일시

$ cat aa.sh

$ stat aa.sh
Access: 2024-04-12 23:48:06.253449914 +0000
Comments