Skip to content

OSlings Practice 45k-47k, Problem 3: File Commands

OSlings Practice 45k-47k, problem 3 of 3 · Length: 7:19 · Exercise: 47k_file_commands (Week 12) · Problems: 45k-47k (PDF) · Answer key: Solutions (PDF)

Two parts, worked on the set's pages 5 and 6: (a) what each of seven commands prints, from an empty root (touch, cat and rm on a file, then mkdir d and rm d); (b) an rm without its is_dir check, run on a directory holding a file: what happens to the directory and to the file inside it, and why that is a problem. The answer key's handwriting is written onto the page as each step is worked.

Download the video (MP4, 12 MB) · Captions (WebVTT) · All three problems