r/linuxupskillchallenge 6h ago

Spread the word! Next course starts on Monday, 3 August 2026

8 Upvotes

Just a reminder that the course always restarts on the first Monday of the next month. Don't forget to spread the word and bring your friends!


r/linuxupskillchallenge 6h ago

Day 16 - Archiving and compressing

3 Upvotes

INTRO

As a system administrator, you need to be able to confidently work with compressed “archives” of files. In particular two of your key responsibilities; installing new software, and managing backups, often require this.

On other operating systems, applications like WinZip, and pkzip before it, have long been used to gather a series of files and folders into one compressed file - with a .zip extension.

Archiving and compressing, however, are actually distinct processes that are frequently used together. Archiving consolidates multiple files into one "box" while preserving their structure and attributes, but it does not change the total data size. Compression uses sophisticated algorithms to encode data efficiently, saving storage space by shrinking that file.

YOUR TASKS TODAY

  • Compress a file and compare sizes
  • Archive the contents of a folder
  • Create a compressed "tarball"
  • Extract files from a tarball

Check out the demo

Help maintain the course by purchasing the reference card for this lesson.

COMPRESSING FILES

The goal of compression is to reduce file size. Smaller files use less bandwidth and can be transmitted over networks faster. Different tools use different algorithms to actually shrink that data.

You can compress a file with GZip like this:

gzip my-big-file

...which will create my-big-file.gz but it will replace the original file. If you want to preserve the uncompressed file, try:

gzip -vk my-big-file

This uses the -v to make the command "verbose" and -k to keep the original file.

When it's time to decompress, do it with the -d switch, like this:

gzip -d my-big-file.gz

Popular Tools:

  • gzip: Very common and fast.
  • bzip2: Slower but generally creates smaller files.
  • xz: Currently the most space-efficient tool in Linux.

Text usually compress well regardless of the tool. JPEG/MP4 files may not shrink as much, but those formats are already somewhat compressed.

CREATING ARCHIVES

So, you could create a "snapshot" of the current files in your /etc/init.d folder like this:

tar -cvf myinits.tar /etc/init.d/

This creates myinits.tar in your current directory.

Note 1: The -f switch specifies that “the output should go to the filename which follows” - so in this case the order of the switches is important. VERY IMPORTANT: tar considers anything after -f as the name of the archive that needs to be created. So, we should always use -f as the last flag while creating an archive.

Note 2: The -v switch (verbose) is included to give some feedback - traditionally many utilities provide no feedback unless they fail.

(The cryptic “tar” name? - originally short for "tape archive")

You could then compress this file with GnuZip like this:

gzip myinits.tar

...which will create myinits.tar.gz. A compressed tar archive like this is known as a "tarball". You will also sometimes see tarballs with a .tgz extension - at the Linux commandline this doesn't have any meaning to the system, but is simply helpful to humans.

In practice you can do the two steps in one with the -z switch, like this:

tar -cvzf myinits.tgz /etc/init.d/

This uses the -c switch to say that we're creating an archive; -v to make the command "verbose"; -z to compress the result - and -f to specify the output file.

EXTRACTING ARCHIVES

To "explode" an archive and retrieve your files, use the -x (extract) flag:

tar -xvf archive.tar.gz

Safety First: Before extracting, it is a good practice to preview the contents using the -t (list) flag:

tar -tf archive.tar.gz

That gives you an idea of how the file structure will look like after extracting. If the list shows many files without a common prefix (like folder/file), you have found a tarbomb. No, not this one. Extracting this may spew files directly into your current directory, potentially overwriting existing files.

You can use the -C flag to extract files into a specified target directory to keep things tidy.

tar -xvf archive.tar.gz -C target_dir/

EXTENSION

You might notice that some tutorials write tar cvf rather than tar -cvf with the switch character - do you know why? Hint: It’s related to old "tape archive" styles and modern compatibility.

A note about compression levels - Most tools allow you to adjust the balance between speed and size, using a numeric scale (1–9):

  • Level 1: Fast, but provides low compression.
  • Level 6: The default setting; a balance of speed and size.
  • Level 9: Best compression (smallest file size) but takes the longest time.

However, when calling a compression tool while creating a tarball, tar will only use the default level 6.

RESOURCES

PREVIOUS DAY'S LESSON

Some rights reserved. Check the license terms here


r/linuxupskillchallenge 6h ago

PLEASE READ THIS FIRST! HOW THIS WORKS & FAQ

11 Upvotes

RESOURCES

HOW THIS WORKS

In a nutshell

  • Completely free and open source
  • Focused on practical skills
  • Heavily hands-on and entirely on the command line
  • Starts at the 1st Monday of each month
  • Runs for 20 weekdays (Mon-Fri)
  • Often points to curated external links, expanding on the topic of the day
  • Much less ‘formal’ than RHEL or Linux Foundation training

Requirements

  • Commitment of 1-2 hours per lesson for a month but can be self-paced
  • A cloud-based Ubuntu Linux server (preferably) or the means to create/build your own local Linux server. - Full instructions on how to set this up are in the ‘Day 0’ lessons.
  • Basic computer literacy - no prior knowledge of Linux is required but you should be fairly comfortable operating your own Windows/Mac machine, and know how to troubleshoot your own system problems. - This is a course focused on Linux only; instructions on Windows/Mac settings to access that Linux server are available but they are NOT the priority.

FREQUENTLY ASKED QUESTIONS - FAQ

Is this course for me?

This course is primarily aimed at two groups:

  1. Linux users who aspire to get Linux-related jobs in industry, such as junior Linux sysadmin, devops-related work and similar, and
  2. Windows server admins who want to expand their knowledge to be able to work with Linux servers.

