Questions tagged [tar]

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

Filter by
Sorted by
Tagged with
-2 votes
1 answer
44 views

tar: Exiting with failure status due to previous errors

I running $ cat /etc/*-release PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=...
user3523406's user avatar
0 votes
2 answers
41 views

container options from linux other than tar that work in Windows

I have Windows 10 pc's that do not have winzip or 7zip, or any kind of compression software installed. do not ask why As such the windows10 pc's can only do an unzip. They are unable to work with a ....
ron's user avatar
  • 6,647
0 votes
2 answers
64 views

tar says Cannot open: No space left on device but df -h and df -i both show the available space is very large

I have around one hundred .tar files and they include millions of small files. I want to extract them to one directory in Linux. These .tar files are on a mounted LVM EXT4 file system. But no matter I ...
Lesterth's user avatar
3 votes
1 answer
66 views

Why is Tar speed not same?

I heard somewhere on the Internet that cpio is faster than tar. So I tried to check it with my shell script. #1/bin/bash rm ct.tar ct.cpio sync && sudo sh -c "/usr/bin/echo 3 > /proc/...
gdhong's user avatar
  • 31
1 vote
1 answer
61 views

GNU tar how to preserve file immutable attribute set by "chattr +i" in Linux?

I want use tar(GNU tar 1.30) to backup files with immutable attribute set by "chattr +i" in Linux. Command lines below: mdx@e5450:~$ touch test.txt mdx@e5450:~$ sudo chattr +i test.txt mdx@...
littlebat's user avatar
0 votes
1 answer
33 views

Archiving stdout to multiple tapes

I have large files which are generated on the fly to stdout, one every 24hours. I would like to archive these files progressively on tapes, ideally in a single archive which potentially spans multiple ...
lorenzo's user avatar
4 votes
2 answers
493 views

Untar files from a huge tarball, but only created between two timestamps

I would like to untar only that files created between 2024-02-19 01:00:00 and 2024-02-19 02:00:00 from a huge tarball. I don't know how should I combine the tar and the find commands, because I can't ...
tazvagyok's user avatar
0 votes
1 answer
44 views

Why does GNU tar's --dereference option not cause it to dereference symlinks?

I thought I knew how GNU tar -h (aka --dereference) worked, but now I am confused. Consider: $ tree dir/ dir/ ├── file └── link -> file 1 directory, 2 files If I add -h to my tar command, shouldn'...
Brad Spencer's user avatar
0 votes
3 answers
117 views

Is it possible to obtain .tar from .tar.bz2?

I need to extract a specific folder from .tar.bz2 (34G). The issue is that it takes 1 hour. I guess that this is due to the compression. I guess that w/o compression extraction of a specific folder ...
pmor's user avatar
  • 609
1 vote
2 answers
119 views

Looking for a tool that creates plain text tarball from set of files, they can be mailed in email body

I'm looking for a command line tool that takes a tarball, uncompresses and unpacks it, and turns the contents into one contiguous file, comprised of lines that are a maximum of eighty characters wide, ...
Joselin Jocklingson's user avatar
0 votes
1 answer
42 views

tar: don't change date if file is the same

I'm using tar to extract files during a deployment process. I've noticed that systemctl issues a warning that daemon-reload must be run if a .service file has its timestamp changed, even if the file ...
mustafa.0x's user avatar
4 votes
1 answer
405 views

Is there way to make tar execute a script when switching tape drives?

My company has a dual Dell LTO-7 drive. I've recently discovered that it's possible to automatically back up to two tapes, sequentially: tar -cv --multi-volume --file=/dev/nst0 --file=/dev/nst1 ...
bolind's user avatar
  • 151
0 votes
0 answers
37 views

rsync synchronising a sub-folder while respecting the original folder exclusion rules

I have a bash script which synchronises a source folder to a destination folder in the presence exclusion rules. something akin to rsync -l -a -no-g --delete --exclude $PATTERN $SRC $DST I would like ...
Serge's user avatar
  • 121
0 votes
1 answer
60 views

Does there exist a tar implementation that exits 0 when an error occurs?

Vim runtime commit 3d37231437fc0f761664a7cabc8f7b927b468767 tries to fix a tar-editing plugin by removing the assumption that a filename doesn't contain the words warning, error, inappropriate or ...
D. Ben Knoble's user avatar
4 votes
2 answers
471 views

During tar extraction, can I automatically make the files not executable?

I have a tar.gz archive that contains some executable files. Is there a way to automatically make them not executable when I extract the archive? I tried using the --mode flag but it apparently did ...
hugomg's user avatar
  • 5,777
0 votes
0 answers
95 views

Tar command provides slightly different outputs when run from BASH script vs running manually

I am trying to run the following script: #!/bin/sh pm2 stop process cd ~/userdata/ tar -czvf backup.tar.gz Config mv backup.* ~/backups/ pm2 start process ...
thefatkid22's user avatar
1 vote
1 answer
118 views

Why can't I open Tar.gz archive with colons or commas in filename?

I have a 4Gb tar.gz archive downloaded from a Linux server machine. The machine we are on is a Zorin 16 OS machine. I am using both Nautilus / Archiver (file-roller I think it is) / Xarchiver We have ...
Martin's user avatar
  • 139
-1 votes
1 answer
37 views

Error installing Geckodriver

I need to download this file : "https://github.com/curl -s https://github.com/mozilla/geckodriver/releases | grep -E -o '/mozilla/geckodriver/releases/download/[a-z0-9/.-]{5,}linux64.tar.gz' | ...
pwwoxzhw's user avatar
0 votes
1 answer
214 views

How to compress multiple files quickly using tar

I need to transfer multiple files to a HPC cluster. Currently, I've been using the scp command but it takes about 10 minutes or more to transfer one file (about 1.4GB each). I've seen that using tar ...
Shayma 's user avatar
-1 votes
2 answers
142 views

tar alternative to bsdtar --include

I'm trying to adapt a script that uses bsdtar, which is not available on my Linux distribution. bsdtar -x -f <file> --include="SOME/FOLDER/" What is the alternative of --include in ...
mkrasowski's user avatar
2 votes
3 answers
292 views

specify different --mode values using GNU tar

I am trying to use GNU tar to create a tarball from a directory stored on a network drive. This network drive defaults the mode of everything stored on it to 0700 (-rwx------) and cannot be changed ...
leetbacoon's user avatar
0 votes
1 answer
61 views

Tar through ssh - how add exclude in one line command from local pc

ssh [email protected] tar cvpf - /root/1 > /home/user/arc.tar.gz need add --exclude=/root/1/2 i try and not work: ssh [email protected] tar cvpf - /root/1 > /home/user/arc.tar.gz --exclude=/root/1/2
ывапав's user avatar
0 votes
2 answers
76 views

Archive files with GNU tar after removing leading directory path

I would like to flatten and archive the following structure: ├── a │   └── a.txt ├── ... │   └── ... └── z └── z.txt in this tar archive: a.txt ... z.txt I could, for example, flatten the ...
gipert's user avatar
  • 153
0 votes
0 answers
216 views

Concatenating two tar files

I have two large files, a.tar.xz and b.tar.xz. Since they are two consecutive versions of the same application, if I combine them I will get a file that is much smaller than the sum of the sizes of ...
k314159's user avatar
  • 445
1 vote
0 answers
55 views

gtar recursively untar but leave in top directory

I am trying to recursively untar a whole lot of directories that have .tar files in them, but without creating any new subdirectories. I am successfully able to do one at a time with this command gtar ...
bk_32's user avatar
  • 111
2 votes
1 answer
51 views

time difference of rm single tar file between large and small size

If I have a file data.tar and one is 1 MB in size versus one that is 10 GB in size versus one that is 10.0 TB in size (yes 10 terabytes is correct) why is there a time difference in doing a rm on ...
ron's user avatar
  • 6,647
1 vote
2 answers
117 views

Delete files older than 15 days except for monthly and annual versions

I use a simple find script to delete backup tar files older than 30 days, but in the interest of historical preservation and having the ability to look back further, I'd like to switch to keeping the ...
user162124's user avatar
0 votes
2 answers
289 views

How to have an archive with full paths, BUT without creating a tarbomb?

I want to create an archive file that preserves the absolute path information of the originals, but I have not been able to find a way to do this that does not result in a tarbomb? For concreteness, ...
kjo's user avatar
  • 15.3k
-1 votes
1 answer
48 views

How can I evaluate tars and gzips for validity without expanding them?

LONG ago I wrote a backup script for our site and have updated it ever since. However, occasionally things go wrong and some of the older backups are now broken. In days gone by I had used the utility ...
Richard T's user avatar
  • 192
0 votes
3 answers
252 views

How to keep permission for migrating Files and Directories from one linux to another

I need to migrate files and directories from one machine to another using tar. I would like to use tar or something similar. But I don't have a root permission. As far as I know "To extract file ...
SBMVNO's user avatar
  • 103
0 votes
0 answers
33 views

create a compressed tar archive from files extracted from another tar archive [duplicate]

I'm trying to do what I specified in the object. I have a tar.gz archive (i.e. archive.tar.gz) and I want to: extract only some file (e.g. *.csv) contained in a specific folder of the archive (e.g. ...
Angelo's user avatar
  • 1
-1 votes
1 answer
186 views

To tar creating from a directory by omitting top directory

How do we do tar to create/extract from/to a directory with omission or cutout or drop of the head/top directory name ?
user avatar
7 votes
1 answer
645 views

Why does tar's handling of stdout and - differ?

After a comment from OP, I discovered that /dev/stdout gives blocks of 10 KiB even after disabling buffering, but - does not. Why is this? I could not find anything regarding this in man tar nor man ...
wjwrpoyob's user avatar
  • 440
2 votes
3 answers
715 views

Why is uncompressed tar much faster than rsync?

I'm currently looking for a way to improve my system backup performance and realized the following during some tests: Backing up my Ubuntu system from an SSD to an HDD (both ext4) using TAR without ...
suamikim's user avatar
  • 125
2 votes
1 answer
146 views

Merge the split file vs Original compressed file

On Ubuntu 22.04, I found these 2 methods will get different sha256 of archive_tgz tar czf /a/archive_tgz . tar czf /dev/stdout . | split -d -b 200M - /a/archive. && cat /a/archive.* > /a/...
Azreal's user avatar
  • 45
2 votes
0 answers
161 views

POSIX compatible TAR for AIX and Solaris

I have created a TAR archive with our product using maven-assembly-plugin. The TAR archive is in the POSIX format. Our QA complains about PaxHeaders.X files when extracted. Do the AIX (version AIX 7.1 ...
wilx's user avatar
  • 598
0 votes
1 answer
281 views

How to split and combine large tar ball file?

I have this code to split large backup files into smaller chunks that can be saved on the FAT32 filesystem. split -b $(echo "6*(2^30)-1" | bc) --verbose $1/jcubic.tar.gz $1/jcubic.tar.gz- I ...
jcubic's user avatar
  • 9,962
4 votes
2 answers
743 views

Piping of stream from wget to tar

I want to download the Linux kernel and unarchive it in one step. There are a lot manuals about it. So I tried: $ wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.3.1.tar.xz | tar -xav -C /...
Андрей Тернити's user avatar
0 votes
0 answers
2k views

tar: Cannot create symlink to XXXX: Operation not permitted

The context: I am on an Ubuntu VM (VirtualBox). I created the VM with limited disk space. My use of it has evolved beyond what I initially envisioned. I am using a large footprint analysis/design ...
user2153235's user avatar
-2 votes
1 answer
836 views

Untar multiple files in a directory

There are multiple .tar files in a directory. I am trying to extract them all. The following command works for a in $(ls -1 *.tar); do tar -xvf $a; done But when I try following command, it prints ...
Ahmad Ismail's user avatar
  • 2,678
2 votes
1 answer
181 views

Is it safe to delete GNUSparseFile.0 directory?

While looking through some filesystems to see what consumes disk space I found out a directory called GNUSparseFile.0. I can't easily find out if its contents are used. Can it be some temporary ...
filo's user avatar
  • 193
0 votes
0 answers
299 views

Copying all files and folders of a directory using tar

I am trying to copy my files from ssd to external hdd using linux live boot. The command I'm writing is: root@ubuntu:/media/ubuntu/4bd92f4b-6b48-4f4a-83ad-9d82d3be488b/home/pegasus# tar cf - Downloads ...
Zeshan Ahmed Nobin's user avatar
0 votes
0 answers
654 views

How to extract .gtar file?

I have a .gtar file, I wanted to extract it, but it is not getting extracted. Below are the methods I have tried with its output. I supposed to be contained bunch of text files. $ gtar -xf file.gtar ...
Subramanya Krishna's user avatar
0 votes
2 answers
636 views

BusyBox's tar --exclude doesn't exclude

Extract a tar file with content dir1/dir2/file, using --exclude dir2 switch. The gnu tar excluded but busybox's tar doesn't. Use --exclude dir1/dir2 works fine, but why? Is there a way to exclude any ...
kkocdko's user avatar
  • 101
3 votes
1 answer
116 views

tar files with backslahes on Debian

I need to copy files that contain (Windows-style) backslahes from a Debian 10 pod. I'm having trouble with GNU tar 1.30 archiving files with backslashes: docker run --rm -it debian:10 bash inside the ...
h q's user avatar
  • 133
0 votes
1 answer
118 views

tar multiple files starting with same pattern then spaces in between the file name

I am trying tar files from a directory which has files starting with same pattern then multiple spaces in between. e.g.: ABCDEFGH Mar 09 20:02:00 2023 log.TXT.0 ABCDEFGH Mar 09 20:05:00 2023 log.TXT.0 ...
JitheshPP's user avatar
0 votes
1 answer
368 views

Is possible compress and uncompress a file with a password but considering an expiration date too?

In Linux about compression files can be accomplished with the tar and zip/unzip commands, perhaps more. I know that is possible establish a password protection for security reasons. The question is: ...
Manuel Jordan's user avatar
0 votes
1 answer
98 views

I get error when I want to extract tar file in the satrap folder

I am new in Linux , when I want to extract the tar file in the folder satrap I get this error : You may not specify more than one `-Acdtrux' or `--test-label' option Try `tar --help' or `tar --usage' ...
sami's user avatar
  • 3
0 votes
1 answer
46 views

tar exclude folders ignored when called from bash function

The following code didn't work, exclude folders are ignored by tar. How can I fix that ? Please note I may have multiple exclude folders and multiple folders to backup. date=`date +%Y%m%d` # ...
user518171's user avatar
1 vote
1 answer
2k views

Normal gz file not extractable by tar [duplicate]

I have a gz archive but for some reason tar said that the format is incorrect even though I can double click it in mac Finder and extract it normally, and file command shows the same format just like ...
phuclv's user avatar
  • 2,086

1
2 3 4 5
26