25
votes
How uncompress tar.lz file
There's no need to install new software! At least on MacOS 10.15 tar has the option --lzip that decompresses .lz files. For instance:
tar --lzip -tf gmp-6.2.0.tar.lz
gives me
gmp-6.2.0/
gmp-6.2.0/cxx/...
19
votes
Accepted
Tar excluding ._ files
To suppress the creation of AppleDouble ._ files, use: --disable-copyfile
Example: tar --disable-copyfile -cf file.tar file
17
votes
How uncompress tar.lz file
I use lzip, which I compiled from source code, however it can also be installed with Homebrew:
brew install lzip
See also: Lzip
You also need to have Command Line Tools for Xcode installed in ...
10
votes
How uncompress tar.lz file
I'm agree with @John Perry no need to install.
Tested on my mac Mac OS Catalina (10.15.7)
To see contents of yourfile.tar.lz file
tar --lzip -tf yourfile.tar.lz
To extract contents of yourfile.tar.lz
...
9
votes
Tar excluding ._ files
The accepted answer didn't work on MacOS Monterey (V 12.4). The tar is bsdtar and the man page revealed that there's a separate option to be specified --no-mac-metadata
$ tar -czv --no-mac-metadata -f ...
8
votes
What exactly is chflags opaque, nodump?
The nodump file flag can still be used by macOS. Apparently, the opaque file flag has never been used by macOS or OS X since at least Snow Leopard.
Here is an example of the use of the nodump file ...
7
votes
Why does .tar.gz automatically extract the GZip archive when I download it in Safari?
Disable 'Open "safe" files after downloading'.
Safari > Prefs > general
7
votes
Accepted
Create tar archive with xz compression?
Looking at the source code for the libarchive package from Apple Open Source for OS X 10.8.5, 10.9, 10.10, and macOS 10.12.3, of which contains the source code for bsdtar, it includes the ability to ...
5
votes
Accepted
If I used tar to archive Time Machine's Backups.backupdb folder, can the resulting file be uploaded to a cloud service and later used without issues?
Creating an archive with tar (using the -c option) does by default preserve hard links. I.e. the file will only be stored once in the archive, and when you unpack the archive you'll get hard links on ...
4
votes
Accepted
What exactly is chflags opaque, nodump?
Short answer: nothing particularly relevant on modern macOS.
Long answer: both of these flags relate to Unix features that you probably never use.
The opaque flag relates to "union mounts" -...
4
votes
How can I extract multipart tar files from the command-line on macOS?
The tar command-line program on macOS only supports a single filename as an argument. However a valid workaround is to concatenate multi-part tar archives and pipe this to tar's standard input. This ...
3
votes
Accepted
tar: could not chdir to 'dirname' when using -C with tar
man tar tells you the issue
-C directory, --cd directory, --directory directory
In c and r mode, this changes the directory before adding the following files. In x mode, change directories after ...
3
votes
Is there a way to suppress valid files beginning with dot (.) in a tar archive giving false errors and files?
A more refined search brought up:
http://xahlee.info/UnixResource_dir/macosx.html
https://norman.walsh.name/2008/02/22/tar
using export COPYFILE_DISABLE=true before extracting the archive prevents ...
3
votes
What exactly is chflags opaque, nodump?
They are POSIX standard flags defined in stat.h and any unix program can read them with the stat call and the system writes and removes them in a standard pattern for compatibility with the dump and ...
3
votes
How can I de-compress a source file on my basic MacBookAir (macOS Sierra Version 10.12.2)
You can find out the type of find using the file command in Terminal. In this case we get:
# file 1610.01410v2
1610.01410v2: POSIX tar archive (GNU)
So, you can open it up using tar, from the ...
3
votes
Does OSX 10.10.4 support LZMA compression at the individual file level (not tar files)?
XZ support on macOS isn't broken, it's just restricted to tar. :-)
There is nothing to worry about using Homebrew though. Head over to brew.sh to get started and then run brew install xz to install ...
2
votes
Tar excluding ._ files
In recent macOS versions --disable-copyfile option suggested in other answer might do nothing, but tar seems to honor COPYFILE_DISABLE environment variable. Use it like this:
COPYFILE_DISABLE=1 tar -...
2
votes
Updating rsync through Homebrew vs updating through .tar download
When you install rsync through HomeBrew an additional patch with a bugfix is applied to the code before it is compiled and installed on your system. You will not (automatically) get this patch when ...
2
votes
Unpacking a tarball via terminal like the Finder
The option you are looking for is --strip-components (from man tar):
--strip-components count
(x mode only) Remove the specified number of leading path elements.
Pathnames with fewer ...
2
votes
Accepted
Is it safe to create a tarball of a Time Machine backup?
tar does not preserve all the information in the HFS filesystem.
I would look at having it converted to a image file instead. I believe Disk Utility can do this for a folder.
2
votes
Accepted
How can I uncompress a tar.xz thats been compressed on ubuntu and uncompress it on mac with the archive utility?
Archive Utility doesn't currently support .tar.xz files. You can provide feedback to Apple at apple.com/feedback.
While Terminal can uncompress .tar.xz as you note, if you're looking for a GUI-based ...
grg♦
- 206k
1
vote
Could a 163-bytes size difference between the tgz of two different 590mb dirs be caused just from file metadata? Or is the file data diff?
does such a tiny size difference indicate these are different MRI scans? Is there a better way to detect duplicates of this type of data?
A tiny size difference could mean they are two completely ...
1
vote
How to extract How uncompress .tar.lrz file?
You need the lrzuntar command, which is yet-another-compressor (it seems it's basically LZMA) in a package called lrzip. You can install it via Homebrew:
brew install lrzip
1
vote
Error while making automator service to archive files with tar
Adapted version of your script that works in Monterey (bash), but only for files, not folders
files=()
path=''
file=''
for f in "$@"
do
path=$(dirname "$f")
file=$(basename ...
1
vote
Accepted
Cron job can't access Documents - "Tar: Desktop: Couldn't visit directory: Unknown error: -1"
To resolve the issue, add cron and tar to: System Preferences > Security > Privacy > Full Disk Access
To address your comment, "I had to do this for both cron and tar, even though tar is ...
1
vote
Compress file as .tar.gz instead of .zip
You can try to write a unix shell script where your commands are to tar the selected files then run gzip on it.
Then you can make this a service and save it at ~/Library/Services. Then enable it via ...
1
vote
Accepted
tar cvfz command not writing on iCloud Drive folder
You need to place the file in this folder instead:
~/Library/Mobile\ Documents/com~apple~CloudDocs
This is where you can place generic files, similar to saving them in "iCloud Drive" in the Finder.
...
1
vote
tar is giving a symbol error in a bash install script?
In your example you are using bsd/macos curl with gnu tar, that won't work. Unfortunately many dev programs rely on the apple bash and trying to upgrade things to gnu can break bash scripts.
brew won'...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
tar × 38macos × 15
command-line × 14
compression × 6
terminal × 4
archive × 4
backup × 3
zip × 3
archive-utility × 3
mac × 2
time-machine × 2
bash × 2
unix × 2
dmg × 2
icloud × 1
applescript × 1
safari × 1
applications × 1
security × 1
automator × 1
google-chrome × 1
snow-leopard × 1
memory × 1
filesystem × 1
mac-mini × 1