this post was submitted on 12 Mar 2024
9 points (100.0% liked)

Programmer Humor

32068 readers
759 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

source

img title="I don't know what's worse--the fact that after 15 years of using tar I still can't keep the flags straight, or that after 15 years of technological advancement I'm still mucking with tar flags that were 15 years old when I started."

top 19 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 6 months ago (1 children)

A little trick I learned on here was to imagine yourself as a little evil man saying "Extract ze files!" in a German accent. Extract ze files >>> xzf.

[–] [email protected] 1 points 6 months ago

Only works for tar.gz. Remember there's also tar.xz, tar.bz, tar.bz2 and half have their own extractor flag. FUN. It's usually J.

[–] [email protected] 2 points 6 months ago

Wouldn't tar --help suffice? Afaik, it returns exit code 0.

[–] [email protected] 1 points 6 months ago (1 children)

If you can't tar to a pipe into ssh to a remote host and untar into an arbitrary location there, are you really using Unix?

[–] [email protected] 2 points 6 months ago

I had to pipe dd through gzip over SSH recently to locally image a disk on a cloud server. That was fun.

[–] [email protected] 1 points 6 months ago

Surely tar --help is a valid tar command, right?

[–] [email protected] 0 points 6 months ago (1 children)

tar -xzvf archive.tar.gz

eXtract Zhe Vucking File

[–] [email protected] 1 points 6 months ago

Sorry, it was Solaris - you just blew it up (the minus is invalid on many Unix versions of tar)

[–] [email protected] 0 points 6 months ago (1 children)

tar xvf somearchive.tar

Is that right? )= I'm scared I lost.

[–] [email protected] 1 points 6 months ago* (last edited 6 months ago) (1 children)

user@server:~> tar xvf somearchive.tar

tar: somearchive.tar: Cannot open: No such file or directory

tar: Error is not recoverable: exiting now

[–] [email protected] 1 points 6 months ago

Scheiße...

[–] [email protected] 0 points 6 months ago

tar

Done. That's a valid command, no error code, nothing. KISS!

[–] [email protected] 0 points 6 months ago (1 children)
[–] [email protected] 0 points 6 months ago (2 children)

Then comes a .tar.bz2 file along and you're screwed. xtract je vucking file?

Pro tip: -z, -j are not needed by tar anymore since many years, tar will autodetect what compression was used if your distro is anything remotely modern.

[–] [email protected] 1 points 6 months ago

Pro tip: -z, -j are not needed by tar anymore since many years, tar will autodetect what compression was used if your distro is anything remotely modern.

😵

[–] [email protected] 1 points 6 months ago

You still might want to do something like alias pbtar='tar --use-compress-prog=pbzip2 to easily use pbzip2 - unless you have an ancient system that'll speed things up significantly. And even if you don't it'd be nice to use it for creation - to utilize more than one core the archive needs to be created for parallel extraction.

[–] [email protected] 0 points 6 months ago (1 children)

tar --help is a valid command

[–] [email protected] 0 points 6 months ago (1 children)

More of a request than a command, I'd have argued

[–] [email protected] 1 points 6 months ago

I command you to show me the manual