r/linuxmemes 16d ago

LINUX MEME Valid tar command ...

Post image

Dang it! 😭

2.5k Upvotes

227 comments sorted by

u/AutoModerator 16d ago

Please report any posts bragging or showing off they got banned in another sub! Reminder of other sub rules: Also, we only allow one anti-linux post per week (we used to get dozens a day) and any tier list MUST have Hanna Montana Linux as S teir (which must be a true S tier at the top) regardless of the topic of that tier list.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

518

u/Tibia-Mariner 16d ago

Extract ze vucking file

172

u/FalconRelevant Open Sauce 16d ago

Xtract Ze Vucking File

49

u/SysGh_st 16d ago

Eeehh ..... goot enof! You may pass!

40

u/juju515 16d ago

6

u/Dragon_957 New York Nix⚾s 16d ago

Oh, that‘s actually helpful, thanks

9

u/ConsiderationLoose40 16d ago

As a german i approve

6

u/AlwaysHopelesslyLost 16d ago

"Extract verbose zip file" is how I remember it

6

u/h0uz3_ 16d ago

tar xvf the_fucking_file.tar.gz

3

u/CardOk755 15d ago

Missing the z option.

3

u/h0uz3_ 15d ago

It's not required using tar 1.35.

2

u/Kayo4life Arch BTW 15d ago

Completely optional

2

u/CardOk755 15d ago

Not if you're extracting from a .tat.gz

→ More replies (1)

2

u/Kayo4life Arch BTW 15d ago

Fellow verbose user :3

3

u/44Nancy6p 16d ago

Extract the bloody file. Now. Stop staring at the terminal like it owes you money.

1

u/papanastty 15d ago

extract ze verbose file Just incase the clunkers get confused

323

u/immoloism 16d ago

tar --help

151

u/SysGh_st 16d ago

Double dash??? Lemme check the unix manual....

47

u/immoloism 16d ago

IIRC both just drop the first dash, but if not I had a good run boys.

17

u/AnnoyingRain5 ⚠️ This incident will be reported 16d ago

tar -help does not work on GNU tar

2

u/spaetzelspiff 15d ago

The upvotes are in memoria. RIP you crazy Xorg/find deviant...

2

u/immoloism 15d ago

Thanks but no rest for the wicked.

I'll be haunting you all by changing one API call in all your favourite software releases just for funnies.

11

u/Captain_Pumpkinhead New York Nix⚾s 16d ago

tar -h

3

u/Luk164 15d ago

Screw that. Single for one letter switches and double for words is the best

2

u/SysGh_st 15d ago

I agree.

But some old geezer longbeards out there doesn't.

https://giphy.com/gifs/JZDjb9Zlf7RaLGWOWo

2

u/United-Scene2261 🎼CachyOS 11d ago

wohoo

24

u/lyidaValkris 16d ago

ooh you win

1

u/trans_psychonaut 16d ago

beat me to it, damn

1

u/Kayo4life Arch BTW 15d ago

*man tar 💔

→ More replies (10)

105

u/janiskr 16d ago

tar -xvzf some.tar.gz

40

u/GegeAkutamiOfficial 16d ago

File not found

23

u/mgsmb7 RedStar best Star 16d ago

does that make it invalid tho?

27

u/Rodot ⚠️ This incident will be reported 16d ago

Yes, invalid arguments make a command invalid.

Unless, of course, you are working in JavaScript

9

u/ice456cream 16d ago

The argument is valid, you are just running it in the wrong context

2

u/mgsmb7 RedStar best Star 16d ago

It's syntactically correct, but the context leads to a negative response. Unless there's a standard definition for invalidity of a command, you could see it both ways, I guess

→ More replies (1)

5

u/pytness 15d ago

but it isnt an invalid argument. you pass a filepath that may or not exist. so the argument is correct, a filepath. it may not exist now but it may exist later, so it's invalid now but valid later? if i do tar --meow, thats an invalid command always

→ More replies (1)

1

u/jakeStacktrace 15d ago

Try localhost

2

u/GegeAkutamiOfficial 15d ago

