Questions tagged [tar]
An archive file format (and the program that reads it) commonly used on Unix and Linux.
780
questions
0
votes
1
answer
41
views
tar on Windows does not handle paths with special characters
On a Windows 10 command line, creating a tar archive with "special" characters (e.g. extended latin) in the path of the archive itself results in errors.
To be slightly more exact, a quick ...
3
votes
2
answers
5k
views
Are cp/rsync asynchronous?
We're running a backup script which first copies a file to a destination and then runs tar over it.
DIR2BCK='/foo/bar'
TMPDIR=$(mktemp -d)
rsync -a ${DIR2BCK} ${TMPDIR}/ > /dev/null 2>&1
...
0
votes
1
answer
28
views
Create a archive split into blocks of a maximum size using Windows shell
As example. I want to compress a directory of 100GB split into 10 archives of 10GB using cmd or powershell, non-interactive without installing additional tools. Using tar would be awesome but ...
0
votes
4
answers
5k
views
How to open tar gz file created using tar piped to gzip
I wanted to generate a tar gz file with the highest compression level, and I followed the solution from https://superuser.com/a/546509/461740:
tar cv /path/to/directory | gzip -9 > file.tar.gz
...
20
votes
7
answers
68k
views
how to copy entire linux root filesystem to new hard drive on with ssh and tar
I need to transfer an entire linux root filesystem off of a failing hard drive onto another computer with an open, available partition. I've pretty sure this involves tar and ssh, but I can't remember ...
131
votes
10
answers
614k
views
How to open a .tar.gz file in Windows?
I need to open a file that sadly is only available in the .tar.gz file format and I am using Windows 7. I can unzip the file using 7-zip but after that I still have a .tar file that I can't open in ...
2
votes
1
answer
4k
views
Tar without directory structure and exclude folders
I am trying to create a tar file [site.tar.gz] to exclude certain folders and without the parent directory structure:
I am able to exclude folders, but when I extract, I see path from the root
tar -...
0
votes
1
answer
62
views
Windows tar command: exclude folder in current folder but not subfolders
I am trying to archive some folders with the tar command in Windows, and I would like to exclude a directory in the current folder, but not in subfolders.
The example below is using the technique ...
0
votes
1
answer
3k
views
How do you extract a file using tar in AIX?
On a NORMAL Unix distro, tar zxvf works but seems like my machine has some super old version of tar that doesn't have the right parameters.
-bash-3.00$ tar zxvf qemu-1.7.0.tar.bz2
Usage: tar -{c|r|t|...
0
votes
0
answers
45
views
tar give exception when preserve permission/specials files across filesystems
I am using the following tar command and tar flags in order to preserve hard and symbolic link & permissions on RHEL 8.6 version
but we get the exceptions about tar: '--same-order' cannot be used ...
1
vote
1
answer
36
views
The files after extracting a tar
I recently start to use tar to backup my files on macOS.
I usually use:
tar cvf archive.tar foo bar
and i also run this to check:
tar tvf archive.tar
It would show the following and it seems okay:
-...
0
votes
2
answers
59
views
Find strange TAR archive format
I have some file that can be extracted with tar:
tar -tvf attachment.tar
But when I test it with file I have this result:
attachment.tar: uuencoded or xxencoded text, ASCII text, with CRLF line ...
1
vote
0
answers
58
views
Is there anyway to make `tar -xf file.tar output_folder` command faster for an uncompressed file?
I'm working with a Linux system and frequently use the tar command to extract large .tar files.
I'm running tar -xf file.tar output_folder to extract a .tar file into a specific output folder.
I've ...
0
votes
2
answers
1k
views
Find get the files I want,the pipe to xargs and Tar don't
I'm using the following command line:
find . -mtime -15 -mtime 0 -print0 | xargs -0 tar cjvf /home/user/adjuntos.tar.bz2
The left side of the pipe works like a charm, but the right side of the ...
1
vote
1
answer
158
views
Shell command to tar directory excluding certain folders
In Bash 4, I want make a tar.gz with excluded folders, and while tons of answers about this simple case exist, nothing works in my case.
I would like to keep the directory mentioned in exclude, ...
0
votes
0
answers
26
views
restoring symlinks for transferred cygwin system
I backed up a portable cygwin installation the old way: in a simple tarball with tar -cvf cygwin; then I tried to restore it on a portable hard drive the old way: with a simple tar -xvf cygwin. The ...
2
votes
2
answers
4k
views
Convert .tar.gz/.tar.bz2 to .7z in batch?
How do I convert .tar.gz and .tar.bz2 files to .7z files using the command line?
27
votes
6
answers
10k
views
How do I create a tar file in alphabetical order?
I want to create a tar file where all of the directories and files are processed in alphabetical order. This is for the entire directory hierarchy that's being tarred up, so it would start by ...
6
votes
3
answers
4k
views
archiving files without timestamp
I need to archive some files deterministically,
so that I get the same archive file if the content of the files is the same.
I need this for testing for equality of the archive files later.
however, ...
0
votes
1
answer
4k
views
How to batch extract from archive using tar to directories
I m trying to extract files contained within a directory in a tar.gz file. The extract I m using is tar zxvf foo.tar.gz. It extracts the files from the archive but removes them from the directory they ...
223
votes
6
answers
278k
views
How to specify level of compression when using tar -zcvf?
I gzip directories very often at work. What I normally do is
tar -zcvf file.tar.gz /path/to/directory
Is there a way to specify the compression level here? I want to use the best compression ...
13
votes
5
answers
33k
views
Concatenate multiple tar files in one command
I receive anywhere from 4 to 100 very large tar (~20GB) archive files everyday. I have been concatenating them in the past by looping through each of the archives I see on the file system and doing ...
0
votes
0
answers
24
views
crontab tar archive on macOS not recursive
I have a script to archive a directory on macOS:
#!/bin/sh
BACKUPNAME=$(date "+%Y-%m-%d@%H:%M:%S")
BACKUPNAME="local-vaults-$BACKUPNAME.tar.gz"
tar czfh "/Users/henrik/...
0
votes
2
answers
7k
views
Creating a tar with a absolute path
tar -cf /Users/Files/myfile.tar /Users/Files/
I am basically trying to create a tar containing the contents of User/Files and create it in the folder of the contents.
I can only execute this process ...
0
votes
2
answers
4k
views
One-click to create and extract .tar.gz files in Windows?
I'm using 7-zip latest alpha version (9.30) and I find it really inconvenient that, if I want to create a .tar.gz archive, I have to create a .tar archive first then add it to a .gz archive later.
So ...
1
vote
1
answer
95
views
Verify data integrity of tar outputting through ssh
I am creating a backup script which uses tar, encrypts it with gpg and then sends the output through ssh to an offsite host. I am now wondering weather and how I can verify that all of the data is ...
0
votes
1
answer
147
views
Are .tar.gz files made in Linux with identical files identical to .tar.gz files made in Windows?
I've produced a .tar.gz file in Windows that contains some files to update firmware via a Linux Device. The update failed to take, and a Coworker mentioned the problem was because the .tar.gz did not ...
0
votes
1
answer
187
views
When tar the same two packages,its md5 are not same
There are two packages with a file in it.
[root@build-production test]# ll
drwxr-xr-x. 2 root root 19 9月 18 07:58 pack1
drwxr-xr-x. 2 root root 19 9月 18 07:58 pack2
[root@build-production test]# ll ...
0
votes
0
answers
45
views
How do I install libraries if I don't have the config file
How do I install the libraries if I don't have the config file, and in addition to not having the configure file, they come with an extension. I have followed the instructions, I have placed the ...
0
votes
0
answers
61
views
What are these pax tarball characteristics and comments?
I created a pax archive with GNU tar 1.34 under Debian 11 and, upon viewing the tarball in 7-Zip (23.01) File Manager on Windows 10, I noticed these fields on the archived items:
Name
Characteristics
...
2
votes
3
answers
6k
views
Error extracting tar.xz files in Windows using command line
I have a bunch of tar.xz files I need to extract. I tried using the following command, but get an error.
tar -xJf "S:This_Is\the path\to_my_file.tar.xz"
tar: Error opening archive: Can't ...
3
votes
1
answer
3k
views
Change root folder name in tar.gz file
I have a tar.gz file, specifically: http://download.oracle.com/otn-pub/java/jdk/8u20-b26/jdk-8u20-linux-x64.tar.gz. I am going to download this, change it and stick it in my own repository.
I wish to ...
15
votes
3
answers
34k
views
How do I remove the full path when doing a tar.gz compression?
I'm using this command to archive a directory named g from Java code:
tar czf /a/b/c.tar.gz /e/f/g
When the tar file c.tar.gz is created, I find an entire path e/f/g then all files of the g folder ...
0
votes
0
answers
236
views
Windows Tar Command for Tape Drive
I am trying to generate a command using GNUTar for backing up a folder on Windows 10 to a few tapes (hence my use of multisession). I am using an elevated command prompt window and have cd-ed into the ...
0
votes
0
answers
68
views
How to compute the total size of files included by tar after exclude flags?
I'm building on the answer here to write a backup script. The script I have is roughly
backup_files="/etc /home"
excludes="--exclude-vcs --exclude-ignore-recursive=.tarignore"
#(...
0
votes
1
answer
2k
views
How to install XDM on Linux Ubuntu
I'm trying to install the latest version of xdm on Ubuntu 16.04 LTS from the official website http://xdman.sourceforge.net/ ..
I managed to extract it, but i couldn't insall it! .. Any help? here's ...
118
votes
11
answers
62k
views
Linux / OS X tar incompatibility – tarballs created on OS X give errors when untarred in Linux
When I tar up files on my Macbook and untar them in Linux, I repeatedly get the following warnings/errors:
tar: Ignoring unknown extended header keyword `SCHILY.ino'
tar: Ignoring unknown extended ...
1
vote
0
answers
38
views
Reading tar tape with blocking factor 2048 on CentOS 7
I am trying to read a tar tape on CentOS 7 which was written on CentOS 5. I used blocking factor 2048.
I can read tapes written with blocking factor 1024, but not 2048. Attempting to read the tape ...
3
votes
2
answers
318
views
Splitting tar archives and uploading them one at a time
I want to backup my systems to split tar archives with a script uploading them one by one. It has to create the split archive and then run a script. The script uploads the part and deletes it. This is ...
5
votes
2
answers
7k
views
How to convert .tar.gz to .tar.xz?
How to convert .tar.gz to .tar.xz?
I have a bunch of .tar.gz files that I would like to convert to .tar.xz for a better compression.
How to do this efficiently? A command like this would be great: How ...
0
votes
0
answers
227
views
tar:java/xxx:Cannot create symlink to : java/xxx : Permission denied
OS: Chromeos 114.0.5735.205 (Official Build) (32-bit)
Kernel:Linux penguin 5.15.108
Architecture:aarch64
trying to install jdk ,
I ran :
tar zxvf jdk-20_linux-aarch64_bin.tar.gz --no-same-owner
got ...
3
votes
1
answer
358
views
Behavior of tar --exclude-ignore not as expected
If I have the file structure
dir/
dir/.ignore
dir/file.ext
dir/subdir/
dir/subdir/other_file.ext
where dir/.ignore contains one line, *.ext, then I would expect the command
$ tar -czvf dir.tgz --...
0
votes
0
answers
93
views
Is it possible to recover a tar.xz file with the wrong hex header?
I have a compressed file in tar.xz format, when I try to open it with 7zip it gives the following error:
Cannot open the file as [xz] archive
Errors: Is no archive.
I checked the file in a hex editor ...
0
votes
0
answers
2k
views
An error occurred while installing .NET (7.0): .NET Acquisition Failed: I
Here is the error that keeps popping up with my experience during this problem (Ubuntu/os) :
An error occurred while installing .NET (7.0): .NET Acquisition Failed: Installation failed: Error: ...
0
votes
0
answers
150
views
Error when recombining multipart TAR file
I created a multipart tar file based on the instructions in this post. But when I try to recombine and untar, I'm getting an error message.
To create a multipart tar from a large directory, I did the ...
91
votes
4
answers
58k
views
Equivalent to tar's "--strip-components=1" in unzip?
I have a script that extracts a tar.gz-file to a specified subdirectory mysubfolder:
mkdir mysubfolder; tar --extract --file=sourcefile.tar.gz --strip-components=1 --directory=mysubfolder;
Is there ...
1
vote
2
answers
460
views
Decompressed a .xz file and now it has no extension and is not a directory
I had a directory of files that I compressed using:
tar -cvJf my_directory.xz my_directory
Now I've gone to decompress it using:
xz -dv my_directory.xz my_directory
and the resulting file is simply ...
3
votes
2
answers
4k
views
Decompress a tar.xz file using all cores
I have 37 GiB File which was created by tar + xz. I have a server with 6 cores, so for maximum compression speed I want to use all my 6 cores using this command
XZ_OPT='-T0 -9 –memory=75%' tar -cJf ...
45
votes
3
answers
76k
views
How do I tar ball a directory hierarchy with soft links in Linux?
How do I tar ball/compress a directory hierarchy with soft links in Linux?
5
votes
2
answers
974
views
How to list only tar files
I have a silly problem
usr01@srvlnx01:~$ sudo ls /var/opt/gitlab/backups/
1685014011_2023_05_25_13.2.3_gitlab_backup.tar 1685016443_2023_05_25_13.2.3_gitlab_backup.tar tmp
but
usr01@srvlnx01:~$ ...