I have a tarfile which has the following structure:
- dir1
-- file
- dir2
- dir3
If I try running tar -xf tarfile.tar.gz dir1/file
, dir1 containing the file will be created. I would like instead to just get the file without the directory in between. I could move the file and delete the directory, but I was wondering if the tar command offers support for doing that directly.
I am using Alpine Linux.
tar
support the--strip-components
option?