Questions tagged [tar]

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

Filter by
Sorted by
Tagged with
-1
votes
1answer
804 views

Difference between tar -t and tar -v options

I created a archive using command tar -cvf filename.tar files , in this the verbose option simply showed me a list of all the files that i have archived.When i used tar -tf filename.tar ,it again ...
0
votes
0answers
75 views

Comparing Files inside Tar on Unix

I want to know how can I compare some files inside a tar one with these same files in one directory and if these file exists in the directory, proceed to delete them. I tried using diff and tar -tvf ...
1
vote
1answer
46 views

tar on remote machine and save the compress file under specific folder

we want to tar the folder - current on remote machine and save the compressed file under /tmp so we do that: ssh 18.23.2.12 "tar -zcvf current_bck.tar.gz /var/current -C /tmp" but on remote ...
1
vote
2answers
1k views

Solaris how to exclude files in gz

How do I exclude files while gz in Solaris; I want to gz directories inc sub directories but exclude /temp directory and *.gz files. This is what I have used so far; tar -cvf api_v2.x.tar.gz --...
0
votes
0answers
78 views

In qemu using gzip return unexpected end of file gzip

When i download a file in /dev/sda1, and qemu -device file=/dev/sda1,format=raw to boot with it, gzip -d return unexpected end of file gzip. However, in my host machine, tar -xf it works fine. So ...
4
votes
2answers
702 views

What is the rationale for using -f in tar [duplicate]

From man tar: -f, --file ARCHIVE use archive file or device ARCHIVE Please consider: tar -zxvf myFile.tar.gz As far as I understand, z means "gzipped tarball", x means "extract", v means "...
-1
votes
1answer
46 views

Untar an archive in the directory it is currently at (without noting destination path)

While in ~/public_html I ran: tar -zxvf example.com/extensions/MobileFrontend-REL1_32-9b48b3c.tar.gz I assumed the untarred directory (named MobileFrontend) would appear under example.com/extensions ...
-1
votes
1answer
82 views

Piping tar archive via mv on macOS

