Linux Tutorial Series

Linux Tutorial Series – 127 – The tar command

Here is the video version, if you prefer it:

The tar command is used to create an archive of files or to extract files from an already existing archive of files. (Ward, 2014) To create an archive of files, use the following syntax:

tar cvf archiveName.tar file1 file2 …

cvf mean the following – c enters the create mode (telling tar to create a new archive), v is the flag for verbose output (so you know what is happening) and f means that the next argument will be the name of the to-be-constructed archive.

⁠To extract files from an already existing archive, use the following syntax:

tar xvf archiveName.tar

v and f mean the same things as I explained above, but x is the extract mode, telling tar to extract the archive provided as the argument.

Memorize these two commands by heart. That’s what I did.

When extracting files, it is always a good idea to extract them in a newly created folder. That way, if the extracted files make a mess, you can always move that folder to the location you want to (or delete it). There are options in tar to check the archives contents, but I haven’t used them – I used the method of extracting the archive in a new folder.

Hope you learned something useful!


Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Page 37