Objective

Hands-on practice with advanced file management in a Linux environment.

Tools & Technologies

  • ln
  • lsof
  • inotifywait
  • du
  • df

Key Commands

ln -s /path/to/target link_name
lsof +D /var/log
du -sh /*
df -hT

Lab Steps

01
Hard and Soft Links

Understand inode-level hard links vs symbolic links and when each is appropriate.

02
Disk Usage Analysis

Use du and df to identify disk space hogs and filesystem utilization.

03
Open File Handles

Use lsof to identify which processes have files open, useful for debugging.

04
File Monitoring

Use inotifywait to watch directories for changes in real time.

Challenges Encountered

  • Hard links cannot span filesystems
  • inotifywait requires inotify-tools package

Key Takeaways

  • Hard links share the same inode; deleting one doesn't remove data
  • lsof is invaluable for debugging 'device busy' errors