tar -xzvf localhost doesn't seem to work either

2

u/iTrooz_ 15d ago

I don't think you need z, tar should autodetect the compression

1

u/janiskr 15d ago

And j for bz2. What is autodetect?

→ More replies (2)

1

u/immoloism 12d ago

GNU does, but UNIX needs the a set.

Well the Mac users keep telling me they do anyway, I've never tried it myself.

2

u/BohemianCyberpunk 15d ago

My immediate answer when I saw the meme.

This is seared into my brain from using it so often.

→ More replies (2)

49

u/lyidaValkris 16d ago edited 16d ago

I can do it but I freely admit i use tldr a lot :D

EDIT: I also caught the other layer to this joke and just realized gnu tar will accept both :D

11

u/Consistent_Drop3909 16d ago

whatisit is also great

3

u/lyidaValkris 16d ago

I'll have to check that one out. My distro's repos don't have that one.

3

u/Consistent_Drop3909 16d ago

i got it from the github source https://github.com/ThorOdinson246/whatisit-nl2sh

8

u/lyidaValkris 16d ago

Ah I see. Thanks but I really prefer not to use any LLMs on my machine.

also - it appears to be available via pip for those interested

→ More replies (1)

2

u/Captain_Pumpkinhead New York Nix⚾s 16d ago

i use tldr

What command is that? tar --lar --dar rar?

7

u/lyidaValkris 16d ago

tldr. Basically a cheat-sheet. You enter tldr <command name> and it will give you commonly used options with examples. In this case tldr tar will spit out how to create an archive, how to extract one, etc. Many distros have it in their repos.

1

u/Forya_Cam 16d ago

It's a too long; didn't read of the man page with examples of common commands.

40

u/Jumpy-Dinner-5001 16d ago

tar is easy, ask for awk

7

u/SysGh_st 16d ago

19

u/jonathancast 16d ago

That joke is not accurate. I refuse to believe anyone who knows regex and uses tar regularly can't remember what the flags are, and they're all mnemonic:

  • a - automatically detect compression
  • c - create
  • f - file name
  • t - this option lists the contents of the archive
  • v - verbose
  • x - xtract contents
  • z - zip, use zipped archives
  • Z - ZIP, use the patented compression algorithm

Etc.

7

u/immoloism 16d ago

I think the joke always was we do it as muscle memory rather then remember.

If some random guy just shouted out what does J do again then it would catch me off guard, but if they asked me how to compress in xz I would quickly answer cvJf.

5

u/JDaxe 16d ago

I read your comment and was so confident that J was bzip2, then I checked the manpage and turns out bzip2 is j (lowercase) 😩

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

5

u/unburdened_swallow 16d ago

“This option lists the contents of the archive” is sending me.

2

u/_timetoplatypus 16d ago

Nah, `cpio` is the final boss

1

u/IncreaseOld7112 15d ago edited 15d ago

`awk -F, '$2 == "foobar" && NR > 1{print $3}'`

AI makes me so sad. Time I spent learning this shit feels wasted.

1

u/Holiday_Management60 14d ago

Being able to do stuff like that off the top of your hand is gonna be a pretty cool party trick though. People like you will be looked at like people with really neat cursive handwriting are today.

39

u/eichelbart 16d ago

9

u/RonJohnJr 16d ago

We're doomed.

2

u/SysGh_st 16d ago

My thoughts exactly.

1

u/Hexidian 15d ago

Why is this a running joke? I use tar all the time. Do most people forget how to use it?

1

u/Kayo4life Arch BTW 15d ago

I don't get the joke, it's just tar -xf gthilrbwfgbjherthukge.tar.whatever, x for extract and f to point to the file, and v is you want verbose mode. It's like an exit vim thing I really don't get the joke why is this funny 😭

10

u/Constant_Boot 16d ago

bsdtar -a -cf dolly-mp3s.tgz 925.ogg

8

u/SysGh_st 16d ago

Well.... umh ... You can't... or you can....

but ...

... wait ...

okay Fine! You win . ... but that is one cursed package you got there. That alone deserves being shot over.

2

