a utility to archive files into a sequential stream, then commonly placed into one file on disk (previously tapes, hence the name, Tape ARchive)
Questions tagged [tar]
562 questions
940
votes
5 answers
How to extract files to another directory using 'tar' command?
I thought tar archive.tar /users/mylocation would work, but it doesn't. How can I do that?

shawnxuc
- 9,503
56
votes
1 answer
How to extract .tar.bz2?
I'm downloading an engine game file which is compressed as .tar.bz2.
I'm trying this command
tar -zxvf enginsxt.tar.bz2
And it throws an error. I know that command
tar -zxvf
is only for extracting .tar.gz files, but how can I decompress this one?

WapDL
- 571
44
votes
4 answers
How can I update a tar.gz file?
I have created a tar.gz file (using the GUI, not the command line). How can I update it with a command that new files are added and modified files are updated, too?

xpanta
- 1,491
24
votes
4 answers
How do I use tar to exclude all files of a certain directory?
A client uploads files to a development server. When it's time to upload the project to a production server, those files are no longer needed, and we'd like to exclude them from the tar file we'll eventually push to production. However, we still…

user658182
- 583
18
votes
4 answers
What are the different arguments passed to tar command?
What is the purpose of -xvzf arguments when we untar any tarBall file and what are the other arguments passed over the command?
I found it mentioned in many books but can't find anything.

Suet
- 199
16
votes
2 answers
Is there a way to `tar` extract without clobbering
Is there a way to tar extract without clobbering?
I am installing 12.04 and want to restore my data from 10.10. Anything 12.04 specific I would like to keep, that is I do not want the tar'd 10.10 version to be extracted. If I do a general restore…

H2ONaCl
- 9,693
12
votes
1 answer
"Cannot open: No such file or directory" when extracting a tar file
I am trying to install Apache Cassandra that is a tar.gz file. The following is the output I am getting.
1st instance:
tar -zxvf apache-cassandra-2.0.3-bin.tar.gz
tar (child): apache-cassandra-2.0.3-bin.tar.gz: Cannot open: No such file or…

user296543
- 129
- 1
- 1
- 3
9
votes
2 answers
Can I safely remove a tar archive after extracting it?
Or am I supposed to save them for some reason?

Manny
- 91
6
votes
2 answers
why does tar . see hidden files but ls . does not?
Why does tar cvpfz /tmp/backup.tgz . backup hidden files?
(Note ls . does not see the hidden files. Trivia: there are ways to see hidden files such as with ls -a but this is just trivia. The question pertains to a difference in the behaviour…

H2ONaCl
- 9,693
5
votes
3 answers
Compressed (by tar gzip) size is far larger than the original folder
I took backup of the folder /var/www with the tar command (including -z (gzip)):
tar -cvzf file.gz /var/www/*
I checked the size of www. It is around 100kb, but the size of the file produced by tar is around 185Mb. What could cause this?

janasaiarun
- 192
5
votes
2 answers
sudo tar cvpzf exiting with failure due to previous error
I looked at the other question addressing this issue but I think I might have a different setup.
I too am trying to backup my Ubuntu machine, but here is the difference. I used Wubi to install Ubuntu 11.10 alongside Vista on my laptop. I have spent…

railguage48
- 399
5
votes
1 answer
Why does Tar preserve the original files' permissions even when not passing the `-p`, `--preserve-permissions` or `--same-permissions` switch?
From man 1 tar:
[...]
-p, --preserve-permissions, --same-permissions
extract information about file permissions (default for superuser)
[...]
--no-same-permissions
apply the user's umask when extracting permissions…

kos
- 35,891
4
votes
1 answer
What does .tar-1 in a filename obtained by gunzip a tar.gz mean?
I downloaded a zipped tar-file filename.tar.gz and after converting it with the gunzip command it is now named filename.tar-1. What does the -1 mean?

hoppfrog
- 41
4
votes
4 answers
Cannot extract amdgpu tar.xz
I'm running Ubuntu 17.10, and I can not extract a certain tar file. When trying to extract the file, I get the following message:
There was an error while extracting”amdgpu-pro-17.40-492261.tar.xz”
“Not an archive”
Any help would be appreciated.

user758623
- 41
4
votes
1 answer
tar: Removing leading `../' from member names
I am testing out the functionality of tar by compressing and extracting directories as follows:
cd test
mkdir Documents
mkdir foo
cd foo
sudo tar cf - ../Documents | tar xf -
The last command gives me the following error:
tar: Removing…

Abundance
- 227