tar xJf myarchive.tar.xz
I’ve drawn that railroad-style infographic so you can have all in one page the basic options to use the tar command.
Just start at the top of the page with the tar command, and follow the tracks, choosing the option you need at each intersection. For example:
To extract (all files of) the Tar archive myarchive.tar.xz you will write:
tar xJf myarchive.tar.xz
To create a new uncompressed Tar archive of your Documents forlder, you will write:
tar cf myarchive.tar Documents
To test if the gzip compressed archive myarchive.tgz contains a file named Documents/myfile, you will write:
tar tzf myarchive.tgz Documents/myfile
Click the button bellow to obtain a link to the high quality PDF so you can access this cheatsheet from all your devices freely.