$
학습 Linux 안내서
ko
XP:0
퀘스트 8Inspector
+140 XP

Inspecting File Types & Metadata (file & stat)

이 퀘스트를 위한 인터랙티브 터미널 시작→설치 불필요 • 브라우저에서 바로 실행

개념 및 개요

In Linux, file extensions (like .txt or .png) are merely hints for humans—the operating system does not rely on them. To identify what a file truly contains, the file command reads the file's binary header (magic bytes) and determines its actual format (ASCII text, ELF executable, gzip archive, etc.).

To inspect deep filesystem metadata beyond what ls -l shows, the stat command displays the file's exact size in bytes, allocated blocks, filesystem inode number, octal access permissions (e.g. 0644), and exact timestamps: Access (atime), Modify (mtime), and Change (ctime).

Inspect the type and metadata of /home/learner/notes.txt. First run file notes.txt to detect its file format, then run stat notes.txt to view its inode, size, octal permissions, and timestamps.

명령어 구문 참조

Command / SyntaxDescription
file notes.txtDetect file format and MIME encoding
stat notes.txtDisplay inode, octal permissions, and timestamps

검증 목표

  • ○
    Run the "file" command on notes.txt
  • ○
    Run the "stat" command on notes.txt

퀘스트를 완료할 준비가 되셨나요? 8?