It is possible to extract a tar file without the first directory by using the — strip-components flag. This can be useful when downloading a tar file from the Internet; for example, the Adopt OpenJDK tar file contains the following directory tree structure:
The jdk8u345-b01 directory contains everything. If you wish to extract this tar file without the jdk8u345-b01 folder, you can use the “ — strip-components=1” option to skip the first directory.
This will extract all files and subdirectories without the container folder.
Sweet, right?