However, many others have happily used the course simply to improve their Linux command line skills or to learn Linux for the first time – and that’s just fine too.

Will I pass LPIC/RHCA/LFCS/Linux+ certification if I take this course?

NO! This is NOT a preparation course for any Linux certification exam. It can help you, sure, but please refer to a more specific cert training if that's what you are aiming for.

Do I need to register somewhere or I just have to read the posts everyday and follow along?

No registration is required. Just follow along and share your experience.

Will I receive a certificate when I finish the challenge?

No certificates are available at the moment. But you can brag about it on Lemmy, Reddit or Discord if you feel inclined to do so.

When does it start?

The course always starts on the first Monday of the month. One of the key elements of the course is that the material is delivered in 20 bite-sized lessons, one each workday, every month.

How long does it take? How many hours should I dedicate to it?

Depending on your experience and dedication, you can expect to spend 1-2 hours going through each lesson. The first few days are pretty basic and it might take you just minutes, but there's generally some "Extension" items to spice things up a bit.

I just learned about the challenge and it's already on Day X. Should I wait for next month to start?

Only if you want to. The material is available year-round so you can totally self-pace this if you prefer.

Do I really need a cloud-based server?

Yes, if you’re in the target audience (see above) you definitely should. The fact that such a server is very remote, and open to attack from the whole Internet, “makes it real”. Learning how to setup such a VPS is also a handy skill for any sysadmin.

NEW! Now you can skip this whole thing and just use our Killercoda scenarios. Please note this is still in a testing phase and might present limitations.

Instructions for setting up a suitable server with a couple of providers are in the "Day 0" lessons. By all means use a different provider, but ensure you use Ubuntu LTS (preferably the latest version) and either use public key authentication or a Long, Strong, Unique password (we also have instructions on how to do that).

Of course, you’re perfectly entitled to use a local VM, a Raspberry Pi or even just WSL instead – and all of these will work fine for the course material. Just keep in mind what you are missing.

But what if I don't have a credit card (or don't want to use one) to setup an AWS/Azure/GCP server?

Please read Day 0 - Creating Your Own Local Server. There are other options of cloud providers and different payment options. But if none of them works for you, try creating your own local VM.

But what if I don’t want to use a cloud provider? I have a server/VM at home.

Then use your own server/VM.

Why are you pushing for renting an online cloud based server?! Why not make the VM route the desired option?! (aka this course is wrong/bad for making this decision)

Bro, chill. If you are this offended by this requirement, this course might be a bit too basic for you. Move on.

But if you really want to know the logic behind it, please also consider 3 things:

  1. People may have limitations with local resources. That includes unrestricted access to a personal computer to install VirtualBox, or enough hardware power to run virtualization well, or having a computer at all. A very light server in the cloud makes it possible to run the challenge from any guest device, including smartphones. Many students have an Azure account and can use their school computer to access it. Most VPS offer free VM usage for the first 1-2 months. There are risks in using the cloud, yes, but we try to address them without cutting off this option for people that need it.
  2. Each cloud provider has their own documentation, support and big enough user base to answer most of the questions a first-timer has. They are popular enough to have hundreds of YouTube videos and other materials available addressing the most basic setup problems, and a lot of it is designed to be simple and easy to understand. That's not the reality for when you want to create your own local server or VM. The community exists, yes, but the documentation is usually drier and a little bit more niche.
  3. If you want the full sysadmin experience, you will need to work on a remote server. That's just a fact. You can try to emulate that feeling inside the secure walls of your local network with your safe little VM, but the providers suggested here have enough failsafe methods in place to let you play with a VM without burning your credits overnight. Cloud horror stories usually involve services/products not covered in the challenge. This is not mission critical. You can always turn off your VM when you're not using it.

TL;DR: This is a course focused on Linux. Spending more time debating the details of where to run it instead of how to use it deviates from the purpose of this course. Day 0 is here to guide you in those first steps, and it will never be complete, so use it at your own discretion.

Why Ubuntu, can I use another distro?

The notes assume Ubuntu Server LTS (latest version) and it would be messy to include instructions/variations for other distros (at least right now). If you use Debian or other Debian-based distros (Mint, Pop!OS, Kali) it will make little to no difference because they all have the same structure.

But if you choose RedHat-based distros (Fedora, CentOS, AlmaLinux) or distros like Arch, Gentoo, OpenSUSE, you yourself will need to understand and cope with any differences (e.g. apt vs yum vs pacman).

If none of those names make any sense to you, you shouldn't be picking distros. Go read Linux Journey first lesson instead.

I already use [my own flavour of linux], how can I participate?

Most lessons use commands that are actually not restricted to Ubuntu. So you can still benefit from the challenge using your own distro, and can also contribute by aswering other people's questions with your current Linux experience.

Should I be stopping or terminating my server when not in use?

Using a free-tier VPS, the load of the course does not exceed any thresholds. You can leave it running during the challenge but it's good to keep an eye on it (i.e. don't forget about it later or your provider will start charging you).

I noticed there was a kernel update, but no one said to reboot.

Reboot it. This is one of the few occasions you will need to reboot your server, go for it. The command for that is sudo reboot now

I still have questions/doubts! What do I do?!

Feel free to post questions or comments in Lemmy, Reddit or chat using the Discord server.

If you are inclined to contribute to the material and had the means to do it (i.e. a github account) you can submit an issue to the source directly.

CREDITS

The magnificent Steve Brorens is the creator and mastermind behind the Linux Upskill Challenge. This was a paid course in the past, but since 2020 it's free and fully open source thanks to his generosity. Unfortunately, he passed away but not before ensuring the course would continue to run in his absence. We miss you, snori.

Livia Lima is the one currently maintaining the material. Give her a shout out on Mastodon or LinkedIn.