Extract specific directories with all subdirectories from a tar file
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I know how to extract single file from a tarball, although now I have 500 GB tar
file without any compression, just a plain tar
and I would like to extract specifically 3 directories, with such structure:
dir1/subDir1/
dir2/subDir2/
dir3/subDir3/subSubDir3/
There are many subdirectories inside each of those and real many files. I wish to simply extract everything inside of those.
I am curious as to how to do this, without having to extract the whole tarball.
tar
add a comment |Â
up vote
0
down vote
favorite
I know how to extract single file from a tarball, although now I have 500 GB tar
file without any compression, just a plain tar
and I would like to extract specifically 3 directories, with such structure:
dir1/subDir1/
dir2/subDir2/
dir3/subDir3/subSubDir3/
There are many subdirectories inside each of those and real many files. I wish to simply extract everything inside of those.
I am curious as to how to do this, without having to extract the whole tarball.
tar
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I know how to extract single file from a tarball, although now I have 500 GB tar
file without any compression, just a plain tar
and I would like to extract specifically 3 directories, with such structure:
dir1/subDir1/
dir2/subDir2/
dir3/subDir3/subSubDir3/
There are many subdirectories inside each of those and real many files. I wish to simply extract everything inside of those.
I am curious as to how to do this, without having to extract the whole tarball.
tar
I know how to extract single file from a tarball, although now I have 500 GB tar
file without any compression, just a plain tar
and I would like to extract specifically 3 directories, with such structure:
dir1/subDir1/
dir2/subDir2/
dir3/subDir3/subSubDir3/
There are many subdirectories inside each of those and real many files. I wish to simply extract everything inside of those.
I am curious as to how to do this, without having to extract the whole tarball.
tar
asked Oct 14 '17 at 11:36
Vlastimil
6,4761148121
6,4761148121
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
tar
extracts directories like files, see the man page
for more info.
# -v; verbose parameter is rather obstructive
# in case of thousands and thousands of files
tar -xf archive.tar directory/
add a comment |Â
up vote
1
down vote
You can use the --strip-components=n
option.
tar -xvf archive.tar --strip-components=4
--strip-components=NUMBER
strip NUMBER leading components from file names on extraction
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
tar
extracts directories like files, see the man page
for more info.
# -v; verbose parameter is rather obstructive
# in case of thousands and thousands of files
tar -xf archive.tar directory/
add a comment |Â
up vote
3
down vote
accepted
tar
extracts directories like files, see the man page
for more info.
# -v; verbose parameter is rather obstructive
# in case of thousands and thousands of files
tar -xf archive.tar directory/
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
tar
extracts directories like files, see the man page
for more info.
# -v; verbose parameter is rather obstructive
# in case of thousands and thousands of files
tar -xf archive.tar directory/
tar
extracts directories like files, see the man page
for more info.
# -v; verbose parameter is rather obstructive
# in case of thousands and thousands of files
tar -xf archive.tar directory/
edited Oct 14 '17 at 21:52
Hunter.S.Thompson
4,56431334
4,56431334
answered Oct 14 '17 at 12:28
jdwolf
2,392116
2,392116
add a comment |Â
add a comment |Â
up vote
1
down vote
You can use the --strip-components=n
option.
tar -xvf archive.tar --strip-components=4
--strip-components=NUMBER
strip NUMBER leading components from file names on extraction
add a comment |Â
up vote
1
down vote
You can use the --strip-components=n
option.
tar -xvf archive.tar --strip-components=4
--strip-components=NUMBER
strip NUMBER leading components from file names on extraction
add a comment |Â
up vote
1
down vote
up vote
1
down vote
You can use the --strip-components=n
option.
tar -xvf archive.tar --strip-components=4
--strip-components=NUMBER
strip NUMBER leading components from file names on extraction
You can use the --strip-components=n
option.
tar -xvf archive.tar --strip-components=4
--strip-components=NUMBER
strip NUMBER leading components from file names on extraction
answered Oct 14 '17 at 12:51
Hunter.S.Thompson
4,56431334
4,56431334
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f398095%2fextract-specific-directories-with-all-subdirectories-from-a-tar-file%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password