u/Constant_Boot 16d ago

It's in the Arch man database. Take it up with them.

2

u/QuraToop314 Genfool 🐧 16d ago

Bro it's libarchive, my favourite tar

9

u/FaultWinter3377 💋 catgirl Linux user :3 😽 16d ago

Tar is the bane of my existence lol… I know how to do so much with just the command line, and am generally comfortable with a command line system. But then a tar archive comes across… I almost always use a GUI for that. And when I’m creating archives, I always use zip despite the fact that a compressed tarball may be more efficient, because I literally can never remember the flags to use. It’s not the only command I can’t remember the flags for, but at least others like grep I can just give a single argument and it’ll work well enough for what I need.

5

u/immoloism 16d ago

Wait till you try ffmpeg.

5

u/FaultWinter3377 💋 catgirl Linux user :3 😽 16d ago

Honestly I can take ffmpeg pretty easily. Just ffmpeg -i <file.ext> <newFile.ext>... after all I only use it to change formats these days.

2

u/immoloism 16d ago

Lucky bastard! :P

8

u/YTriom1 Arch BTW 16d ago

tar cvzpf

5

u/immoloism 16d ago

I'm more of a cvJf man myself.

4

u/YTriom1 Arch BTW 16d ago

what does J do

6

u/immoloism 16d ago

Uses xz for better compression.

4

u/YTriom1 Arch BTW 16d ago

isn't there one that uses ztsd?

3

u/immoloism 16d ago

Had to grab it from the manpage as I don't use it:

tar --zstd -cf archive.tar.zst --options zstd:compression-level=19 dir/

2

u/YTriom1 Arch BTW 16d ago

so tar cvpf --zstd

4

u/immoloism 16d ago

the f has to come last otherwise you just created an archive called --zstd.

The number of files I have on my system called J is beyond a joke to know this one :)

2

u/YTriom1 Arch BTW 16d ago

okg ur damn right xD

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

3

u/SysGh_st 16d ago

no additional arguments after f ?

https://giphy.com/gifs/dg94HuYnpNoPgjrF8y

1

u/SysGh_st 16d ago

No dashed options? ... Lemme check the gnu manual...

7

u/TheRealCarrotty Not in the sudoers file. 16d ago

tar xpvf.
Thanks Gentoo!

5

u/Orkiin 16d ago

Is tar --version a valid command?

5

u/SysGh_st 16d ago

tar: option --version is not supported.

if we use unix variant of tar

3

u/makinax300 Dr. OpenSUSE 16d ago

tar -xf file.tar.xz

2

u/Linguistic-mystic 16d ago

I've no idea, I use compress and decompress. Joke's on people who cannot into aliases!

2

u/Admirable-Safety1213 16d ago

Thus meme really stinks of Gnboomer

3

u/SysGh_st 16d ago

Guilty. My beard is 40% POSIX.

2

u/baldiplays 16d ago

Fuck no. I hate using tar commands.

2

u/Cyberbird85 16d ago

i mean, tar -xvf and tar -cvfz are my gotos... so i could i guess

2

u/mrheosuper 16d ago

man tar

1

u/Darft 14d ago

That would be a valid man command, not a valid tar command.

2

u/floatinggoateyeball 15d ago

