Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [tar]

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

0
votes
0answers
27 views

Why I cannot tar gzip all the contents of a specific folder

I have a folder containing several folders. I want to tar and gzip the parent folder with all the contents of the subfolders. However, when I use tar -cvzf folder.tar.gz Folder/ only a few ...
4
votes
2answers
53 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
16 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 ...
20
votes
2answers
1k 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 ...
1
vote
2answers
54 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
vote
1answer
33 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
352 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
45 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
39 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
57 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
28 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
39 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
28 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? ...
0
votes
1answer
37 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
1answer
26 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
32 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
58 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 ...
0
votes
0answers
30 views

Archive all files in current dir [duplicate]

I couldn't found solution on this. How I can tar and gz all files in current dir without sub folders with bash script? I tried with #! /bin/bash tar -czvf all.tar.gz * Echo "archived" ..but ...
2
votes
1answer
83 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
26 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
42 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
49 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: ...
1
vote
3answers
158 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
29 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
20 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.
0
votes
3answers
135 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' ...
2
votes
1answer
30 views

How to untar all .tgz files in a folder and write to new files with different Naming convention

I have folder thay contains many .tgz files, each uncompressed file has SAME file name "000000_0". Can someone write me a command to do below? 1. Untar all the .tgz files from a folder 2. rename ...
0
votes
1answer
46 views

Create or Update if exists tar file

I ran into that problem today when I wanted to tar all files and directories in a specified directory. Doing the following is not enough because hidden files (ones starting with . won't be included): ...
2
votes
2answers
114 views

How can I tar and gzip my web directory files and download (using rsync) it in one command from my local machine?

I'm rewriting my original question because I realized this is more efficient: I'd like to tar and gzip my website files and then download it. I know I can tar and gzip it with one command using tar ...
0
votes
1answer
35 views

Script “7 days log tar and then remove the 7 days logs and exclude the tar file after next 7 days”

I am trying to create a script such that it could tar.gz all the previous log of per 7 days log and exclude the tar file in next run. Is the script ok or should I have to make a change find /home/...
0
votes
0answers
26 views

Is it possible to dynamically add to a tar.lrz file?

A bit of a basic problem, I'm slightly embarrased I'm running into it, however man lrztar didn't show me any commands for this. Basically, lets say I've got an archiving station which handles ...
0
votes
2answers
304 views

Can't tar files: Refusing to read archive contents from terminal

I have host without dpkg so I need to install it. I followed the instructions from here and here. On both of these answers they wrote that I need to download the file: wget http://security....
-1
votes
1answer
61 views

tar with ssh: what happens if creation speed is higher than network speed?

I'm concerned what will happen if speed of source read + stream create operations gets higher than underlying network protocol speed? Is tar going to create and cache data locally before it is ...
1
vote
1answer
53 views

Gzipped archives - Create using tar -czf and extract using only -xf?

Say I have a file.txt containing one line: strawberry Using tar -czf archive.tar.gz file.txt I can create a "gzipped archive" with the name archive.tar.gz, which is to my knowledge the equivalent ...
0
votes
2answers
47 views

How to tar a directory including dotfiles, but omitting all reference to the directory itself

I want to back up home directories including the usual array of dotfiles, but I do not want the directory itself, or its permissions to be backed up or even mentioned. So, if I have a structure like ...
0
votes
0answers
28 views

tar: compare/verify in conjunction with transform

Is there an efficient way to verify a written tar-archive with transformed file names? Assume I have a file called foo and want to store it in the archive as bar, I would create the archive foobar....
5
votes
3answers
240 views

Portable way to invoke tar with a list of files from stdin

I want to create a .tgz from the content of a directory. I also want to strip the leading "./" from the tar'ed content. I had done this as follows: cd /path/to/files/ && find . -type f | cut -...
1
vote
0answers
45 views

Need to edit a single file in a tar.gz using Python [closed]

Vim provides the ability to edit a single file in a tar.gz without unarchiving. ( i.e. vim some_archive.tar.gz ) How could I script the same type of operation using Python?
2
votes
1answer
65 views

pipe of tar and tree commands?

I would like to see the tree of a big compressed file (specifically only the second level of directories) so I used the following command: tar -tf tarfile | tree -L 2 But it outputs the tree of the ...
0
votes
1answer
163 views

Pass space separated arguments stored in variable to command

I've hijacked a pretty neat backup script from the internet but somewhere along the lines there is something like this going on DIRS="/home/ /var/www/html /etc" tar -czf /backup/file.tar.gz "${DIRS}"...
0
votes
0answers
53 views

problem with find xargs and tar concatenation

I want to store all the png files in a directory tree. I used find . -iname *.png| xargs tar -czf renderresultsall.tar.gz but I get only a part of the files, some directories are missing e.g. ....
1
vote
1answer
239 views

tar --list only top level files and folders

using tar --list --file=x will list all files and folders. I am just looking to list the top level files and folders does anyone know how to do that? alternatively, does anyone know how to list only ...
0
votes
0answers
44 views

How to archive into multiple zip a directory containing several millions sub directory?

I have large directory that contains several millions+ sub-dir, each sub-dir contain 3 or less image files. What is the most efficient way for me to zip them so I can move it to a new server? The sub-...
5
votes
0answers
67 views

Limit tar read speed

I'm using tar do make backups of a machine. But, it is using a lot of I/O and slows down the whole machine. So, is there a way to limit the read speed of tar? I know about pv, but it limit only the ...
1
vote
0answers
61 views

tar takes a long time before passing data to gzip

What I want to know, is what is tar doing at the start, before it starts passing data on to gzip? Can I make it skip that step? I'm writing a script to run on my Synology NAS box (running DSM 6.2.1-...
0
votes
1answer
28 views

using sudo with piped command on Ubuntu server

If I need to use the following backup command on an Ubuntu server with sudo, how do I do so? Do I need sudo at two places? tar cf - directory | 7za a -si directory.tar.7z
0
votes
3answers
79 views

Is it possible to tar only sub directories excluding other files in the folder?

For example, suppose A/B/C is the main directory. Under the C directory, I will have sub-directories and files. But I want to tar only the directories with its own name as below If the directories ...
3
votes
1answer
75 views

What does cat of a tar archive show? [closed]

I was doing a penetration testing capture the flag training exercise and found a file called "backup". I checked the file type of "backup" and saw it was gzip compressed. I decompressed it to a file ...
0
votes
1answer
83 views

Problem with find excluding files of type socket when creating tar archive

I am trying to make a tar archive of all files in my /var directory. Naturally, I want to exclude the Unix sockets in there. So I try a command that looks something like: sudo find /var \! -type s ...
1
vote
1answer
164 views

tar: compress text stdin and stdout [duplicate]

Using tar, is it possible to compress stdin text and have the compressed data appear in stdout? Example: $ echo "test" | tar c - <compressed blob here> I'm using macOS Mojave.