Add Linux directory info commands

This commit is contained in:
James Skemp 2023-11-18 07:47:52 -06:00
parent 21cb6ca5e4
commit ac9a0b9716
1 changed files with 9 additions and 0 deletions

View File

@ -80,6 +80,15 @@ sudo lsblk -f -m
# View the total size of a directory.
sudo du -sh /path/to/directory
# Show by child directory size.
sudo du -h /path/to/directory --max-depth=1
# Show largest directories first.
sudo du -h /path/to/directory --max-depth=1 | sort -hr
# Sort by directory name.
sudo du -h /path/to/directory --max-depth=1 | sort -k2
# Largest directories.
sudo du --separate-dirs -h /path/to/directory | sort -hr | head
sudo du --separate-dirs -h /path/to/directory | sort -hr | head -n 2
# Get all .mp4 files sorted by date and showing date, folder name, file name, and size.
# Excludes ._ and .DS_Store files (macOS).