Instant backup: expands to cp file file.bak
Cheat sheet · 11 commands
Files & directories
Creating, copying, moving and deleting are four commands and a few flags. The flags are where the danger and the time savings live, so they are the part worth memorising.
The 3 you will use every day
Delete a directory and everything inside
Create a nested path in one go (no error if it exists)
The full sheet
- Create a directoryguide ›
- Create a nested path in one go (no error if it exists)guide ›
- Create an empty file / refresh its timestampguide ›
- Copy a fileguide ›
- Copy a tree preserving permissions, times, symlinksguide ›
- Instant backup: expands to cp file file.bakguide ›
- Move or rename (same operation)guide ›
- Delete a file: permanentlyguide ›
- Delete a directory and everything insideguide ›
- Create a symbolic linkguide ›
- Update an existing symlink to a directoryguide ›
Practise these for real in the interactive course,
or keep every sheet, chapter and fix in one book: The Linux Command Line Handbook.