Archive Files

# -c: Create a new archive
# -f: Use archive file
tar -cf archive.tar example.txt
tar -cf archive.tar example1.txt example2.txt
# -z: filter the archive through gzip
tar -zcf example.tar.gz example/


Extract Files

# -x: Extract files from an archive
# -f: Use archive file
tar -xf archive.tar
tar -xf archive.tar.gz
# output given directory
tar -xf archive.tar --directory archived


Display Contents without Extracting

tar -tf archive.tar