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

learn more… | top users | synonyms

1
vote
1answer
42 views

Extracting the Contents of tar archive to parent directory issue resulting in creation of sub directories

I have a Tar file: testwebsite.tar I've placed it in the directory I would like to extract its contents to on my Web server which is mytestdirectory I run this command via PuTTY: tar -xvf ...
3
votes
1answer
44 views

Can tar discover the archive format when piping it in via wget?

When I have a tar archive of any format, I can use: tar xf archive.tar.xz tar xf anotherarchive.tar.gz as tar discovers the relevant format by itself. Now I want to download the archives and ...
2
votes
1answer
126 views

Uncompressing .tar.gz archive to specific directory

How does tar.gz file gets uncompressed with all contents to arbitrary directory, existing or not using tar using single line command? If it does not exists, then is created (directory). To clarify, ...
1
vote
3answers
30 views

Should I put old projects in tarballs

I never really used tarballs/archived much, except for uploads (with compression). Now I've accumulated a huge list of software projects coding experiments -- basically directories with lots and lots ...
1
vote
1answer
59 views

How to replace string of the file, which is present in tar file through UNIX

I have a tar archive xyz.tar containing lots of .sh files like: 123.sh 456.sh 789.sh Every .sh file has some string content, e.g. 123.sh contains welcome to Hollywood, 456.sh contains I love ...
4
votes
3answers
552 views

Why does the specific sequence of options matter for tar command?

I was trying out tar command to make archive with .tar extension. please have a look at the following series of commands I tried: $ ls abc.jpg hello.jpg xjf.jpg $ tar -cfv test.tar *.jpg tar: ...
0
votes
1answer
23 views

Unable to extract to specific directory

I am trying to extract to file to specific directory but it doesn't produce result Operating system : SunOS Command: zcat /export/home/tceng/Desktop/temp/3.tar.Z | tar -xf - -C ...
0
votes
0answers
5 views

Generating a .img from tarball: The /dev/loop devices [duplicate]

I'm trying to make a .img from a tarball using the following script: #!/bin/bash # Packages required # dosfstools parted # Can be run on any Linux system # loop.max_part=15 must be in kernel ...
1
vote
0answers
39 views

tar --occurrence= option ignored?

Using GNU tar 1.26 on Linux, I'm looking for a way to stop processing after the N-th occurrence of a file in a .tar archive. This should work: tar --file=archive.tar --list --occurrence=1 filename ...
-1
votes
1answer
90 views

How to install stardict from a tar.gz manually ?

I have downloaded stardict-2.0.0-pre2.tar.gz and applied the extraction on it by writing: tar xzvf stardict-2.0.0-pre2.tar.gz , thereupon a new folder was created with the following content: From ...
1
vote
1answer
854 views

How to pipe scp/ssh file transfer(pull) through tar (remote->local transfer initiated from local machine)

I would like to pipe an scp pull operation(sample without tar below) through tar, so that only one tar file is written for about 10 directories: user@localhost:/home/user> scp -r ...
0
votes
1answer
94 views

How to show a progress bar while tar a folder recursively?

In bash-script execution of taring not shown a progress bar, how to show a progress bar while taring a directory?
5
votes
3answers
841 views

Unpack file compressed in .txz and .tar with one command

I have a file compressed in *.txz. After unpacking it I received a *.tar file. Is there any way to unpack it twice with one command? I mean unpack file (*.tar).txz with one command? For know I'm do ...
0
votes
1answer
67 views

Using Xargs to write a tar archive in numerical order

I need to write an LTO of single frame files (DPX) in frame number order. When using the standard command below the frames are written out of order. tar -b 1024 -cvf /dev/nst0 <directory> ...
3
votes
1answer
325 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 ...
8
votes
2answers
620 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 ...
0
votes
1answer
66 views

Tar Create and Split files into subdir

