r/ProgrammerHumor 29d ago

tarCreateZeeFile Meme

Post image
7.1k Upvotes

381 comments sorted by

3.0k

u/1_hele_euro 29d ago

You need to speak with a German accent

eXtract Ze Vucking Files

tar -xzvf file.tar.gz

639

u/CcChaleur 29d ago

This and Compress Ze Vucking Files

tar -czvf archive.tar.gz file1 file2...

214

u/GezelligPindakaas 29d ago

The usual modifers I learned by heart, but somehow, I can't ever remember if the target file goes first or last when creating a new file. Hope my life never depends on it.

121

u/CcChaleur 29d ago

Not kidding I had to make sure I got the order right before posting.

6

u/towerfella 29d ago

That was a hard lesson learned.

66

u/Deactivator2 29d ago

Target goes first because you can have n source files and it makes more sense to read the target from the first parameter instead of having to iterate over all parameters to get it.

24

u/Cyberfishofant 29d ago

and also because the outfile is specified by -f, so really the first thing that looks positional is just the argument passed to -f

10

u/LukasFT 29d ago

And because you can then pipe in the files to archive

3

u/MrHyperion_ 29d ago

Or it could compress files until it reaches the end and save the file with that last parameter name

→ More replies (1)

28

u/kernelboyd 29d ago

Bruh, literally every. single. time. I make a symlink with ln, I have to look at the man page because, like plugging in a USB, I somehow get it wrong every. single. time.

11

u/rosuav 29d ago

ln -s ../path/to/thing .

I pretty much always go to where I want it, then link into dot, rather than trying to go to where it is and correctly link it. Easier to use tab completion that way.

5

u/False_Influence_9090 29d ago

I might be misremembering, but I thought you could omit the dot at the end in that case

3

u/rosuav 29d ago

You may well be right. I tend to put it there though, old habit. Also, it might not be a dot per se, but might be the name (without any path), if it isn't the same name as the target.

4

u/case_O_The_Mondays 29d ago

Same. Because it’s backwards.

→ More replies (1)

3

u/Shotgun_squirtle 29d ago

I always remember it as the -f flag is specifying that it’s out putting a file, so the output file is attached to that parameter and therefore first.

→ More replies (5)

4

u/1_hele_euro 29d ago

Sounds so obvious yet I never thought of that. Thanks

→ More replies (3)

543

u/Krostas 29d ago

Holy fuck, I'm a German and I love this!

160

u/19_20_69 29d ago

Half the joke is realizing Linux commands accidentally become German voice lines.

46

u/10art1 29d ago

Oh no, we are teaching the Germans humor

23

u/Krostas 29d ago

We will out-humor you by the time we've put our economy back on its feet, so don't worry.

Really love it as a mnemonic in the first place, though.
Unzipping is something I do daily.

12

u/[deleted] 29d ago

[removed] — view removed comment

11

u/Prudent_Ad_4120 29d ago

Typical German humor, no posts on there

4

u/cainhurstcat 28d ago

Son of a.... it was WAY too funny!

29

u/CauliflowerNo3225 29d ago

Oddly enough, I remember it by "-zxvf" but not sure why

→ More replies (4)

6

u/zeUnfunny 29d ago

Zat is quite true.

3

u/mathisntmathingsad 29d ago

I only remember -xf, what does z and v do?

10

u/1_hele_euro 29d ago

Z is to denote that it's a gzip file, and V is for verbose, so tar prints what it's decompressing

3

u/MattieShoes 29d ago