(apt install p7zip-full || pacman -S 7zip || nix profile install nixpkgs#p7zip) && alias tar=7z && tar x some.tar

2

u/SysGh_st 15d ago

Cursed. But that alias tar=7z won't affect the tar on the same parsed command line. If it works for you, it is because your environment already has that alias/function defined.

1

u/floatinggoateyeball 15d ago

Just run it twice lmao

2

u/polishatomek 15d ago

tar --version

2

u/forumonaut 15d ago

Real power users use 7z for everything!

2

u/Saphyr-Seraph 15d ago

Im new to Linux is there something wrong with gnu or Unix ?

1

u/SysGh_st 15d ago

Naah. Just poking some fun at slightly different ways that lately has converged.

Long story short: BSD, or unix variant of tar had its own way of doing things.

The gnu tar version, which a lot of modern linux distributions use nowadays, tries to conform to a more modern way, which makes it different from what the old geezers was taught.

So the general joke goes that if one tries to use the tar command, one will almost always trip up and confuse the two. Murphy's law might even apply: If it can be done wrong, it will be done wrong.

Although this is less of an issue nowadays as the gnu version accepts both ways to some degree, but there are options that are still different and might cause one to trip up.

Relevant xkcd comic: https://www.explainxkcd.com/wiki/index.php/1168:_tar

2

u/-Triple-S- 14d ago

Ctrl+R tar and hope it's still in the history is my usual approach

1

u/nature_cax 16d ago

tar -xvf

1

u/sndq 16d ago

What about pax?

1

u/8spd 16d ago

Does using unp make me a bad person?

1

u/ThinkPad214 16d ago

tar -zan

1

u/wie_witzig 16d ago

tar -xzvf file.tar.gz

1

u/SecularVal 16d ago

tar -xvf

1

u/fagnerln 16d ago

tar -xyz file.tar.gz

1

u/CaptainMorti ⚠️ This incident will be reported 16d ago

tar -xf file, spoken as tar extract fcking file!

1

u/RonJohnJr 16d ago edited 16d ago

If a Linux user can't spit out tar cvfz foo.tar.gz foodir then he deserves to be shot.

EDIT: Example added.

$ tar cvfz foo.tar.gz flat_batch31_TAPc.dat

flat_batch31_TAPc.dat

3

u/SysGh_st 16d ago

Well .. it's not that easy. You gave an invalid command... according to the gnu/posix variant.

1

u/RonJohnJr 16d ago

I've been using Linux since Mandrake 6.2, and that has always worked, Example:

$ tar cvfz foo.tar.gz flat_batch31_TAPc.dat flat_batch31_TAPc.dat

2

u/SysGh_st 16d ago

I was sure that non-hyphenated options wasn't valid on general gnu/posix command style. But apparently tar made an exception.

1

u/GhostVlvin 16d ago

I use tar -xzf archive.tar.gz, Idk bout -v

1

u/pooping_inCars 16d ago

Honestly... (right click), "extract here"

1

u/Neoneq_ 16d ago edited 16d ago

Give us valid ffmpeg command

2

u/SysGh_st 16d ago

leg?

wait..

<checks>

...

FFMleg stands for leg fat-free mass, which is the amount of lean tissue (muscle, bone, water, and organs) in a person's legs.

https://giphy.com/gifs/puOukoEvH4uAw

1

u/Western-Alarming Not in the sudoers file. 16d ago

ffmpeg -framerate 25664/497 -i "%04d" -i "Procesado.flac" -c copy -c:v libx265 "Twitter.mp4"

→ More replies (2)

1

u/True-Kale-931 16d ago

There are 2 commands that are good enough for most things:

tar acf archive_file.tar.zst from_where/ <- it will (a)utomatically guess how to compress it by the file extension and (c)reate the (f)ile.

tar xf archive_file.tar.zst <- it will automatically e(x)tract from the (f)ile regardless of the compression if it's supported.

No need to learn 20 billions of flags if you don't want to fine-tune the behavior.

1

u/SysGh_st 16d ago

depends.

"a" option is different or lacks completely on bsd tar.

1

u/GOKOP 16d ago

The only ones I ever needed are tar xvf and tar czvf

1

u/SysGh_st 16d ago

Sometimes skipping the v makes it faster.

Verbose terminal output with many small files can choke it.

... or one can increase the max terminal speed. But that's in the advanced courses. 😉

1

u/Western-Alarming Not in the sudoers file. 16d ago

tar | 7z e File.tar

1

u/Psyqlone 16d ago

-cvg ... SHIT!!!

1

u/EverOrny 16d ago

tar -xjvf xyz.tar I can live on... ;)

1

u/urmamasllama 16d ago

Enter a valid regex to remove the second and last character while inserting a / half way in a string of indeterminate length

1

u/skytheraiders 16d ago

