Command-line Knowledge Base

tar

Exclude folder
cd /path/to/folder/to/compress
tar -czvf /media/dave/data_hdd/02__bettermousetraps.net/2023_0208.tar.gz --exclude="bettermousetraps.net/images/wallpapers/" --exclude="bettermousetraps.net/images/wallpapers/*" bettermousetraps.net/
Exclude folder using exclude file
cd /path/to/folder/to/compress
tar -czvf /media/dave/data_hdd/02__bettermousetraps.net/2023_0208.tar.gz --exclude-from="exclude_file.txt" bettermousetraps.net/
exclude_file.txt Example #1 *
bettermousetraps.net/images/wallpapers/
bettermousetraps.net/images/wallpapers/*

* This will not remove the wallpapers folder.

exclude_file.txt Example #2 *
architecture/images
crime/images
cryptocurrency/images

* This will remove the images folders.