Signal9Signal9 — home
online
back to labs

What Kind of File Is This?

EasyLinux Fundamentals10-15 min
The brief

A filename tells you almost nothing — 'data' could be text, a photo, or a program. Linux gives you tools that answer 'what IS this, really?' by looking at the content and metadata, not the name.

• file — sniffs the content and names it ('ELF 64-bit executable', 'ASCII text', 'symbolic link').

• stat — shows metadata (type, size, owner, timestamps).

• ls -l — its first character is the type flag (- d l c b), and it shows where symlinks point.

Five specimens sit in /root/specimens (a, b, c, d, e). Classify them and record three answers under /root/answers/:

1. Exactly one specimen is a compiled program (an ELF binary). Use file to find it; write its NAME (just the letter) to /root/answers/binary.txt

2. One specimen is a symlink. Write the name it POINTS TO into /root/answers/linktarget.txt (hint: readlink, or the '-> target' in ls -l).

3. Write the single ls -l type CHARACTER for specimen e into /root/answers/dirchar.txt.

Never trust the name — ask the file what it is.

What you'll do
  • Use file to identify which specimen is a compiled binary
  • Read a symlink's target with readlink or ls -l
  • Read the ls -l type character for a directory

Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.