To compress a file in Linux, you can use one of the two utilities.
- Tar
- zip
Compress Files/Folders using tar
To compress a file a folder use the following command.
tar -cvf output.tar <file/folder name>
To compress multiple files and folders,
tar -cvf output.tar <file1> <folder1> <file2> <folder2>