The tar command on Linux is often used to create or extract .tar.gz or .tgz archive files, also called "tarballs". Command has integrated compression, It can create a .tar archive and then compress it with gzip (.tar.gz) or bzip2 (.tar.bz2) compression in a single command.
tar -czvf <name of archive>.tar.gz <path to directory or file>
tar -czvf banks.tar.gz /var/data/banksBelow are the details of the options used:
tar -czvf <name of archive>.tar.gz <path to directory or file seperated by space>
tar -czvf banks.tar.gz /var/data/banks /var/data/bank_codes.csv