I ran: tar -cjvf ~/Dict_$(date +%Y-%m_%d-%H_%M_%S).tar.bz2 ~/Dictionaries | xargs mv ~/Documents but it leaves the resulting file in ~/ and does not move it. How do I move the resulting file (after ...
1
vote
1answer
101 views

how to separate tar.gz file to 5 files [duplicate]

we have huge file as du -sh * 7.7G HDP-2.6.5.0-centos7-rpm.tar.gz and we want to separate the file to 5 files as HDP1 HDP2 HDP3 HDP4 HDP5 and later I want to revert all HDP* to HDP-2.6.5.0-...
0
votes
1answer
71 views

GNU tar man-page mysterious references to METHOD='replace' and METHOD='system'

My tar (GNU tar 1.28) man-page lists the --atime-preserve option, which applies to the time a file is added to the tarball. The full explanation reads thus: --atime-preserve preserve access ...
0
votes
1answer
29 views

Compressing Folder Structure with specific filtering

I have a folder structure like this: /foo /foo/bar /foo/bar2 /foo/bar3 Within each folder (including /foo) I have files with names ending .txt. However, I want to exclude these files from /foo and I ...
1
vote
1answer
127 views

Get tar to save birth time

Is there anyway to make a tar archive that includes the creation times for the files/directories inside of it?
1
vote
1answer
348 views

tar: behavior when missing files

If extracting with GNU tar with an explicit list of files like this: tar xf archive.tar file_a file_b file_c what is the behavior if file_b is missing (i.e. archive.tar only contains file_a and ...
-1
votes
1answer
351 views

Add single file into a TAR

I have a tar archive named backup.tar. I want to add a file named sshd.conf into this tar archive.
0
votes
0answers
48 views

Tar files in groups by total size

I need to tar (and gzip) a long list of files but I need to do that in groups based on each group size. For example assume I have a list of 100 files, 1Mb each and I want to create archives that are ...
1
vote
1answer
70 views

Recover accidentally flushed logs file

I have an Apache Tomcat running on CentOS7 server which had a file catalina.out of around 157MB in size. I was trying to download that file on my local system so I ran the tar -czf command but I ...
1
vote
1answer
777 views

tar: FOLDER: file changed as we read it however FOLDER is added to exclude

tar command fails with error "tar: artifacts: file changed as we read it" although I added folder "artifacts" to exclude list Following command works fine on one machine (ubuntu 16.04 with tar 1.28) ...
0
votes
1answer
79 views

Getting the right file permissions when building packages in /usr/local/src

As far as I understand, when you build a package foo located in /usr/local/src you shouldn't need to be root. However, when I extract the package and try to run the build script it fails because it ...
0
votes
1answer
997 views

Using tree with tar.gz file without extracting contents

I am wondering if it's possible to output the contents of a tar.gz file using tree without having to extract the contents of the file to a temp directory then using tree with that directory. I know ...
0
votes
0answers
62 views

Can we create Arch Linux packages from Debian packages securely? [duplicate]

I have made a very simple terminal game: https://github.com/Souravgoswami/t-hangman I have also created the Deb file. We surely can move the source code to /usr/bin/ directory and the word file to /...
2
votes
5answers
1k views

Create archive (tar.gz, …) from file given via stdin

I would like to automatically create a compressed archive from a file given via stdin (or create the archive, if it doesn't exist yet), while specifying the file name that it's going to have inside ...
1
vote
1answer
82 views

piping output of find to tar: avoiding duplicate links to files in archive

When piping the output of find to tar, two links for each file appear in the resulting archive. This is not the case if tar is applied to the directory directly. Can the duplicate links be avoided? ...
0
votes
1answer
645 views

How to compress a directory into a tar without metadata header in the files?

When I try to compress the directory into a .tar format it creates successfully, but the tar files contains extra lines(Header/Metadata). I have .csv file in a folder and i need to convert that folder ...
0
votes
2answers
25 views

.tar archive files EACH to its own directory?

I have an archive that contains files from various directories (created with -T option, so I used file with list of files to archive). Files preserve owners and rights. Content is like: var/lib/...
0
votes
1answer
656 views

Can I extract an overwriting tar archive, while retaining the ownership of the original destination file(s)?

I have a particular use case, where I want to extract a tar archive (as root) and intentionally overwrite some destination file(s) with the contents of the archive. This is all fine and easily ...
2
votes
1answer
1k views

tar command writing to standard output

I am curious to understand whether there is any difference in the below two syntax of how tar command writes its output to STDOUT channel tar -czf - /src_dir tar -czf -O /src_dir From the man page, ...
5
votes
2answers
2k views

how to speed up tar, just build a package without compression

I have a large folder, 2TB, with 1000000 files on a Linux machine. I want to build a package with tar. I do not care about the size of the tar file, so I do not need to compress the data. How can I ...
1
vote
1answer
2k views

compressing a folder tgz , encode to base64 and send over the fly

I am trying to compress a folder, encode to base64 and send it over the fly , but I am getting a error tar: Cowardly refusing to create an empty archive tar -czf Pictures | base64 | nc ...
22
votes
2answers
2k views

Why does tar appear to skip file contents when output file is /dev/null?

I have a directory with over 400 GiB of data in it. I wanted to check that all the files can be read without errors, so a simple way I thought of was to tar it into /dev/null. But instead I see the ...
2
votes
3answers
5k views

Can tar extract jar files

From https://dzone.com/articles/java-8-how-to-create-executable-fatjar-without-ide tar xf ExecutableOne.jar but why do I get $ tar xf ExecutableOne.jar tar: This does not look like a tar archive ...
-1
votes
1answer
294 views

How do I prevent a __MACOSX from being created when I extract an archive that I created on MacOS?

From commentary in "Rewrite last modified date when unzipping archive": I have a ZIP archive that I created on MacOS. Whenever I use bsdtar xmf file.zip or unzip -DD file.zip to extract it a new ...
4
votes
1answer
419 views

Zip/Tar file compressed to larger size? [duplicate]

I have 4 files that I want to include them in a .zip file. drwxr-xr-x 7 skemelio themelis 4,0K Οκτ 18 00:21 CSharp drwxr-xr-x 11 skemelio themelis 4,0K Οκτ 18 00:17 gnome-games drwxr-xr-x 8 ...
0
votes
1answer
1k views

tar + compress folder to tar.gz and removed the folder

by the following way we tar the folder presto-server-0.210 to file tar -czvf presto-server-archive.tar.gz presto-server-0.210 so after we tar the folder , folder still exists is it possible to use ...
1
vote
1answer
59 views

Tar is not extracting to another directory with -C

I'm trying to download latest ffmpeg from here and extract the ffmpeg file to /usr/bin but no matter what I do I can't make the file go there! My command to download and extract the file wget -q ...
2
votes
3answers
249 views

Determine the number of directories inside a tar file without extracting it

I need to count directories inside an archive file (e.g. tar.bz) without extracting the archive. Note that the archive is too big so that it will be hard to extract then count directories using ls | ...
-1
votes
1answer
188 views

Extracting one file from multiple tar files that are within one tar file

I have a '.tar' file that contains multiple '.tar.gz' files. Within each of these '.tar.gz' there is a '.faa' file that I need. I don't want to unpack everything else. I have been searching through ...
3
votes
2answers
49 views

find command outputs files without a directory structure

I want to tar some Python files and send it across a server. I do: find /some/path -iname "*.py" -exec tar czfv python_files.tar {} + Followed by: pv python_files.tar| ssh some_user@some_server '...
0
votes
1answer
107 views

tar: when no sorting specified, is the argument order used?

In GNU tar, the manpage says: The default is --sort=none, which stores archive members in the same order as returned by the operating system. But what does the operating system return? ...
1
vote
1answer
2k views

Recursively exclude directory with pattern using tar

I have a directory with various python packages that I'd like to archive using tar. I need to exclude the numerous __pycache__ folders that get left behind by the build/testing process but using --...
-1
votes
2answers
310 views

Archived rootfs: convert tar to cpio for initramfs

I have a Debian rootfs as a tar file. I would like to specify it as the initramfs source in Kconfig (using PetaLinux), but the source must be a cpio archive. How can I convert the .tar to .cpio, ...
1
vote
2answers
56 views

tar a directory [duplicate]

#!/bin/bash current_date=$(date +"%m-%d-%Y") file="name Backup ($current_date)" tar -cvzf $file.tgz module8 My output needs to be named "name Backup $current_date" When I run the script is just ...
0
votes
1answer
602 views

GNU parallel proper usage in conjunction with tar, xz, gpg

I would like to speed up my archiving operations, I am usually doing 23 GiB (one Blu-Ray) backups. I have found this: How to do large file parallel encryption using GnuPG and GNU parallel? Since I ...
2
votes
1answer
771 views

Best compression for operating system image

I have an Operating system image of size 2.5G. I have a device with a limited size. Thus I was looking for the best possible solution for providing the compression. Below are the commands and ...
0
votes
0answers
310 views

How to make use of tar --verify directly?

This question is about compressing rather large data directories (around 22-23 GiB), specifically the integrity checks of such archives. I do these big backups about once a month, so the time it takes ...
2
votes
1answer
120 views

Trying to Create a TAR Archive, But Exclude .messages Files

I want to create a GZIP compressed TAR archive containing the contents of /var/log, but excluding /var/log/messages file. I tried tar -cvf var/log.tar var/log/ -x *.messages*, but got the error ...
0
votes
0answers
654 views

Broken pipe when running backup script on ubuntu

I have written a simple bash where I'm connecting to an external storage via curlftpfs and then running tar in it to make a backup of my filesystem (ubuntu 18). It looks something like this: ...
4
votes
3answers
2k views

Tar Splitting Into Standalone Volumes

I have some directories with over 100Gb of data. I'm trying to archive them into smaller volumes i.e. 10Gb each that are independent / standalone. The problem is if I use tar + split, it results in ...
1
vote
1answer
204 views

Show only the really extracted (non-skipped) files using tar

I'm extracting daily backup archives. I want to see only the new files since the last day. The archives contain lot of already existing files, which I don't want to overwrite, so I use the --skip-old-...
0
votes
1answer
69 views

Change filesize unit with a tar command

How can I change the filesize unit that is output by the tar command? tar tvf test.tar.gz | awk '{print $5,$9}' I would like for it to print the filesize in Gigabytes.
-1
votes
3answers
7k views

LINUX: tar: You may not specify more than one '-Acdtrux', '--delete' or '--test-label' option [closed]

sudo tar xuzf splunk-7.2.4-8a94541dcfac-Linux-x86_64.tgz -C /opt I get the following message: tar: You may not specify more than one '-Acdtrux', '--delete' or '--test-label' option Try 'tar --help' ...

1
3 4
5
6 7
22