The tar archive format and/or the command-line utility for working with tar files.

learn more… | top users | synonyms

4
votes
1answer
1k views

“invalid tar magic” on OpenWRT

I'm trying to install JavaSE on a OpenWrt (Pandorabox) device. When I run tar -xvf ejdk-8u65-linux-arm-sflt.tar.gz I get tar: invalid tar magic. How can I solve this problem?
1
vote
2answers
60 views

Can I download tar.gz file while it is being compressed?

I am compressing a huge directory which could be more than 10 GB, It takes time to compress it. But at the same time, I have to download this to another new server. So while the compressing is going ...
3
votes
1answer
62 views

Rsync contents of tar with remote server

I've got a number of backups as tar archives, and to do checking/testing of them I restore to some test machines using: cat archive.tar.gz | ssh server2 "cd /path/to/dir; tar zxvf -" Most of the ...
0
votes
0answers
33 views

Unix -untar files only looping one time - C-shell

I have list of *.tar.gz files that I want to unzip and untar at once. The code: foreach summ (`ls *.tar.gz`) gunzip -d < $summ | tar xf - end But only one file has been untarred. How would ...
0
votes
1answer
49 views

Thunar custom action: Extraction to subdirectories

I am attempting to create a Custom Action in Thunar (File Manager) that will extract a gzip archive into a subdirectory of the same name (e.g. abc.tar.gz to abc/). I created this command, which works, ...
0
votes
1answer
42 views

how to make TAR of selected files in directories

I have below paths in my system /a/b/z /c/d/ /e/f/z /y/g/ In "z" directory there are some files i just want to make tar of that files without going into directory .
1
vote
0answers
44 views

Archive for root file system with quick random access

I need file archive format with the following features It is compressed (not plain tar or iso). It can backup (and restore) linux root file system keeping owners, symlinks, sparse files, devices, ...
2
votes
1answer
217 views

passing variables from 'ls' to 'tar' via 'xargs'

I am trying to do something like ls -t | head -n 3 | xargs -I {} tar -cf t.tar {} to archive the 3 last modified files but it ends up running the tar command separately for each of the files and at ...
0
votes
1answer
35 views

How to recover a node/content from a tarfile that's been overwritten

Disclaimer: I'm not very good at writing questions, and mine is a very specific scenario. So I'm just going to jump straight into the situation: I was browsing my filesystem, and somehow managed to ...
0
votes
1answer
43 views

filename.gz installation on AIX

I use sudo tar xvzf forwarder.tar -C /opt/ on Linux and this works perfectly then I proceed with a . /splunk start to install a forwarder file. While in AIX, its forwarder is in .gz format and ...
0
votes
1answer
376 views

why would you tar a zip file

I see here that a tar is used to merge several files into one. So why do I see so often one zip file in a tar? example : archive.zip.tar
0
votes
2answers
77 views

Tar big files in different directories

I have ~20 files, each about 10 GB in size, in different folders that I need to compress into a single tar. It is not practical to copy them all to one location. More precisely, the files are ...
2
votes
2answers
108 views

How can I check if a directory contains the same files of a TAR archive?

Let's say I have a folder Documents and a TAR file Documents.tar, how to check if the tar file contains the same files that are present in the directory? The more obvious solution to me would be to ...
33
votes
4answers
2k views

How to untar safely, without polluting the current directory in case of a tarbomb?

Respectable projects release tar archives that contain a single directory, for instance zyrgus-3.18.tar.gz contains a zyrgus-3.18 folder which in turn contains src, build, dist, etc. But some punk ...
3
votes
3answers
518 views

How do I pipe the output of tar through mv?

A previous question of mine asked how to pipe downloaded files through tar, now I would like to know how to pipe the output of tar through mv. See I have this command at the moment: wget -c ...
1
vote
1answer
170 views

How to convert tar.bz2 to .bz2?

I have a file with compression tar.bz2 , I would like to convert it to .bz2 . Is there a command that does this in one shot? I tried the below but no joy ! tar -xvjf US.tar.bz2 US bzip2: ...
1
vote
1answer
108 views

Incremental backup script (shared hosting)

Please consider I'm not sys admin so I have only limited experience with the tools involved, I know there are similar question but I cannot find anything that suit my needs. In a similar question ...
1
vote
2answers
165 views

