Part 2. Simple pipeline (5 points)

For several subsequent parts of this lab, you’re going to need to run the scripts you write on a large code base. We’re going to use the source code for the Linux kernel. You’re going to write a one-line shell script that downloads and decompresses the source code.

Your task

Write a one-line script that will uses curl to download the compressed Linux source code and pipes it to tar which extracts the source code into the current directory. The Linux source code is available at this URL.

Your command should be structured as follow.

$ curl ARGS | tar ARGS

After you run the command, you should have a new directory named linux-6.4 which contains the source code to version 6.4 of Linux. Do not commit the Linux source code to your assignment repository.

Write the pipeline command you come up with in a file named README. Normally, a README provides information about a project. GitHub will display the contents of your README when you visit the web page for your repository (after you have pushed the README to GitHub). You’ll use this same file several times to record the commands you come up with.


  1. If you run curl with no other options, no output is printed. That’s because GitHub, like many websites will redirect the browser to different URLs. The way this works technically is to use a redirection HTTP status with a Location header. Search the curl man page to figure out which option to use to get curl to follow the redirection specified in the Location header.
  2. The tar command, like many (but sadly not all) command-line utilities that operates on files, will accept a single - as the name of the file to mean read from stdin rather than reading from the file (and for output, write to stdout rather than writing to a file).