Skip to main content

All Questions

Tagged with
1 vote
0 answers
67 views

Bypass `-C` flag when unzipping tar archive

I have a .tar.gz archive with the following structure: opt/client/py/utils/mappings/templates/config.json opt/ opt/mag/ opt/mag/sw/ opt/mag/sw/apps/ opt/mag/sw/apps/service/ opt/mag/etc/ opt/mag/etc/...
cristid9's user avatar
  • 111
1 vote
2 answers
391 views

Archive directory structure without file contents

I would like to create an archive capturing the entire structure of a directory, including subdirectories and files. Preferably preserving file attributes such as modification time. The archive ...
Mifeet's user avatar
  • 180
45 votes
1 answer
194k views

Extracting a tar.gz file returns, “This does not look like a tar archive.”

I have a tar.gz file and I want to extract it using terminal. I used following commands: tar tvzf ldtp_3.5.0.orig.tar.gz and tar -xvzf ldtp_3.5.0.orig.tar.gz. However, I get the same result for both ...
TheRookierLearner's user avatar
220 votes
18 answers
52k views

What is the advantage of using 'tar' today?

I know that tar was made for tape archives back in the day, but today we have archive file formats that both aggregate files and perform compression within the same logical file format. Questions: ...
MarcusJ's user avatar
  • 2,125
1 vote
1 answer
2k views

Find a list of files from text file in subdirectories and put into tarball?

I have a list of files I need to tar. Typically, I would use tar -cvf allfiles.tar -T mylist.txt But I discovered that the files I need are scattered into subdirectories and my list only has the ...
Steve's user avatar
  • 527
24 votes
2 answers
7k views

Linux: Specifying top level-directory when creating zip archive

I have project with the usual directory structure (src/, bin/, ...), i.e project-name/ |-- bin |-- lib |-- src `-- Makefile And would like to create an archive with the following directory structure:...
leden's user avatar
  • 786
0 votes
1 answer
291 views

Modifying the path inside an archive for extraction

I would like to change the path of extraction of a .tar.gz archive. The files are supposed to extract as ./1/2/3/4/files, ./1/2/3files and so on. The .1/2 part of those is common to all the files. ...
R.J.'s user avatar
  • 445
77 votes
6 answers
200k views

How do I password protect a .tgz file with tar in Unix?

I'm using the Unix tar command as follows to tar up a directory and its files: tar cvzf fileToTar.tgz directoryToTar Is there a way to password protect the .tgz file? I've created password-...
c12's user avatar
  • 871
1 vote
1 answer
205 views

Ignoring path while archiving with TAR

I have a file that contain list of files I want to archive with tar. Let's call it mylist.txt It contains: /path1/path2/file1.txt /path1/path2/file3.txt ... /path1/path2/file10.txt What I want to ...
neversaint's user avatar
5 votes
3 answers
397 views

Unix/Linux program that can handle all popular compression/archiving formats (e.g.tar, gzip, bzip2, zip)? [closed]

I sometimes get confused by the varying command line options I need to run common Unix archiving and compression software (e.g. gzip, bzip2, zip, tar). Is there a program out there that can just Do ...
Anirvan's user avatar
  • 301
9 votes
3 answers
43k views

Howto unzip ".xz" file with 7z and lzma

I tried to uncompressed a "*.xz" file with both 7z and lzma. But they gave me such message: $ 7z x myfile.fq.xz 7-Zip 4.57 Copyright (c) 1999-2007 Igor Pavlov 2007-12-06 p7zip Version 4.57 (...
neversaint's user avatar
44 votes
5 answers
83k views

tar – extract discarding directory structure

unzip has a nifty option -j, whereby the directory structure of the archive is discarded, and all files are extracted into the same directory. Is there a way of making tar work in the same way? ...
Benji XVI's user avatar
  • 543
15 votes
5 answers
6k views

Map "untar" to tar xvfz?

How can I map 'untar' as a command to 'tar -xvfz' ? Sorry, but I almost always forget the arguments necessary to 'tar' for this operation.
meder omuraliev's user avatar