Combining many files into a single archive and then compressing them is a common task. tar is the traditional Unix archiver: tar -cvf archive.tar dir creates an archive (the c is "create", v is "verbose", f names the file), and tar -xvf archive.tar extracts it. Adding -z runs the archive through gzip on the fly, producing a .tar.gz file. For standalone compression, gzip file produces a .gz file and gunzip file.gz reverses the operation. ZIP archives, common when interoperating with Windows, are handled by unzip file.zip to extract and zip archive.zip files to create.
Automation is where the command line truly shines. The crontab system runs scheduled jobs in the background. crontab -e opens your personal cron table for editing, where each line follows the format * * * * * command to specify minute, hour, day of month, month, and day of week. Cron then runs the command at the matching times, making it perfect for routine backups, log rotations, and report generation.
For more elaborate automation, you can write Bash scripts. A script begins with a shebang line such as #!/bin/bash so the kernel knows which interpreter to use. After writing your commands in a file, make it executable with chmod +x script.sh and run it with ./script.sh. Inside scripts you can use variables, loops, and conditional statements, allowing you to package complex sequences of commands into reusable, parameterized tools. Together, archives, compression, scheduling, and scripting turn the Linux CLI from an interactive prompt into a powerful platform for reliable, repeatable system administration.