pwdUseful for confirming your current location before running destructive commands.
High-value Linux filesystem commands for navigating, listing, inspecting, copying, moving, linking, and organizing files and directories.
List files, inspect metadata, and understand what is in a directory.
Show detailed directory contents with human-readable sizes.
ls -lahls -ltVisualize nested files and directories.
tree -L 2Inspect inode, permissions, timestamps, and ownership.
stat path/to/filefile path/to/fileCreate directory trees and remove them safely.
Create a directory path including missing parents.
mkdir -p app/data/uploadsrmdir empty-dirrm -rf old-buildPowerful and destructive. Verify the path first.
Common file and directory manipulation commands.
Copy directory trees while preserving timestamps and mode when possible.
cp -a source-dir target-dircp -i source.txt dest.txtmv old-name.txt new-name.txtmv logs /var/archive/logsCopy a file and set destination permissions in one step.
install -m 755 script.sh /usr/local/bin/scriptCreate and inspect hard links and symlinks.
ln original.txt alias.txtln -s /opt/app/current app-currentreadlink app-currentrealpath ./app-current/../configUnderstand file and directory sizes.
Show total size for a directory in human-readable format.
du -sh /var/logdu -h --max-depth=1 .df -hfind . -type f -printf '%s %p
' | sort -nr | head -20