How do I pipe the files downloaded with wget through tar?

I would like to pipe tarballs (.tar.gz files in this case) I download with GNU Wget (wget) through tar -xzf (to decompress them, if this is unclear) but I don't know how. I have tried: wget -q -O- ...
15
votes
2answers
624 views

Does parameter order matter with tar? [duplicate]

I am learning Linux. I was surprised to see that the parameter order seems to matter when making a tarball. tar -cfvz casual.tar.gz snapback.txt bucket.txt gives the error: tar: casual.tar.gz: ...
0
votes
1answer
79 views

Encrypting existing tar.gz archive

I know of a method to encrypt a tar.gz archive while creating it (not sure if it's a recommend one): tar -czvf /path/to/save/archive.tar.gz -C /path/to/archive . | openssl des3 -salt -k #PASSWORD# | ...
0
votes
0answers
48 views

repack of fix tar file (containing files with similar name) with unexpected EOF

I have tar file, which is a backup from my Android 5.0 phone. The issue is that I get an unexpected EOF error. I wish to repack it. There are also several files with the same name (but different size ...
4
votes
2answers
63 views

Resumable archive

I've a need to archive some big directory structures on an NFS server. They're not likely to be needed particularly soon, if ever - they're just being retained for policy reasons. To this end, I'm ...
1
vote
2answers
46 views

Is it necessary to transfer `tar` files through `rsync` in archive mode?

I have a bunch of tar files in my machine which I want to transfer to an external hard drive (EHD); they where created preserving permissions (using the -p flag). I plan to use rsync to copy them to ...
1
vote
1answer
34 views

`sudo tar` but own the resulting file

I want to put a bunch of files into an archive with tar. However, I don't have permission to access all of them, so I have to do sudo tar. However, now that root has run the tar, the resulting ...
2
votes
0answers
78 views

Backup using find and ssh to off-site server

I'm sure this has been been answered in bits and pieces on many sites, but somehow I can't seem to get this (as a whole) to work reliably. Scenario: I have a server that I would like to do ...
0
votes
2answers
51 views

I am trying for a tar call and getting the below error

I am trying to use tar and get the following error: $ tar --strip-components=1 xf /data/rvm-latest.tar.gz  tar: You must specify one of the `-Acdtrux' or `--test-label' options Try `tar --help' or ...
-1
votes
1answer
67 views

Linux backup a folder by each

I have a folder /home/software, with some sub folders /home/software/game /home/software/photo /home/software/ebook ... I want to create tar backup including the date for each sub-folder so I will ...
0
votes
1answer
47 views

How to recover a .tar backup

I've a .tar backup, when I try to extract using below command. tar -xvf backup.tar Nothing is extracting and no errors or warning Seems like its corrupted. Is there any way to recover the .tar ...
0
votes
1answer
346 views

bash: /usr/bin/find: Argument list too long

I have too many files in a folder. I just want my inodes to be get free as soon as possible,So I have tried with find ./EcoBackup/* -name '*.*' > FilesBackupName.txt bash: /usr/bin/find: Argument ...
1
vote
2answers
48 views

Remove Specific File From Tar Archival Process After the Process Starts

When tar-ing up large directories (ie. a home folder for a backup/OS reinstall), it is often okay to exclude certain large files such as multi-GB videos. However, due to the all-encompassing nature of ...
4
votes
2answers
50 views

Tar is currently reading a 2GB file, and I deleted its only link. How do I stop it from running for an eternity?

Some more information: I was backing up a large directory with tar, only there were a couple of large files there that I didn't expect. This connection is over the network and very slow, so simply ...
0
votes
1answer
47 views

Tar archive list in a bash script

I have a function bound to an alias for easy listing of archives. function list-tar-archive { if [ "X$1" != 'X' ]; then out=tar -tf $1 | awk -F/ '{if (NF<3) print }' echo ${out} fi } ...
0
votes
1answer
95 views

change tape on the fly script

I have to write 17 Tb to tape: ssh some_host 'tar -cz /' | dd bs=20b of=/dev/tape of course 17 Tb doesn't fit to one tape so I need automatically change it when "no room" error occurs. I have ...
0
votes
0answers
21 views

Extract tar archive ignoring the Archive file name in single command [duplicate]

I would like to extract a tar file archive.tar.gz into a directory /Users/guest/data without the creation of the archive directory in the data directory tar -xvf archive.tar.gz -C /Users/guest/data ...
16
votes
4answers
2k views

tar and its key letters: is it a bug or feature?

I am wondering to ask the difference of these two commands (i.e. only the order of their options are different): tar -zxvf foo.tar.gz tar -zfxv foo.tar.gz The first one ran perfectly but the ...
0
votes
3answers
353 views

shell script to backup files in a specified directory

tar -czvf /var/local/mybackup.tar.gz -C /etc/alternatives/ I used the above mentioned code to create a backup file. But it is showing me this error. tar: Cowardly refusing to create an empty ...
4
votes
2answers
74 views

How to untar a file skipping the beginning of the directory structure?

I created tar archives with an absolute path to save the files. /home/mydir/dir1/dir2/dir3/file1.dat /home/mydir/dir1/dir2/dir3/file2.dat /home/mydir/dir1/dir2/dir3/file3.dat I would like to untar ...
-1
votes
2answers
364 views

take tar and copy to remote server and extract that tar

I want to take tar from a logged in shell and take that tar file to a remote host and then extract the tar file over there. I've got below command but the tar itself is not creating. time=`date` ...
5
votes
1answer
492 views

Untar filenames in a character encoding different from encoding used in the filesystem

I occasionally get tarballs where the filenames are encoded in ISO-8859-1 or some other pre-Unicode scheme. My system uses UTF-8, so when I untar these archives with the usual options (tar xvf ...
1
vote
1answer
104 views

curl progress in dialog

how can i properly display the curl progress in the dialog window? curl http://mysite.corp/image/root_21.tar.bz2 | tar -C /mnt/dest/ -jxf - i tried this command but as you can see it does not ...
0
votes
1answer
55 views

exclude files in tar.gz

I want to exclude two files from a tar file.. But it doesn't seem to work cd /var/www/public/api_test tar -zcvf api_v2.x.tar.gz api --exclude "./api/distributor_test.php" --exclude ...
0
votes
1answer
67 views

How to ignore adding modified time to archive file while compress using tar

Can we instruct tar to do not keep modified time of the files in archive file while compress. What I want is, the extracted directories/files should get time from machine where it's extracting, not ...
0
votes
1answer
77 views

How to exclude directories from tar in this script?

Answering my own question yesterday, I wrote a bash script which archives all directories within a defined directory into their own separate archive files. I have also defined a variable for a file ...
-2
votes
2answers
151 views

What is the default path of newly created tar archive?

I created tar archive using following command: tar -zcvf archive-name.tar.gz directory-name After this operation, where that tar.gz is located?
0
votes
2answers
258 views

How do I archive a folder keeping owners and permissions intact?

Is there any way to archive a folder and keep the owners and permissions intact? I'm doing a backup of some files, which I want to move using a usb-stick, which has a FAT filesystem. So the idea was ...
3
votes
2answers
2k views

tar command - skip symlinks

I use the tar command as, tar -cvf protTests.tar protTests/* to tar all files inside the folder, protTests. But this is including the symbolic links inside the folder, which is not a desired one. ...
6
votes
2answers
473 views

How to use tar to compress a group of files in a .txt file?

I have a lot of filenames that listed in a .txt file called to_be_archived_files.txt, and its content is as: ~/Documents/dir1/a.html ~/Documents/dir1/b.html ~/Documents/dir1/c/1.html How do I add ...
3
votes
2answers
153 views

Archiving to remote-machine with tar/cpio and ssh?

I'm renting a couple of VPS with Ubuntu, and I've managed to fill-up one of them. Here I've got several directories with lots of files I'd like to put into an archive. Unfortunately, I don't have ...
1
vote
1answer
205 views

How to create a tar of a chroot?

I want to capture everything in a chroot but am unsure whether I need to first chroot into it to see the full filesystem/preserver permissions etc. From outside the chroot, it seems like I would miss ...
3
votes
1answer
102 views

Where the term “tarball” comes from?

I use unix distros every day and I started using them a long time ago but I never thought about the provenience of the word "tarball". I tried to search it on the dictionary but I didn't find ...