My notes.
path=/home/dom/test.txt
dirname=/home/dom/
filename=test.txt
basename=test.txt
fileroot=test
extension=txt
# Get string up to last occurrence of query (%)...
rootname="${filename%.*}" # query="."
rootname="${filename%.tar.gz}" # query=".tar.gz"
# Get string from last occurrence of query (##)...
filename="${path##*/}" # Extract filename from path
extension="${filename##*.}" # Extract extension from filename
https://wiki.ubuntuusers.de/tar/
# Compress
tar -czf {folder/}
# Decompress
tar -zxvf {folder.tar.gz}