I have this command: tar -cf - input/* | split --bytes=1m Which splits my huge gz files into small ones. This works fine. However I want the output (the small files) to be created in the input/ ...
3
votes
2answers
173 views

Tell gzip/bzip2/7z/etc not to compress already-compressed files?

I'm tarring up /home, and piping it through bzip2. However, I've got lots of already-compressed files out there (.jpg, .mp4, .mkv, .webm, etc) which bzip2 shouldn't try to compress. Are there any ...
4
votes
1answer
229 views

how to run a software in linux without installing it

I am trying to run Rstudio download page link. On my Windows machine, I just downloaded the zip file from zip/tarballs section and was able to run .exe without installing anything on my machine. I'd ...
-2
votes
1answer
212 views

How to compress a single huge file (e.g. 200GB) file from command-line [closed]

I'd like to compress one huge file (~200GB) from the command line. no need for archiving its directory along with it, swift operation and high compression ratio preferred. What may be some good ways? ...
0
votes
1answer
36 views

How to create backup from symbolic links and from files, too?

I would like to archive some directories. These directories are contain some softlinks. I should keep these links and files, too. I didn't found any solution... I tried tar with -h option but it ...
4
votes
1answer
79 views

How to display progress bar for tar incremental archives?

While creating a level-0 archive I can do this: tar -cf - . | pv -s $(du -sb . | awk '{print $1}') | gzip > out.tgz But in case of a level-1 (incremental) archive, I don't know beforehand what ...
1
vote
2answers
279 views

Compressing multiple files in different folders without folder structure

Currently I create a copy of my log files like this: # tar -cvzf /var/www/vhosts/example.com/httpdocs/myfiles.tar.gz /var/www/vhosts/example.com/logs/access_log ...
1
vote
3answers
345 views

How to tar files with a sorted order?

If you tar a directory recursively, it just uses the order from the os's readdir. But in some cases its nice to tar the files sorted. Whats a good way to tar a directory sorted alphabetically? ...
0
votes
1answer
341 views

tar command not found on rhel6

I am trying to download a file in rhel6 and use tar to uncompress it. I am running this on docker. I get a wierd error saying : /bin/sh: tar: command not found 2014/12/22 19:32:21 The command ...
4
votes
1answer
1k views

Untar a specifc folder within tar.gz

How do I untar/uncompress a specific folder within a tar.gz using the terminal/commandline (Ubuntu 14.04 (Trusty Tahr))? Precise: -file.tar.gz -- folder1 -- folder2 How to extract... ... ...
-3
votes
1answer
131 views

How to tell xargs to unpack tar into certain directory [closed]

I wrote my first script which goes: find /media/temp/test -type f -printf '%T@ %p\n*.tar.gz' | sort -n | tail -1 | cut -f2- -d" " | xargs tar -xvpf I would like to find latest modified file which ...
0
votes
1answer
74 views

Backing up Linux server to Windows domain

I'm maintaining a small Linux workstation/server in a Windows-domain-based environment. Apart from being in the same network, the Linux computer is not connected to the domain. Until now, I'm using a ...
2
votes
3answers
99 views

tar append to file in archive

Good morning, I have a tar compressed archive tar.bzip2 (created using tar jcf), which contains a file named data.txt (1). On the other side, I have another file also named data.txt (2). Is ...
1
vote
3answers
95 views

TAR Files: Move Files From Subdirectories to Main Directory

I've been trying to use this code: find documents -maxdepth 1 -type f -print0 | xargs -0 tar cvf documents.tar.gz to create a backup of the directory documents. The directory has the structure: ...
0
votes
3answers
71 views

what the best approach in order to compress directory with Hundreds of sub directories [closed]

Under /usr/cti/APP_sys, I have hundreds of directories and subdirectories and files, etc. I wonder what the best approach in order to compress the /usr/cti/APP_sys directory (get the best low ...
3
votes
1answer
60 views

Is it safe to use tar even if there are some characters other than ASCII in filenames and paths?

Is it safe to use tar even if there are some characters other than ASCII printable characters? For example, Japanese characters, Chinese characters, newline character etc. Are there any known ...
2
votes
1answer
64 views

Remove tar compress spool from cron email

I have a crontab job that call a simple script to backup a website: 15 0 1,10,20 * * /home/username/bin/backup_whatever This is the script: #!/bin/bash TODAY=$(date +"%Y%m%d") ...
2
votes
2answers
58 views

How to specify a different “top level” name for tar?

I would like to tar root (/) and let it appear as /abc in the tar archive. Is there a tar flag for specifying a custom top-level name?
4
votes
1answer
134 views

Is it possible to add error correction codes (BCH, RS or etc.) to a single file?

As far as I know, WinRAR archives may contain ECC (error correction codes), so if the archive is slightly damaged, then it can be fixed by itself. For example, I can first encode archives.tar to ...
2
votes
1answer
111 views

'Tar' the result of a 'find', preserving the directory structure

I want to tar all the *.txt files that I get as the result of a find command, that exist in a directory having a tree structure like this: Directory_name dir1 file1.pdf file1.txt dir2 ...
0
votes
2answers
82 views

How do you set the default behavior of tar?

I have never needed to use any other options for tar other than -cvzpf. Is there some way to set that as the default behavior? While I recognize that it is often impossible to say why someone wrote a ...
0
votes
1answer
108 views

Scripting multi-volume (GNU) `tar` with pre-defined number of volumes

I've wrote me a little script to test (or extract) a very big multi-volume tar archive (note: created with GNU tar), each of which 00x.tar chunk will fit onto a standard DVD: #!/bin/bash d=$(dirname ...
2
votes
1answer
346 views

cpio VS tar - what the best archive solution in order to compress hundred of directories to one file

I have hundreds of directories under /var/Recording, and each directory there will have subdirectories, including files, hard links and soft links. I want to compress all directories under ...
1
vote
3answers
179 views

Why can't the tape device such as '/dev/st0' use commands like 'cp' to copy contents to it?

I got this point from a book,it says Because the tape device is a disposable I/O device,so we can't use commands like 'cp' to copy. And the author recommended to use 'tar': tar -cvf /dev/st0 ...
4
votes
2answers
754 views

creating a tar archive without including parent directory

I am trying to create a graphical program for my script. Inside the script I use tar to create a tar archive. From the graphical program I get the full name of file that I want to create a tar ...
2
votes
2answers
74 views

Tar a list of files which don't all exist

I'm running a command from a script like tar -c -f ar.tar a b c d where b, c, and d may not exist, and may be directories. The solutions that I've come up with are piping the output of ls -d to ...
0
votes
2answers
75 views

difference between gnu tar and tar package in fedora repositories

man page of tar in fedora (and also man page of tar on die.net) mentions the --acls and --xattrs and --selinux options but they are not mentioned in tar manual in GNU website Why? do this mean ...
2
votes
1answer
59 views

How to download latest version of cmake using tar xzf?

When I did cmake --version I got this - cmake version 2.6-patch 4
2
votes
1answer
46 views

Tar using progress bar and handling multi-volumes

I'm trying to create a tar of a large LVM volume onto multiple external drives. That part is solved. Now, because it is a LONG process, I'd like a progress bar. From the excellent articles here, ...
3
votes
1answer
588 views

Estimate the size of the extracted files before extraction a `tar.gz` archive?

Before using tar to extract a .tar.gz archive, it is possible to get an estimate of how large the extracted files are in total?
7
votes
3answers
797 views

How to recompress 2 million gzip files without storing them twice?

I have about 2 million (60GiB) of gzipped small files and I would like to create a compressed archive containing all of them in an uncompressed version. Unfortunately, I cannot just uncompress them ...
0
votes
1answer
61 views

Extracting tar.gz from distance

I would like to extract a single file from a tar.gz file, but its in another folder than I am currently in. Is it possible to extract from "distance"?
1
vote
1answer
60 views

Adding files to .tar from directory

Is there a way to add files to .tar file in one directory from an another directory? And at the same time list the content of the tar to see if its added. I only found ways to add files if its in the ...
2
votes
1answer
37 views

Fastest way to find whether a file exists in a number of tarballs? [closed]

Is there a more efficient way to do this other than using tar tf and checking the output of every file against the file that I'm looking for? This is the way I do it right now, but it's very slow ...