On Linux systems, including Ubuntu the tar command creates, maintains, and extracts files that are archived in tar format. “Tar” stands for tape archive. If you’re a student or new user looking for a Linux system to start learning on, the easiest place to start is Ubuntu Linux OS. It’s a great Linux operating system for beginners. Ubuntu is an open-source Linux operating system that runs on desktops, laptops, servers, and other devices. About tar command: On Linux systems, including Ubuntu the tar command creates, maintains, and extracts files that are archived in tar format. “Tar” stands for tape archive. It is one of the many archiving file formats available. Syntax: The syntax is the rule and format of how the tar command can be used. These syntax options can be reordered, but a straight format must be followed.,. Below is an example syntax of how to use the tar command. Options: The command line options are switches or flags that determined how the commands are executed or controlled. they modify the behavior of the commands. they are separated by spaces and followed after the commands. Below are some options for the tar command: Examples: Below are some examples of how to run and use the tar on Ubuntu Linux. Simply run the tar command to invoke it. To extract a tar archive file compressed with the bz2 compression algorithm, you run the command below: The command above will extract the archive file into the current working directory. The -j option tells tar that the file is compressed with bzip2. A file is compressed with .tar.bz2 and you run the tar command without a decompression option, the command will error out and tells you to use the -j option for it to be successful. If you wish to extract the above-archived file into a specific directory, you run the commands below: The command above will extract the archive file into /home/myaccount/public directory or folder. If you want to list the content of an archived file compressed with tar.bz2, you use the -t or –list command options. That should list the content of the archive. Remember to always use the -f option to tell the command you’re working with a file archive. When you run su with the –help option, you’ll see the help text below: That’s it! Congratulations! You’ve learned how to use the tar command to extract archived compressed with .tar.bz2 or .tar.bzip2 on Ubuntu. You may also like the commands below: