Questions tagged [tar]

An archive file format (and the program that reads it) commonly used on Unix and Linux.

Filter by
Sorted by
Tagged with
1 vote
1 answer
390 views

Prevent tar from overwriting tarball

I accidentally ran the same command twice: tar --remove-files -cf ../2019-09.tar *2019-09-* The second invocation replaced the tarball containing my data with an empty one, even though it died with ...
2 votes
2 answers
6k views

tar: extract myfile.tar.gz archive to a directory named myfile

Can it be done with tar? Do I have to write a bash script?
1 vote
1 answer
203 views

Tar restore with removal of pathname components

I use tar about once every 10 years and made a backup off a failed inaccessible drive that luckily worked fine. Except that instead of backing up just /home (and everything under it), it backed up /...
0 votes
1 answer
41 views

Tar restore syntax to only restore UNhidden files

What is the proper syntax for only restoring files that are NOT hidden? I'd like to copy those by hand, as needed, without bulk overwriting anything that's already there. So for example, I'd like to ...
0 votes
1 answer
3k views

How to update tar to version 1.30+ in Ubuntu 16.04?

I work with the gitlab-ee docker image to install my local gitlab. This docker image has the OS Ubuntu 16.04 and can be found here: gitlab/gitlab-ee in hub.docker. Within these image tar in version 1....
109 votes
2 answers
123k views

How can I use tar command to group files without compression?

I have a very large folder of 120,000+ files. and I need to move them to another location on my same machine (same partition). I'd like to use the tar command to group them up as a single unit and ...
44 votes
1 answer
186k views

Extracting a tar.gz file returns, “This does not look like a tar archive.”

I have a tar.gz file and I want to extract it using terminal. I used following commands: tar tvzf ldtp_3.5.0.orig.tar.gz and tar -xvzf ldtp_3.5.0.orig.tar.gz. However, I get the same result for both ...
12 votes
2 answers
7k views

List contents of tarball in tree format

Per the answers here I'm able to list the contents of my tarball in ls format. However, I'd like to be able to list them in tree format, i.e. something like the latter instead of the former: With tar:...
0 votes
1 answer
59 views

Copying files using shell Scripting [closed]

hellow guys, please i need a script shell that can copy files from server to another using SCP. and put the files in temperory folder then copy from tmp to destination /product/serv/nep/ in case if ...
0 votes
1 answer
113 views

Strategies To Reduce Compressed File Lookup Time With Pixz?

I have a PIXZ-compressed (level -9) tarball containing around 4000 files (ordered, like pages in a book): compressed size is ~670M. Currently I am programmatically accessing these files using the ...
0 votes
1 answer
802 views

How to change my cron job to auto update the geolite2?

A Prestashop e-commerce website is using MaxMind's GeoLite2-City database for country blocking. Instead of geoipupdate it uses this cron command to keep that database up to date: /usr/bin/curl -L --...
0 votes
1 answer
140 views

website backup via cron job and "file changed as we read it" issue

I'm creating scheduled backups of a website (i.e. its "public_html" folder) via cron job and the first action is to compress that folder into a tar.gz backup ("public_html_date.tar.gz"). Sometimes I ...
0 votes
1 answer
283 views

disk full after a interrupted tar command

I'm working on Ubuntu 18.04.3 I ran a tar command to compress some files (I used wrong arguments by the way) tar -cvf rep_to_files/* archive.gz The amount of files was something like 13Go. The ...
24 votes
4 answers
23k views

Prepend prefix in tar

I currently do in a shellscript very inefficiently: cp -a $MYPATH /tmp/$VERSION cd /tmp tar cjf archive.tar.bz2 $VERSION I want everything to be contained in the directory called $VERSION - is there ...
45 votes
3 answers
46k views

Extract specific files in a tar archive using a wildcard

I'm trying to create a script to extract only jpeg pictures from an archive containing many kind of files. To do so, I tried to use: tar -xf MyTar.tar *.jpg but it failed (*.jpg not found) and ...
0 votes
1 answer
197 views

Why I can't start pycharm 2019.3.1 on ubuntu?

First, I downloaded pycharm using snap, and I edited the pycharm64.vmoptions file. Then I wasn't able to launch the software, so I uninstalled it. After that, I downloaded the pycharm.tar.gz file ...
0 votes
1 answer
284 views

tar every folders in a folder and delete after tar

I have a folder with a few folders and files. The name of folders is a date. like: 2020-01-16. I want to tar only and every folder in this directory, and then delete that folders after tar ...
0 votes
0 answers
128 views

"Smart" fast compression for archiving mixed content?

I would like to backup a computer folder quickly to an archive format (e.g. tar, zip, 7z, gz, etc.). The folder contains many files: Some are text files that can achieve a good compression ratio. ...
42 votes
3 answers
67k views

How do I use 7-Zip CLI for Windows to create .tar.gz archives?

How can I use the 7-Zip CLI (7za.exe) on Windows to create .tgz archives, as I use tar zcvf archive.tgz source_files on Linux?
0 votes
2 answers
1k views

How to append the contents of a .tar file to another file

I have a file named archive.tar and I want to append its contents (archive.tar is a backup file coming from a text file) to another file. I use the following command that doesn't seem to work: tar -...
5 votes
2 answers
2k views

How to find tar format of archive?

There are several formats of tar archives, ustar, gnu, etc. Is there some tool that can show which format a given archive is in? (Haven't found it in manpage of bsdtar nor in info pages of GNU tar).
2 votes
2 answers
3k views

How to Specify the Target Location When Extracting Specific Files from a Tar Archive?

In light of new information I’ve rephrased the question. The old information is below in order to not invalidate answers and comments that were based on it. I’ve got a tarball tarball.tar I want to ...
1 vote
1 answer
997 views

Installing tarballs on Busybox

I want to preface this with I am new to Linux. I am trying to install some libraries (and a program that depends on them) on an embedded Linux server running Busybox v1.20.2. I am not able to run ./...
2 votes
1 answer
3k views

How to count number of files in “.tar” files inside another, nested “.tar” file without extraction?

There are many solutions out there on counting of files inside a .tar file. But I have not found a solution to count number of files in .tar files inside another .tar file without extraction. For ...
50 votes
3 answers
39k views

Is it possible to mount a .tar file?

The only result of any import when I searched for this was from 2001. In the intervening decade, have any tools/methods for mounting a tar file as a filesystem (perhaps utilizing fuse) been created? ...
0 votes
1 answer
518 views

Is there any fast way to extract a single file from tar?

I have a large tar file, almost around 150GB. I need a single file from it, and am having trouble even estimating how long it would take to extract. If I do tar -xvf mytar.tar file.txt, nothing ...
0 votes
1 answer
1k views

tar.gz folder and use folder name as name for the archive

I have multiple folders called "runs" in my directory structure that I would like to create seperate archives of because they contain a unmanageable number of files". For this reason, I'd like to use ...
0 votes
2 answers
1k views

How to extract several folders from a very large .tar.gz file on Windows 7?

I have a 150 GB tar.gz file and a Windows 7 machine. I cannot decompress the whole file because it would require a lot of space which I do not have, thus I am looking for a way to extract only several ...
0 votes
2 answers
396 views

add to TAR and split archive of 147k files in a directory

I have to migrate a website where are 147.000 images files in a single folder. I try to compress with gzip / tar but exited without any error message, and the archive file is 0 byte long. $ tar cvf - ...
0 votes
1 answer
42 views

Tar complete vps server does not end - 24 hours

I need to do a complete reinstall. On my VPS Ubuntu 16.04 i got the problem my backup process wont end. I checked the data usage on my hard disk and the usual size is already backed up in less then a ...
2 votes
1 answer
2k views

How to import a previously exported Ubuntu tarball in WSL?

My question is continuation of post https://superuser.com/a/1435841 I had installed WSL, installed Ubuntu app from Microsoft Store, made smth into Ubuntu, then I backed it to tar archive by command ...
1 vote
1 answer
3k views

TAR error — `wp-content: file changed as we read it`

Background I have a bash alias I use to back up a Wordpress home folder. The command is run from /home/waiheke26/sites/www.DOMAIN.co.nz/public The command is: tar --exclude='./wp-content/uploads' \ ...
1 vote
2 answers
96 views

Trying to send a tar over ssh but its being decompressed when sent

Im trying to tar a directory and send it over ssh to another server, but I want it to be sent with tar format not decompressed as the following script does tar -czf - Documents | ssh user@server tar -...
0 votes
1 answer
301 views

send folder via ssh then compress and send it back

I need to send folder with eml files from "A" to "B", then compress them with 7z and send back to "A" what i have is ssh user@server "tar -cf - .folder" | 7z a -si compressed_folder.7z but it makes ...
0 votes
0 answers
2k views

tar does not preserve owner and permissions even when invoked as root

I am attempting to tar files from my hard disk to an external disk, both of which are ext4 filesystems. For some reason, even when invoking tar as root on extraction (which should automatically enable ...
158 votes
2 answers
308k views

create tar with multiple directories and file locations

I have some scripts and files located in various locations like: /etc/dir1 /var/www/html /home/somedir I want to make a tar file so that it copies files and folders with the location structure. ...
25 votes
4 answers
30k views

Is it OK to copy (not clone) a git repository using basic Unix commands?

I’m pretty new to using git and was wondering if it’s ok to copy a Git repository with common UNIX commands (like cp or tar/untag), rather than through git clone. I’m in the situation where I have ...
2 votes
2 answers
2k views

tar reverse of '--to-command', or: compressing tar entries individually, or: tar with plenty of large files

I would like to create tar gzip archive, but do it the reverse manner of what is most commonly done -- have the files in the archive be compressed individually rather than compress the entire archive: ...
0 votes
1 answer
840 views

extract files to a relative path from a tar file that was creating with -P flag

I'm creating a tar file using the -P flag, meaning that all paths are absolute (leading / is not stripped from files names). I use it because I'm tarring multiple directories and I need each file to ...
1 vote
1 answer
291 views

How to remove make error during uboot build in altera arria 10?

I am building Linux OS for our custom board which uses Altera Arria 10 SoC. My Linux Version is 14.04 and by taking reference from below link, I am designing Uboot https://www.intel.cn/content/www/cn/...
0 votes
1 answer
947 views

Extracting a file in solaris

I'm try to extract a file in solaris to a folder. I have tried following combinations but no luck. gunzip -c jdk-8u211-solaris-sparcv9.tar.gz > /opt/java/jdk8.2.11 I'm getting a is directory ...
0 votes
1 answer
7k views

How to tar up multiple folders, some recursively, some non-recursively

I have a list of directories. Some of the directories require them to be tared up recursively, other require only the file that exist in that directory, no subdirectories: Using the directory/files ...
5 votes
3 answers
10k views

Using find and tar with files with special characters in the name

I want to archive all .ctl files in a folder, recursively. tar -cf ctlfiles.tar `find /home/db -name "*.ctl" -print` The error message : tar: Removing leading `/' from member names tar: /home/db/...
-1 votes
1 answer
2k views

Updating Windows 10 Enterprise LTSB

I was wondering if someone could help me figure out how to update Windows 10 Enterprise LTSB. Specifically, I am wanting to get the tar command that is in the more recent builds of Windows 10. I have ...
0 votes
0 answers
35 views

How to restore a specific file using a backup in Debian

I have a file which has become corrupt and is making my machine malfuntion, i have a system backup as a .tgz file, i want to restore this specific file using the file in the backup, but i dont want ...
85 votes
17 answers
103k views

Untar, ungz, gz, tar - how do you remember all the useful options?

I am pretty sure I am not the only one with the following problem: every time I need to uncompress a file in *nix I can't remember all the switches, and end up googling it, which is surprizing ...
1 vote
1 answer
50 views

Emailing 13MB base64 creates extra 19MB .com

My daily backup script had to be changed to create base64 file instead of regular .tar.gz a while ago: Filename64="$Filename".64 cat "$Filename" | base64 > "$Filename64" echo -e "to: $EmailAddr\...
1 vote
1 answer
435 views

Why does each subsequent append to a tar archive take longer?

I am constructing a tar archive of size 4.2T in increments of ~440Gb. The timing to complete each of the increments (sections) is given below. Section 1 [486.01 seconds] Section 2 [623.42 seconds]...
1 vote
1 answer
624 views

tar command for getting files for periodic backup

What tar command should I use to get files changed after a given date--including changes to ownership, permissions, etc.--but excluding files that were simply restored from backup? On the other hand, ...
0 votes
1 answer
301 views

Serving tar.gz file through AWS Cloudfront?

I would like to keep things tidy on the S3 bucket where my website's assets live. Currently I am uploading all assets to S3, as part of the CI/CD pipeline, this has got a bit messy since generated ...

1
3 4
5
6 7
16