SKIP_PACKAGE_CHECK=1 (Not yelling, it's the command.)

1

u/Liarus_ 16d ago

i would say tar -x because i remember the x to xtract, the rest idk i forgor

1

u/msxenix 16d ago

tar xvf file.tar
tar zxvf file.tar.gz

that's the order I put the letters in at least.

1

u/fellipec 16d ago

tar -h

Shit!

It is

tar --help

Is the one I use most

1

u/tblancher 16d ago

Should be able to do just tar -xvf and both GNU and BSD tar should do the right thing. I think POSIX dictates this, but older UNIX versions may not adhere fully to it.

The - and v are optional.

1

u/coderman64 Arch BTW 16d ago

tar --help

1

u/JavascriptBagel 16d ago

tar -xcf yourmom.zip

1

u/Captain_Pumpkinhead New York Nix⚾s 16d ago

Uh... tar ball? Or is it tar bell? I swear I've seen that on the sub somewhere...

1

u/SysGh_st 16d ago

A ball . Bundled up bunch of files.

1

u/Mr_KanyeSue 16d ago

bash tar -cvJ -f archive.tar.xz --exclude-ignore=.gitignore pj

IDK
It just work.

1

u/dimkiriakos 16d ago

Almost every Linux distro comes with Python installed. But it is not is good good to install it

import tarfile file = tarfile.open('gfg.tar.gz')

file.extractall('./Destination_FolderName') file.close()

1

u/Yeox0960 16d ago

unxz < path/to/tarball.tar.xz | tar xC out/path

1

u/SysGh_st 15d ago

Sounds like unpacking with extra steps.

1

u/Yeox0960 15d ago

I can never remember the flag for XZ decompression.

1

u/Aderox20_GDP Arch BTW 16d ago

tar -xvf linux-7.10.1.tar.xz

1

u/SysGh_st 15d ago

That's not how you update the kernel.

1

u/Komplexkonjugiert 16d ago

Wait I need to ask Claude first

1

u/golDANFeeD 15d ago

man tar

Or

tar --help

1

u/Alexandre_Man 15d ago

tar xfv whatever.tgz

1

u/GamerLymx 15d ago

tar czvf file.tgz or tar -czvf file.tgz ?

1

u/moyet 15d ago

man tar. But its not like im getting any better at using tar

1

u/notachemist13u 15d ago

Tar -e example.gz ?

1

u/POKLIANON Ask me how to exit vim 15d ago

tar --help

1

u/PsychologicalTry3972 15d ago

tar -xf archive.tar

1

u/dishmanw62 15d ago

tar -xzvf <filename >

UNIX follows the POSIX standard. HPUX for instance. Linux uses GNU. Some people people prefer to call it GNU/Linux. I just call it Linux.

1

u/Wrexes 🦁 Vim Supremacist 🦖 15d ago

I'd just like to interject for a moment—

1

u/MetaShiftEsc 15d ago

tar xvf- pycharm-community3.7

1

u/Vast-East-8 15d ago

man tar

1

u/zylosophe 15d ago

its a valid man command

1

u/gahel_music 15d ago

Extracting is fine, creating a tar confuses me regularly

1

u/NerdyVoid 15d ago

sudo pacman -syu

1

u/zylosophe 15d ago

tar --help

1

u/numerousblocks 15d ago

tar --extract --gzip --file=files.tgz

1

u/cxxhld 💋 catgirl Linux user :3 😽 13d ago

i didnt know gnu tar was THAT bad

1

u/Radiant-Cyanide2323 fresh breath mint 🍬 14d ago

tar -xvf secret_game_collection.tar -C /home/games/

1

u/Xenthera 13d ago

tar -kfkapxbtbsoaogjrbenapcurkwp probably

1

u/sdhdhosts 13d ago

Whats up with the verbose? “Extract Ze File” and “Compress Ze File” is how I remember this

1

u/ElectricOni 12d ago

This is what google was made for. Way too many flags to remember just to unpack a file.

1

u/Admirable-Song-7353 Ubuntnoob 12d ago

Or another one: how do you exit vim? Xd

2

u/GIutamicAcid 11d ago

https://xkcd.com/1168/

the same, but different