Linux Files and Directories
Navigate, create, move, and inspect files with core commands.
- linux ls
- mkdir -p
- cp mv rm
- du disk
- file commands
Linux Files and Directories
Navigate, create, move, and inspect files with core commands.
Commands
| Command | What it does | |
|---|---|---|
pwd && ls -la | Location plus hidden files | |
mkdir -p app/logs | Nested dirs in one shot | |
cp -r src/ dst/ | Recursive copy | |
mv old new | Rename or move | |
rm -ri dir/ | Interactive recursive delete | |
| `du -sh * | sort -h` | Folder sizes, human sorted |
Example
mkdir -p app/logs
cp -r src/ app/src/
du -sh app/* | sort -h
FAQ
How do I prevent rm disasters?
Alias rm to rm -i on interactive shells, quote variables, and never rm -rf an empty variable path.
How do I find the biggest files?
Combine du for directories with find -size for individual offenders.
FAQ
How do I prevent rm disasters?
Alias rm to rm -i on interactive shells, quote variables, and never rm -rf an empty variable path.
How do I find the biggest files?
Combine du for directories with find -size for individual offenders.
Linux
Linux Permissions
Read ls output, chmod, chown, and sudo without breaking access.
Linux Text Processing
cat, head, cut, sort, uniq, and awk for daily data shaping.
Linux grep and find
Find files by name, age, and size; search inside them fast.
Linux Processes
See what runs, what eats CPU, and how to stop it cleanly.