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

learn more… | top users | synonyms

0
votes
1answer
51 views

Compare and tar file for 2 date formats from filename

I need to keep files 4 months from now (3 previous month + 1 current month) in directory and tar the rest. But the problem is my files consist of different format. StockList_03-01-2015.txt ...
6
votes
4answers
36k views

How do I extract with tar to a different directory?

This doesn't work: tar xf /tmp/foo.tar.gz foo/bar tar: foo/bar: Not found in archive It's not obvious to me what would do this beyond extracting it in place and moving the files over.
4
votes
1answer
44 views

unpacking tarball with hard links on a file system that doesn't support hard links

I got a tarball (let's say t.tar.gz) that contains the following files ./a/a.txt ./b/b.txt where ./b/b.txt is a hard link to ./a/a.txt. I want to unpack the tarball on a network file system (AFS) ...
2
votes
2answers
2k views

How do I dereference links when extracting from a tar file?

If I have a tar file, bob.tar, which contains real_file and link_to_real_file, in which the latter is a symlink, is there a way to extract the contents of bob.tar so that link_to_real_file will not be ...
1
vote
1answer
55 views

Where to tar entire USB flash drives?

I want to do all my archiving and compression on the command line. I have a USB flash drive located at /dev/disk/by-label/SanDiskData (which links to /dev/sdc1). I thought I could simply do: $ cd ...
9
votes
4answers
32k views

How to create tar archive in a different directory?

I want to create a tar archive in a different directory rather than the current directory. I tried this command: tar czf file.tar.gz file1 -C /var/www/ but it creates the archive in the current ...
0
votes
1answer
30 views

splitting a tar

I was tossed into Linux at work and have no experience with it what so ever. The guy that's training me gives me little tasks to figure out as I go, and I'm stuck. Today he told me to tar a file and ...
2
votes
3answers
68 views

Unable to use tar to run an archive through bzip2 compression

I am having difficulty compression an archive with bzip using tar. The archive I have is user-logs.tar. I am attempting to run this: tar -jf user-logs.tar I get this error: tar: You must ...
5
votes
7answers
16k views

tar files only, no directories

I can probably write a shell script to find files only, then pass the list to tar, but I am wondering whether there already is a built-in feature in tar that allows doing just that, in a single ...
0
votes
1answer
28 views

Why doesn't `tar --exclude` take multiple options?

Looking at the man-page for tar it's stated that --exclude=PATTERN will " exclude files, given as a PATTERN ". I'm not sure if PATTERN is explained in more detail somewhere else, but why does the ...
0
votes
1answer
60 views

Why does my tar not work? [closed]

I want to install a teamspeak on my root server, but after downloading the tar file, I cannot extract it. I use the command tar -xzvf teamspeak3-server_linux_amd64-3.0.12.2.tar.bz2 I also know ...
2
votes
2answers
99 views

sudo tar changes extracted files ownership to unknown user

I am running this command: $ sudo tar xvzf nexus-latest-bundle.tar.gz The extracted files belong to an unknown (1001) user: drwxr-xr-x 8 1001 1001 4096 Dec 16 18:37 nexus-2.12.0-01 ...
15
votes
5answers
7k views

tar extraction depends on filename?

I often download tarballs with wget from sourceforge.net. The downloaded files then are named, e.g ...
1
vote
1answer
100 views

How does one remove a tar-installed Node.js from CentOS 7?

A CentOS 7 server has v0.12.7 of Node.js installed, and the installation was done using a tar. This is leading to conflicts when I try to install a more modern version of Node.js using yum. What ...
2
votes
1answer
574 views

Difference between tar and star

I've been learning about the syntax and usage of tar and came across star. I've read this paragraph from the star manpage: Star includes the first free implementation of POSIX.1-2001 extended tar ...
7
votes
3answers
6k views

Tar a folder without .git files?

If I tar a folder that is a git repository, can I do so without including the .git related files? If not, how would I go about doing that via a command?
13
votes
9answers
4k views

Memory problems when compressing and transferring a large number of small files (1TB in total)

I have 5 million files which take up about 1TB of storage space. I need to transfer these files to a third party. What's the best way to do this? I have tried reducing the size using .tar.gz, but ...
0
votes
1answer
32 views

How to issue a tar command when you restore your system

I've recently created a tarball backup of my Ubuntu system (/ and /home partitions both ext4). When I was creating a backup I booted off Live DVD and I used a tar command. Now I wonder which would be ...
3
votes
3answers
1k views

How to install BPG (Better Portable Graphics) on Linux Mint 17?

How do I install BPG (Better Portable Graphics) on Linux Mint 17? I downloaded the tar.gz file from Fabrice Bellard's website. The ReadMe file says, Edit the Makefile to change the compile ...
0
votes
1answer
40 views

“a” showing up with files during tar archiving

While I'm archiving the file in my local system, I see an "a" at the beginning of the files while compressing. tar -zcvf database.tgz database/ a database a database/GeoIP2-City.mmdb a ...
-1
votes
2answers
30 views

How to create a tar of directory structure

I want to copy the directories into another server; however don't need to copy the files of the directories. So a tar of empty directories is the one that I am looking for.
10
votes
3answers
1k views

tar to pipe but keep -v verbose output separate from STDERR

A normal tar command tar cvf foo.tar ./foo >foo.out 2>foo.err has three output IO streams archive data to foo.tar list of filenames to STDOUT (redirected into foo.out) error messages to ...
2
votes
3answers
375 views

AIX tar error: There is not enough memory available now

I have an AIX P720 server running AIX 5.3. When running tar -xvf /dev/rmt0 extracting from tape (IBM TS3100 Tape Library), I get the following error: "There is not enough memory available now". It ...
0
votes
1answer
50 views

How to “Find” then “Rsync” then “Tar/gz” on destination host?

I have a Cassandra node with snapshots broken up into 64 directories with over 350 files per directory. I want to "find" all snapshot files, preserve their location, rsync them across to a host with ...
1
vote
0answers
22 views

Tar waiting a long time at end of block device

I had some trouble getting Linux installed to a particular netbook and had to restart it from scratch multiple times. Re-typing the same commands to set up networking and bootstrap the install was ...
23
votes
6answers
15k views

Is there a parallel file archiver (like tar)?

Is there something out there for parallel archiving of files? Tar is great, but I don't use tape archives, and it's more important to me that the archiving happens quickly (with compression like ...
1
vote
0answers
36 views

How to 'snapshot' a chroot?

I want to perform something similar to a 'clone' on vmware fusion/virtualbox/a VM manager. Host and chroot are both ubuntu. One complicating factor may be that this chroot may have one or more child ...
0
votes
0answers
82 views

How to make tar to ignore last-modified-time of files/directories

I'm using tar to backup a directory. Some files/directories' last-modified-time will be updated but the content remains. I would like to get a tarball with the binary if the directory files' content ...
0
votes
1answer
26 views

Not able to see the backed up file in the backed up media

I used 2 commands cpio and tar to perform the same operation of backing up data to an external drive which is my 8Gb pen drive (sandisk brand). At the time of executing the commands, it outputs ...
0
votes
2answers
25 views

Does the untarred folder overwrites or appends the contents of the original folder? [duplicate]

I have a x.tar.gz as a backup which has the following contents: .htaccess a.html b.html c.html x.html I have also a ./x directory, already existing, which has the following contents: .htaccess ...
6
votes
3answers
441 views

tar extraction also automatically decompresses

When I run tar -cvzf archive.tgz file1 file2 ; rm file1 file2 it normally creates a compressed tarball, but how is it possible that tar -xvf archive.tgz gives me back the uncompressed files? ...
3
votes
2answers
118 views

Make Tar Incremental Backups into One Backup?

Well, I know this question is quite strange. I have done a lot of incremental backups. Now the total file size gets too large, because there are a lot of duplicate files with similar contents, and ...
0
votes
2answers
117 views

tar “--exclude-from” double star wildcard

I wrote a backup script on my Debian 8 system which uses tar command with "--exclude-from" to exclude some files/dir. This works great, but today I would like to exclude some files sharing the same ...
0
votes
1answer
40 views

Compress mtdblock with 'tar' before sending it via TFTP

what is proper command compress mtdblock with 'tar' before sending it via TFTP? tftp -l /dev/mtdblock3 -p 192.168.100.40
0
votes
1answer
39 views

Tar files in order

I am taring files using this script tar -cvf test.tar -C /home/user/Desktop/filestoTar File_one zap_file tar -rvf test.tar -C /home/user/Downloads/test Auto_file rocket_file And I want to untar ...
64
votes
7answers
45k views

How to XZ a directory with TAR using maximum compression?

So I need to compress a directory with max compression. How can I do it with xz? I mean I will need tar too because I can't compress a directory with only xz. Is there a oneliner to produce e.g. ...
1
vote
4answers
78 views

Avoid the contents of a .tar begin with './'

I want to make a backup of a directory using tar and xz, but I have a problem. When I open the file, all the files and directories begin with ./ and I don't want this to happen. file.tar.xz |---- ...
3
votes
3answers
548 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 ...
5
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
61 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
66 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 ...
21
votes
4answers
56k views

How to extract specific file(s) from tar.gz

How can we extract specific files from a large tar.gz file? I found the process of extracting files from a tar in Untar only a certain number of files from a large tarball but, when i tried the ...
0
votes
0answers
36 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
54 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, ...
7
votes
5answers
11k views

How to recover a corrupted “tar.gz” file

I suddenly needed to recover an old tar.gz file, but as soon as I execute so: tar -zxvf filename.tar.gz I get this: gzip: stdin: invalid compressed data--format violated tar: Child returned ...
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 .
0
votes
1answer
45 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 ...
1
vote
0answers
48 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, ...
0
votes
1answer
36 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 ...
2
votes
1answer
299 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 ...