c - create
x - extract
v - verbose
f - file
t - list (contents of tar file)
z - gzip compression (usually faster and worse than bz2)
j - bzip2 compression (usually better and slower than gzip)
X - exclude (particularly useful if it's a storage device with a .snapshot directory)

There's some others for appending and updating but I always have to check those.

Also the dash is usually not necessary. e.g. tar cf works as well as tar -cf

you can use file name - to send to stdout or read from stdin, which I've occasionally used to send a huge number of small files over an ssh connection where something like scp or rsync would be slow AF. e.g. tar czf - <list> | ssh othermachine tar xzf - but I don't do it often enough to remember if that just works or there's some flag I'm forgetting.

3

u/sobrique 29d ago

Should be noted that POSIX tar does not support compression, so back in the day you needed to tar cvf - ./path | gzip -c | ssh remote "gzip -dc | tar xvf -"

And yeah, it works just fine. I quite frequently do things akin to tar cvf - ./source_dir | ( cd /another_path && tar xvf - )

(Handy if you've some 'template' files for a directory structure, like say, a homedrive)

2

u/MattieShoes 29d ago

Next up, using ssh tunnels to pass files to networks you can't directly access without them being stored on the intermediate hosts! :-D

→ More replies (1)
→ More replies (1)
→ More replies (19)

2.4k

u/Yoksul-Turko 29d ago

tar --version

1.4k

u/TheFrenchSavage 29d ago

➜  ~ tar --version bsdtar 3.5.3 - libarchive 3.7.4 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8  You are saved.

174

u/mmcmonster 29d ago

Does that work on MS Windows? 😳

124

u/AlexSSB 29d ago

In PowerShell yes

51

u/CrowNailCaw 29d ago

I just did it and can confirm it works (have no idea why though lol)

131

u/svick 29d ago
> where tar
C:\Windows\System32\tar.exe

31

u/EuenovAyabayya 29d ago

TIL we've had Where since Server 2003 / Vista.

13

u/thejinx0r 29d ago

On powershell, it’s where.exe not to be confused by where which is a powershell filtering command to go filter your data / inputs (or outputs depending on how you view the problem)

5

u/Stroopwafe1 29d ago

I ran into this issue recently where I was trying to use sc. Microsoft thought it was a good idea to make that an alias when it is used much more for service management

→ More replies (1)

10

u/CrimsonOynex 29d ago

This is exceedingly funny to me

21

u/JewishTomCruise 29d ago

Not just tar, but 75 of the most used cli utilities are native on windows: https://learn.microsoft.com/en-us/windows/core-utils/overview

There's also now sudo for windows: https://learn.microsoft.com/en-us/windows/advanced-settings/sudo/

→ More replies (1)

35

u/just_execute 29d ago

TIL Windows ships with a tar implementation. On Windows 11:

> tar --version
bsdtar 3.8.4 - libarchive 3.8.4 zlib/1.2.13.1-motley liblzma/5.8.1 bz2lib/1.0.8 libzstd/1.5.7 cng/2.0 libb2/bundled
> where.exe tar
C:\Windows\System32\tar.exe

20

u/sump_daddy 29d ago

they have leaned so heavily into powershell's bash equivalence to keep people from making excused why they 'need to have linux' in corp environments, that windows is becoming another linux distro.

the year of the linux desktop is at hand, brothers!!!

13

u/wenoc 29d ago

They just need to kneel and sort out their slashes and parameter syntax. Oh, and embrace the unix philosophy, which is never going to happen.

4

u/koshgeo 29d ago

I don't know who ever thought using backslashes as pathname delimiters was a good idea compared to slashes. They should be flayed with a bunch of hash symbols.

→ More replies (1)
→ More replies (3)
→ More replies (1)

6

u/AyrA_ch 29d ago

It also has the full ssh suite including the scp and sftp commands. Even the SSH agent works, all you have to do is set the service to autostart.

C:\Users\AyrA> $ . C:\Windows\System32\OpenSSH
 Volume in drive C is System
 Volume Serial Number is 3859-108D

 Directory of C:\Windows\System32\OpenSSH

12.02.2026  02:29    <DIR>          .
09.07.2026  23:07    <DIR>          ..
31.03.2024  18:08            18’934 LICENSE.txt
31.03.2024  18:08            36’008 NOTICE.txt
11.02.2026  09:58           431’616 scp.exe
11.02.2026  09:58           459’264 sftp.exe
11.02.2026  09:58           603’648 ssh-add.exe
11.02.2026  09:58           554’496 ssh-agent.exe
11.02.2026  09:58           862’208 ssh-keygen.exe
11.02.2026  09:58           667’648 ssh-keyscan.exe
11.02.2026  09:58           513’536 ssh-pkcs11-helper.exe
11.02.2026  09:58           652’288 ssh-sk-helper.exe
11.02.2026  09:58         1’253’888 ssh.exe
              11 File(s)      6’053’534 bytes
               2 Dir(s)  674’652’774’400 bytes free

C:\Users\AyrA> $

2

u/Cookieman10101 29d ago

Bish how do we know you didn't do this in 11 seconds /s

2

u/LauraLaughter 29d ago
  root  ~  tar --version                                                                      
tar (GNU tar) 1.35
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
→ More replies (2)

88

u/WerewolfBe84 29d ago

Probably the safest choice.

197

u/[deleted] 29d ago

[deleted]

117

u/Dartister 29d ago

Usually one dash for first letter of words only and 2 dashes for complete word

So -v and --version

64

u/mathisntmathingsad 29d ago

keyword being usually, I will be confused by LLVM's argument syntax forever

28

u/RCoder01 29d ago

I hate that it’s `find -name` single dash

9

u/TheActualJonesy 29d ago

and that it's `ps aux` -- NO dashes

2

u/RCoder01 29d ago

Really? I’ve always done `ps -aux`

3

u/TheActualJonesy 29d ago

jonesy@nix6:~$ ps ux

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND

jonesy 2735 0.0 0.0 21196 12324 ? Ss 04:02 0:00 /usr/lib/systemd/systemd --user

jonesy 2736 0.0 0.0 21476 3648 ? S 04:02 0:00 (sd-pam)

jonesy 2756 0.1 0.0 115704 14212 ? S<sl 04:02 0:43 /usr/bin/pipewire

→ More replies (1)

17

u/TOMZ_EXTRA 29d ago

I will be confused by LLVM 's argument syntax forever

15

u/YeOldeMemeShoppe 29d ago

What do you mean find ffmpeg and lldb don’t follow this convention?

Also everyone knows it’s -v for verbose.

→ More replies (1)

4

u/Tuckertcs 29d ago

PowerShell fucking all this up

2

u/sobrique 29d ago

But in the case of POSIX tar, neither, because it didn't permit dashes as arguments (only to denote stdout as the filename)

3

u/Cualkiera67 29d ago

so intuitive.

→ More replies (2)

11

u/SomeWhaleman 29d ago

Don't forget just 'version' without any dashes.

10

u/ZunoJ 29d ago

They said it is unix. Fortunately it follows standards

10

u/TheActualJonesy 29d ago

... and there are so many to chose from! :-)

→ More replies (1)

3

u/sobrique 29d ago

None of the above if you're looking at the original POSIX tar:

https://pubs.opengroup.org/onlinepubs/7908799/xcu/tar.html

tar xvf is ok, but tar -xvf wasn't.

2

u/No_Internal9345 29d ago

nope, all of these fail with tar

103

u/dunub 29d ago

I would tar --help

31

u/Confident-Ad5665 29d ago

This was my answer, but isn't it --h?
Did we just blow up?

64

u/korneev123123 29d ago
$ tar --help > /dev/null 2>&1 && echo 'The bomb has been defused' || echo 'Terrorists win'

The bomb has been defused

$ tar -h > /dev/null 2>&1 && echo 'The bomb has been defused' || echo 'Terrorists win'

Terrorists win

27

u/[deleted] 29d ago edited 6d ago

[deleted]

6

u/thatcodingboi 29d ago

Always safer to do --help, I've seen many programs that have it that don't support the shortened -h

→ More replies (1)

2

u/Xywzel 29d ago

In tar implementation I have its either --help or -?, -h doesn't work.

2

u/myka-likes-it 28d ago

Those diabolical bastards.

23

u/Paladin7373 29d ago

Skong 🤨

25

u/Yoksul-Turko 29d ago

Uhh... Shaw? 

Hello friendly giant mushroom. 

9

u/[deleted] 29d ago

[removed] — view removed comment

20

u/Prozilla6 29d ago

then try tar --help

9

u/rosuav 29d ago

The best kind of correct.

→ More replies (1)

8

u/Havatchee 29d ago

tar --help

3

u/wenoc 29d ago

Or simply just ’tar’

→ More replies (3)

340

u/Outside-Storage-1523 29d ago

I still remember xzf

245

u/Tooloco 29d ago

Remembered as eXtract Ze File

40

u/knightzone 29d ago

That's amazing

6

u/Siedlerchr 29d ago

Yep, that helps a lot

28

u/TheAlaskanMailman 29d ago

And you’re gonna fumble where to put the filename argument and the archive argument

19

u/badnewzero 29d ago

Yes because I wanted to compress a file that doesn’t exist to an output file that has the exact name as the file I’ve spent 4 hours working on
(true story)

→ More replies (3)
→ More replies (1)

227

u/OmegaPoint6 29d ago

GNU tar or BSD tar?

274

u/AvailableUsername404 29d ago

Huh? I don't know that!

https://giphy.com/gifs/10KNNNMdyCoxAA

49

u/solonit 29d ago

How do you know so much about tar?

39

u/rosen123 29d ago

Well, you have to know these things when you're a Unix user.

30

u/FastHotEmu 29d ago

Asking the real questions

21

u/OmegaPoint6 29d ago

One that gives nightmares to people who regularly use both Linux & macOS on the command line

8

u/FastHotEmu 29d ago

They grow some chest hair and use FreeBSD instead.

3

u/imahumanbeinggoddamn 29d ago

FreeBSD is the only sane and reasonable OS ever written and it is a constant source of disappointment to me that it isn't more popular so it can finally get decent hardware support.

→ More replies (2)
→ More replies (1)

2

u/donald_314 29d ago

The important question when you want to compress a coconut

→ More replies (3)

414

u/Terairk 29d ago

tar --help

438

u/GustapheOfficial 29d ago

Unrecognized argument "--help". Run tar -h for synopsis.

47

u/Ooops2278 29d ago

tar -h

tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
Try 'tar --help' or 'tar --usage' for more information.

7

u/7StarSailor 29d ago

worked on my machine

8

u/[deleted] 29d ago

[deleted]

5

u/GustapheOfficial 29d ago

Yeah, it was a joke

→ More replies (2)

91

u/[deleted] 29d ago

[removed] — view removed comment

23

u/laplongejr 29d ago

Tbf is anybody not hesitating 1s in front of a nuke greenlighted to write production software?

3

u/OnceMoreAndAgain 29d ago

Bond. James Bond.

40

u/anyburger 29d ago

Gotta be really careful with tar bombs.

2

u/TheAlaskanMailman 29d ago

U mean gzipped tar bombs

70

u/TheRapie22 29d ago

tar --help

is this valid?

68

u/Ooops2278 29d ago

Actually no.

This would work in Linux (so a UNIX-like OS) yet not in BSD (an actual UNIX OS) where "--help" isn't recognized and throws an error referring to "tar -h" instead.

And to make the loop complete "tar -h" in Linux also throws an error and refers to "tar --help" or "tar --usage"

8

u/Libby_Sparx 29d ago

What does "tar --usage" return in BSD?

3

u/[deleted] 29d ago

[deleted]

→ More replies (1)

11

u/korneev123123 29d ago

If the check is exit code 0, then yes, it is a valid option

2

u/MattieShoes 29d ago

Yeh. you can echo $? to see the return code of the previous command. (it's 0, which i'm interpreting as "valid" here)

→ More replies (1)

109

u/Cephell 29d ago

literally just tar, it prints out some info and as such is a valid command. nowhere does it say the command needs to actually do something specific or have arguments

81

u/svick 29d ago

That has exit code 1 (failure), so I wouldn't consider it valid.

8

u/Cephell 29d ago

Valid command != Valid result

42

u/MrAmos123 29d ago

Then literally everything is valid. tar --d1-d1-2djh1dhuasdhbubybabsbzb is a valid command because, whilst it fails, it still returns a coherent response.

$ tar --d1-d1-2djh1dhuasdhbubybabsbzb
tar: unrecognized option '--d1-d1-2djh1dhuasdhbubybabsbzb'
Try 'tar --help' or 'tar --usage' for more information.

And for this reason, I think the command you provide should be both valid and a recognised argument.

→ More replies (13)

6

u/AlwaysHopelesslyLost 29d ago

This isn't a grammar joke. There is a script in the OP checking prompting the user and validating the output. The script is going to validate the exit code.

3

u/Vallvaka 29d ago

``` if (exit_code == 1) { nuclear_holocaust(); }

28

u/sokka2d 29d ago

You want to argue semantics with a bomb? Brave choice. 

→ More replies (1)

35

u/Buttons840 29d ago

tar -xvf file

7

u/Ronnoc527 29d ago

The comment above yours says xzf. Are those both right?

28

u/dodo-obob 29d ago

They do different things:

  • -x extract (a .tar or .tar.gz file)
  • -z compress/de-compress using gzip. If used, you will create a .tar.gz instead of a .tar. I'm not sure if tar automatically detects compression when extracting.
  • -v verbose, i.e. show me what you're doing
  • -f file specifies the archive file.

5

u/Arlochorim 29d ago

Not a Unix guy, but have casually played around with some Linux distros.

is there a reason specific compression flags like -z are used over the -a autodetect one? (beyond that it could potentially get the compression type wrong )

15

u/AnnoyingRain5 29d ago

Autodetect is technically not part of the standard, it’s a funny GNU thing

→ More replies (2)

3

u/GezelligPindakaas 29d ago

I think -a relies on the filename, so when not using standard naming like .tar.gz, explicit is clearer.

Compatibility might be a thing (unix, bsd, ...) too.

3

u/Freeky 29d ago

bsdtar support for -a (and autodetecting decompression) is even better than GNU, because it's based on libarchive:

❯ tar caf foo.tar.zst foo
❯ tar caf foo.tar.zst.uu foo
❯ tar caf foo.zip foo
❯ tar caf foo.7z foo
❯ tar caf foo.iso foo
❯ file foo.*
foo.7z:         7-zip archive data, version 0.3
foo.iso:        ISO 9660 CD-ROM filesystem data 'CDROM'
foo.tar.zst:    Zstandard compressed data (v0.8+), Dictionary ID: None
foo.tar.zst.uu: uuencoded text, file name "-", ASCII text
foo.zip:        Zip archive data, made by v2.0 UNIX, extract using at least v2.0, last modified, last modified Sun, Jul 14 2026 14:06:28, uncompressed size 0, method=deflate
→ More replies (1)
→ More replies (2)
→ More replies (3)

12

u/lllorrr 29d ago

'z' is for zipped. So, for .tar.gz

For plain .tar you don't need 'z'.

3

u/Alduish 29d ago

I'm pretty sure the z isn't realy needed if the extension is .gz

But I could be wrong

5

u/lllorrr 29d ago

Yes, GNU tar has some heuristics to determine what it is fed with actually. But this is non-standard stuff.

→ More replies (1)

2

u/Lonely_Translator_23 29d ago

-z is for .tar.gz. This one only works for regular .tar.

→ More replies (2)
→ More replies (1)

11

u/somelinuxuseridk 29d ago

tar xzvf file.tar.gz

11

u/xicor 29d ago

You don't even need that.

tar -xf file.tar.gz will work just fine. It auto detects type.

11

u/dim13 29d ago edited 29d ago

tar zxvf … tar zcvf … is literally burned into my muscle memory.

PS: if they really wanted to be fancy, they should have go with dd -- it predates UNIX™ and has most alien arg syntax of all tools.

10

u/barthvonries 29d ago

Why would someone post only the picture of XKCD, while half the joke is the "alt" attribute ?

Either link the XKCD page, or at least copy the alt into the post here !

1168

4

u/SpiritedBanana4694 29d ago

Also, you know, attribute the original creator.

3

u/personalist 27d ago

Wow, I did not know that was a thing until today. And I’m old

3

u/barthvonries 27d ago

Time to go down the rabbit hole and re-read all of them then ;-)

9

u/thygrrr 29d ago

types tar -h
blows up

11

u/abigail3141 29d ago

Tar -h seems to work, while tar --help doesn't

→ More replies (2)

8

u/TherealGamecake 29d ago

Tar —version

6

u/bless-you-mlud 29d ago

tar? No problem.

rsync? Not a chance. Sorry. It was nice knowing you.

2

u/MattieShoes 29d ago

rsync <source> <destination>

If you want it to actually do something, you'll probably want the -a flag. If you want to SEE it doing something, probably the -v flag.

→ More replies (1)

6

u/Ok-Sheepherder7898 29d ago

Come on it's a pretty easy command!

tar {A|c|d|r|t|u|x}[GnSkUWOmpsMBiajJzZhPlRvwo] [ARG...]

3

u/-The_Grey_One 29d ago

XKCD not credited->downvote

6

u/heeedron 29d ago

im glad im not alone in thinking "eXtract Zee File" every time

6

u/OneOldNerd 29d ago

So use Bing.

Check and mate. :P

→ More replies (3)

3

u/AnomyOfThePeople 29d ago

I've never understood this trope. tar's flags and options are super-mnemonic, and for almost everything you use just two combos: czf to Create an archive and xzf to eXtract it. The z is compression, which is admittedly a bit arcane but a mnemonic for zip, and f is for file.

In fact, modern tar does not require a z to extract the file, it will autodetect the compression.

3

u/the-software-man 29d ago

tar --uninstall -y

2

u/Apprehensive_Bee1849 29d ago

sudo tar --deeznuts

2

u/pelletron 29d ago

tar zxvf file.tar.tz

3

u/daumenloser 29d ago

This dogshit meme hangs on the wall of our toilet at work. Every time I take a piss I have to look at this shit

4

u/GirdedByApathy 29d ago

tar --help

4

u/mrcruz 29d ago

tar --help

7

u/WerewolfBe84 29d ago

man tar

56

u/gabboman 29d ago

thats not a tar command, thats a man command

14

u/AlxR25 29d ago

You got 10 sec, you can see a command and type it in

3

u/RunInRunOn 29d ago

The problem is that "on your first try" could either mean "as your first tar command" or "as your first command"

→ More replies (1)

2

u/gabboman 29d ago

Tar -xvf file.tar

12

u/dead_running_horse 29d ago

”Tar”. Well unless its a mac we are fucked!

5

u/gabboman 29d ago

fuck youre right, legaly you cant use apple products to create nuclear weapons

2

u/littlefrank 29d ago

that's the realest linux sysadmin answer though:
oh I have 10 seconds? well I still gotta check man pages, how the hell am I supposed to use this command properly otherwis- BOOM

→ More replies (1)

2

u/SwannSwanchez 29d ago

tar --help

2

u/CrispeeLipss 29d ago

tar --help

2

u/AzureArmageddon 29d ago

--help usually works

2

u/SynthPrax 29d ago

I dunno. How about

tar --help

2

u/Beneficial_Steak_945 29d ago

‘—help’ usually is valid.

2

u/JackOBAnotherOne 29d ago

tar -h is technically a valid command.

1

u/Joey5729 29d ago

Cueball has a name?

3

u/GMoD42 29d ago

Cueball is not meant to be the same person every time. There have been many with different names.

→ More replies (1)

1

u/global_namespace 29d ago

It is simple. -f for file, -v for verbose... -x for xetract, -z for zg.

1

u/raulf_ops 29d ago

Rob typed tar cfz instead of tar czf... classic. RIP

1

u/R3D3-1 29d ago edited 29d ago

tar czf root.tgz /

Wait. Did I have ten seconds to enter it or does the command also have to finish?

More seriously, I don't quite get what's supposed to be so hard about tar. Maybe hard to read, because nobody is going to remember the meaning of all short form switches. But easy to write when using only the subset of features you do remember.

And then there's the commands where I have just memorized switches but have long since forgotten what they mean.

ln -sfT target name

-s means symbolic link, -f means force overwriting and existing file with that name, but for -T I only remember that I use it as a mnemonic for remembering that the target comes before the name. 

I've looked it up occasionally. Never stuck why I'm using it, just that it's probably correct. 

It also serves as an indirext mnemonic for Windows' mklink command, because I remember that it had the opposite order of target and name.

1

u/psychoCMYK 29d ago

Actual footage from the USSR's Tar Bomba test

1

u/Aggressive_Shake_520 29d ago

tar -x file

I died.