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.”

137 points

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

permalink
report
reply
49 points

Depends. Is it GNU tar, BSD tar or some old school Unix tar?

Double hyphen “long options” are a typical GNU thing.

permalink
report
parent
reply
13 points

That’s why those commands have two?

permalink
report
parent
reply
11 points

Yes, the terse Unix version, which needs to be supported for compatibility, and the more readable GNU long option

permalink
report
parent
reply
9 points

tar -h?

permalink
report
parent
reply
34 points
*
~# tar -h
tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
Try 'tar --help' or 'tar --usage' for more information.
***********************************************
WARNING: Self destruct sequence initiated
***********************************************

permalink
report
parent
reply
109 points

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.

permalink
report
reply
25 points

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.

permalink
report
parent
reply
25 points

The post only calls for “a valid tar command”, not that it has to work for any specific circumstance.

permalink
report
parent
reply
13 points

xaf (extract a file) auto-detects the format.

permalink
report
parent
reply
6 points

Extract Any File

permalink
report
parent
reply
3 points

I don’t remember the last time I had to worry about the compression. I simply run tar xf myfile.tar.whatever and it works every time.

permalink
report
parent
reply
7 points

That sounds a lot like Czech, “ze” means “from” if you translate it into English

permalink
report
parent
reply
8 points

Looks, not sounds. Ahoj!

permalink
report
parent
reply
3 points

I still use that. 😅

permalink
report
parent
reply
82 points

tar --help

permalink
report
reply
4 points

Exactly what I would have done !

permalink
report
parent
reply
3 points

This is the way

permalink
report
parent
reply
76 points

xtract ze vucking file

permalink
report
reply
29 points

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.

permalink
report
parent
reply
22 points

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.

😵

permalink
report
parent
reply
5 points

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.

permalink
report
parent
reply
2 points

Yeah I usually just do xf. 🤷‍♂️

permalink
report
parent
reply
10 points

v is just verbose, right?

permalink
report
parent
reply
9 points

Yep.

permalink
report
parent
reply
5 points

I’m so proud of me when I remember this. Hackerman!

permalink
report
parent
reply
74 points

tar -xzvf archive.tar.gz

eXtract Zhe Vucking File

permalink
report
reply
42 points

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

permalink
report
parent
reply
12 points

Oh come on!

permalink
report
parent
reply
9 points

Inadvertent oracle attack.

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

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

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 6.8K

    Monthly active users

  • 1.4K

    Posts

  • 32K

    Comments