Zipping a file in Linux is straightforward, following steps:
1. Check if the zip utility is installed on your Linux distribution. After logging in with your username and password, ensure you have the zip utility installed by using one of these commands:
- For Ubuntu/Debian:
# sudo apt install zip
- For CentOS/Fedora:
# sudo yum install zip
2. Once the zip utility is installed, you can start using the zip command to compress files and folders. To compress a single folder or file, use the following syntax:
# zip -r <archive_name.zip> <folder_to_compress>
3. You can also compress multiple files/folders into a single archive by appending additional file names to the command:
# zip -r <archive_name.zip> <file1> <file2> <file3> ...