Questions tagged [tar]
a utility to archive files into a sequential stream, then commonly placed into one file on disk (previously tapes, hence the name, Tape ARchive)
562
questions
9
votes
2
answers
4k
views
Extract only the contents of an archived directory from within an archive
The Situation
I am extracting a CMS from drupal-7.15.tar.gz to /var/www.
When extracted normally (with tar -xvzf filename.tar.gz) the files end up in /var/www/drupal-7.15/
The Goal
I want the ...
9
votes
1
answer
16k
views
my tar command line is not working it won't unzip files
when I try using tar -xvj [file name] then hit enter it just hangs and does not unzip file.. I've tried zipping just a really small text file and it zipped into a .tar.bz file then when I tried to ...
9
votes
2
answers
8k
views
Can I safely remove a tar archive after extracting it?
Or am I supposed to save them for some reason?
9
votes
2
answers
29k
views
tar Exiting with failure status due to previous errors
I am trying to backup my Ubuntu workstation by the help of this guide and are running into trouble as the tar command outputs
Exiting with failure status due to previous errors.
Here's what I ran ...
8
votes
3
answers
11k
views
How to install qpdfview 0.4.14?
I have been using the 0.4.12 build for a couple of months now and am ready to update to 0.4.14. I've tried a couple of things to install it but for fear of screwing up my Trusty environment I thought ...
8
votes
1
answer
57k
views
Help with installing the Chrome web browser (22.04.2 LTS)
I have just installed Ubuntu 22.04.2 LTS on my computer a few hours ago. For a few days, I tried to do an install so I could dual boot between Ubuntu & Windows 10. But I had failure after failure,...
8
votes
2
answers
4k
views
How to archive with ignoring files larger than 100MB
I'm trying to archive files with tar and ignoring files larger than 100MB. Is that possible?
PS: Not have to use tar.
8
votes
2
answers
37k
views
should i install the .deb or .tar.gz? [duplicate]
Please pardon the elementary question.
I'm going through this tutorial.
I would like to install hadoop on vm ubuntu 64 bit.
I would like to know whether I should be downloading the .deb file or ...
8
votes
1
answer
41k
views
How to install a tar.bz2 package
How can I install a tarbz2 package. Example: I have downloaded firefox 8 tar.bz2 . I want to know a general method for installation of tar.bz2 package.
7
votes
2
answers
15k
views
How to create a zip file from contents of a folder with certain name pattern?
is it possible to create a tar.gz file from contents of a folder but only put the files with certain name pattern in the archive and ignore the rest? for example just put the files which their names ...
7
votes
4
answers
63k
views
How to untar a .tar.xz file [duplicate]
I tried to run:
tar -zxvf name.tar.xz
but all I got was:
tar: Child returned status 2
tar: Error is not recoverable: exiting now
7
votes
2
answers
4k
views
Why does gzip on tar output always produce different results?
What I expect from two commands which always produce the same output on their own, is them to always produce the same output when put in a pipeline, but apparently this is not the case for tar | gzip:
...
7
votes
1
answer
35k
views
I am trying to install a compressed package ending in .tar.gz and I am getting an error saying that it is not in the right format,
I am new to Ubuntu and after doing some research I still can't figure what I am doing wrong. I am downloading the a package ending in .tar.gz,then I when I try to use:
tar -xvf matlab_r2011b.tar.gz
...
6
votes
3
answers
11k
views
Why I get "tar: Cowardly refusing to create an empty archive"? when trying to backup the whole server
I am new at ubuntu and dealing with servers. I use Ubuntu 16.04 x64. I want to have a backup for my entire system, So I followed this video https://www.youtube.com/watch?v=KTayZIou-1M
I type this ...
6
votes
3
answers
26k
views
Why compressed directories cannot be extracted in /opt?
I am not able to uncompress a file with .tar.gz extension
Did
sudo tar -xvzf ~/Downloads/file.tar.gz /opt/ but no success.
it says:
tar: /opt: Not found in archive
tar: Exiting with failure status ...
6
votes
3
answers
6k
views
How do I extract a tarball, skipping some of the leading directories?
I am archiving a folder using following command:
tar jcf "home/username/forum/forum.tar.bz2" /var/www/forum/
Then I am extracting using :
tar jxf forum.tar.bz2 ./
It extracts correctly, but ...
6
votes
3
answers
4k
views
What's the difference between a compressed folder (with files) and a compressed Tar archive?
I don't understand the use of TAR. My understanding is it pulls together many files into one file. But doesn't putting files in a folder do this?
Using ZIP, I put files I want to archive in a folder ...
6
votes
2
answers
16k
views
Using tar to only backup specific folders
I only want to backup the following folders with my tar command:
/var/www
/home/myuser/importantFiles
/home/myuser/anotherFolder
And I want these folders to be backed up in the very same .tar.gz ...
6
votes
2
answers
11k
views
How to suppress tar error messages in when piping
For example:
I extract a tar.bz2 file with tar -xvf instead of tar -xjvf:
tar -xvf file.tar.bz2
tar: invalid tar magic
and if redirect stderr
tar -xvf file.tar.bz2 2>/dev/null
it works.
Now ...
6
votes
2
answers
6k
views
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 ...
6
votes
3
answers
5k
views
Unable to tar a .tgz file
I have a .tgz file and I'm running tar -xfvz cudnn-9.0-linux-x64-v7.tgz but that I get the following error:
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable:...
6
votes
2
answers
48k
views
Error "Cannot utime: Operation not supported" when restoring a tar archive on an android device
I replaced the MicroSD card in my mobile (Samsung Galaxy S4 Mini running CyanogenMod 11 with encryption) with a bigger one.
Before I pulled the old one out I backed up its content into a tar file:
/...
6
votes
2
answers
239
views
What is going on with my TAR script?
This might do better at StackExchange but I use Ubuntu as my file server.
So I'm trying to use tar and gzip to only backup the last 6 months of changes on my file server and it isn't working. It ...
6
votes
1
answer
13k
views
Problem extracting tar.gz files: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
Recently I encountered a problem while trying to install Quantum Espresso 5.2.0, a Linux-based software, in Ubuntu 14.04. The source was a compressed tar.gz file. I typed the following command to ...
6
votes
1
answer
34k
views
How to download a .tar.gz file from a redirected link in terminal?
I want to download the file at http://www.snort.org/downloads/1806 as a .tar.gz file using terminal but the problem is that when I use:
sudo wget http://www.snort.org/downloads/1806
It downloads a ...
6
votes
2
answers
24k
views
How can I make tar read input from stdin?
I need to use tar in a pipeline inside a shell script to archive and compress some files.
After having read the manpage for tar I was able to make tar output to stdout by running it along with the -O ...
6
votes
1
answer
14k
views
Attempting to install PHP 5.6 on Ubuntu 14.04 [duplicate]
I am attempting to install PHP 5.6 on Ubuntu 14.04. I have tried a whole raft of different things and none of them work. To start with I have tried to download via this repo:
sudo add-apt-repository ...
5
votes
3
answers
8k
views
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 ...
5
votes
1
answer
44k
views
tar -cvfz command results in error message unless I omit the hyphen before 'cvfz' [duplicate]
Possible Duplicate:
sudo tar cvpzf exiting with failure due to previous error
When I run the command
tar -cvfz backup.tar.gz somedirectory
I get the following sterr
tar: Exiting with failure ...
5
votes
3
answers
18k
views
How do I get a file size(original file size) within .tar.gz without uncompress it?
I make myfile.txt to zip file with below command, is there a way to get original file size 'myfile.txt' without unzipping it.
tar -czf myfile.tar.gz myfile.txt
5
votes
4
answers
1k
views
Which kind of installation files should you prefer - .deb or tarball files? And why?
I have just starting Ubuntu as my primary OS and everytime I have to install something I generally try to find .deb files as that seems convenient, but someone on another forum told me I should always ...
5
votes
2
answers
24k
views
Unable to extract .tar.xz files [duplicate]
I am new to Linux and I am trying to install AMD drivers on my system. For this I downloaded the file from AMD website. It is called amdgpu-pro-17.30-465504.tar.xz. In the website it says that I have ...
5
votes
2
answers
5k
views
Click to "Extract here" possible?
For my work I constantly need to unzip zip-archives. I know I can right-click and select "Extract here", but since I do this a lot, this is becoming annoying.
Is there a way to set the default ...
5
votes
2
answers
12k
views
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 ...
5
votes
2
answers
3k
views
Confusion between archiving and compressing?
I am confused about archiving and compression and I am going to write what I think is correct.
Here are the commands that I wish to get a better understanding of:
tar –c file > file.tar
tar –cf ...
5
votes
3
answers
1k
views
How do I programatically get the file or directory name after extracting after a tar archive?
I have a process in my Dockerfile with the follow steps:
Download the tar file using wget.
untar the file.
Perform some operation with the file . In this case, move content to another place.
The ...
5
votes
1
answer
2k
views
How do I compress a folder while preserving file ownership
I have a docker server I want to backup. My deployment folder has very specific ownership and permissions to support my containers:
$ ls -lhaF /opt/docker
total 32K
drwxr-xr-x 7 devops devops 4.0K ...
5
votes
1
answer
9k
views
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
...
5
votes
1
answer
76
views
How can I build an installer by tracking filesystem changes?
Ages ago I used to package software on Windows using InstallShield AdminStudio. I used it for building customized installers for company applications from existing app installers. I'd like to do ...
5
votes
3
answers
1k
views
How do I install the Sun Java Development Kit (JDK 7)?
How to install JDK 7 on Ubuntu?
The installation should be with the tar archive.
I know the basic installation with the bin, but how to do with only a tar archive?
4
votes
2
answers
7k
views
How to make a bash script generate a new filename every time it's run?
I'd like to make a .tar file of a particular directory every day of the week. The way I'd like to do it is with a bash script making a tar file every day with crontab.
I was wondering, is there a ...
4
votes
2
answers
1k
views
How can I extract files in the directory where they're located with the find command?
I have tried to extract multiple files from the directory where they're located with:
for i in $(find . -name '*.tgz'); do # search the tgz files and extract them
tar -xvzf $i
done
I expected ...
4
votes
2
answers
2k
views
how would I create a tar without using sudo?
If I tar my /home/username and create the .tar file in /home/username, then I get an error of the sort . file changed as we read it probably because the directory file itself is changing due to the ...
4
votes
2
answers
242
views
tar using short form option versus old style
In the GNU manual for tar, there is the following example to show that the order of the options is important:
tar -cfv collection.tar blues folk jazz
In this case, because v is placed after f, then ...
4
votes
4
answers
5k
views
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”
“...
4
votes
3
answers
627
views
How do you efficiently/correctly extract data from a tarball into a new Ubuntu distribution?
I am updating my Ubuntu distribution from 18.04 to 22.04. I exported the Ubuntu 18.04 instance with wsl --export Ubuntu-18.04 <file.tar> to a tarball and am trying to figure out how to ...
4
votes
3
answers
8k
views
Trying to unzip a tgz in WSL but get ELF not found error
I would like to unzip a .tgz file, but I get an ELF not found error. I am using Windows 10 and Ubuntu 22.04 in WSL.
Here is a screenshot of the error:
4
votes
3
answers
3k
views
Creating tar fills system cache
My situation is pretty simple: I backup-ed some of my documents and put them on a NAS and since I rather transfer one big file instead of million small ones, I created a tar
tar cf backup/2013-07-12-...
4
votes
1
answer
2k
views
Can't extract and mount a gzip compressed partition image
I needed to compress a partition of an SSD drive on a machine with less free space than the said partition. I searched, found and executed the following command:
root@host1:~/# dd if=/dev/sdd1 | gzip ...
4
votes
2
answers
13k
views
tar file bigger than original folder?
I used "Compress" from Nautilus to a 36MB folder. It created a tar called fs.tar.gz.
This fs.tar.gz has the size of 98MB.
How can this be possible?
I did read somewhere that symlinks or something ...