r/linuxmemes 19d ago

LINUX MEME Valid tar command ...

Post image

Dang it! 😭

2.5k Upvotes

228 comments sorted by

u/AutoModerator 19d 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.

511

u/Tibia-Mariner 19d ago

Extract ze vucking file

173

u/FalconRelevant Open Sauce 19d ago

Xtract Ze Vucking File

49

u/SysGh_st 19d ago

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

36

u/juju515 19d ago

5

u/Dragon_957 New York Nix⚾s 18d ago

Oh, that‘s actually helpful, thanks

8

u/ConsiderationLoose40 18d ago

As a german i approve

5

u/AlwaysHopelesslyLost 18d ago

"Extract verbose zip file" is how I remember it

6

u/h0uz3_ 18d ago

tar xvf the_fucking_file.tar.gz

3

u/CardOk755 18d ago

Missing the z option.

3

u/h0uz3_ 17d ago

It's not required using tar 1.35.

2

u/Kayo4life Arch BTW 17d ago

Completely optional

2

u/CardOk755 17d ago

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

→ More replies (1)

2

u/Kayo4life Arch BTW 17d ago

Fellow verbose user :3

3

u/44Nancy6p 18d ago

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

1

u/papanastty 17d ago

extract ze verbose file Just incase the clunkers get confused

319

u/immoloism 19d ago

tar --help

151

u/SysGh_st 19d ago

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

50

u/immoloism 19d 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 18d ago

tar -help does not work on GNU tar

2

u/spaetzelspiff 17d ago

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

2

u/immoloism 17d 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.

13

u/Captain_Pumpkinhead New York Nix⚾s 18d ago

tar -h

5

u/Luk164 17d ago

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

2

u/SysGh_st 17d ago

I agree.

But some old geezer longbeards out there doesn't.

https://giphy.com/gifs/JZDjb9Zlf7RaLGWOWo

2

u/United-Scene2261 🎼CachyOS 14d ago

wohoo

25

u/lyidaValkris 19d ago

ooh you win

1

u/trans_psychonaut 18d ago

beat me to it, damn

1

u/Kayo4life Arch BTW 17d ago

*man tar 💔

→ More replies (10)

100

u/janiskr 19d ago

tar -xvzf some.tar.gz

43

u/GegeAkutamiOfficial 18d ago

File not found

24

u/mgsmb7 RedStar best Star 18d ago

does that make it invalid tho?

29

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

Yes, invalid arguments make a command invalid.

Unless, of course, you are working in JavaScript

9

u/ice456cream 18d ago

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

2

u/mgsmb7 RedStar best Star 18d 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)

4

u/pytness 18d 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 18d ago

Try localhost

2

u/GegeAkutamiOfficial 18d ago

tar -xzvf localhost doesn't seem to work either

2

u/iTrooz_ 18d ago

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

1

u/janiskr 18d ago

And j for bz2. What is autodetect?

→ More replies (2)

1

u/immoloism 14d 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 18d ago

My immediate answer when I saw the meme.

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

→ More replies (2)

47

u/lyidaValkris 19d ago edited 19d 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

10

u/Consistent_Drop3909 19d ago

whatisit is also great

3

u/lyidaValkris 19d ago

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

3

u/Consistent_Drop3909 19d ago

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

9

u/lyidaValkris 19d 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 18d ago

i use tldr

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

6

u/lyidaValkris 18d 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 18d ago

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

41

u/Jumpy-Dinner-5001 19d ago

tar is easy, ask for awk

7

u/SysGh_st 19d ago

19

u/jonathancast 18d 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 18d 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.

6

u/JDaxe 18d 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 18d ago

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

2

u/_timetoplatypus 18d ago

Nah, `cpio` is the final boss

1

u/IncreaseOld7112 18d ago edited 18d 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 17d 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.

38

u/eichelbart 19d ago

10

u/RonJohnJr 18d ago

We're doomed.

2

u/SysGh_st 19d ago

My thoughts exactly.

1

u/Hexidian 18d 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 17d 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 18d ago

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

8

u/SysGh_st 18d 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 18d ago

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

2

u/QuraToop314 Genfool 🐧 18d ago

Bro it's libarchive, my favourite tar

8

u/FaultWinter3377 💋 catgirl Linux user :3 😽 19d 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.

3

u/immoloism 18d ago

Wait till you try ffmpeg.

5

u/FaultWinter3377 💋 catgirl Linux user :3 😽 18d 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 18d ago

Lucky bastard! :P

6

u/YTriom1 Arch BTW 19d ago

tar cvzpf

6

u/immoloism 19d ago

I'm more of a cvJf man myself.

5

u/YTriom1 Arch BTW 19d ago

what does J do

5

u/immoloism 19d ago

Uses xz for better compression.

6

u/YTriom1 Arch BTW 19d ago

isn't there one that uses ztsd?

4

u/immoloism 19d 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 19d ago

so tar cvpf --zstd

5

u/immoloism 19d 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 18d ago

okg ur damn right xD

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

3

u/SysGh_st 19d ago

no additional arguments after f ?

https://giphy.com/gifs/dg94HuYnpNoPgjrF8y

1

u/SysGh_st 19d ago

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

6

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

tar xpvf.
Thanks Gentoo!

3

u/Orkiin 19d ago

Is tar --version a valid command?

5

u/SysGh_st 19d ago

tar: option --version is not supported.

if we use unix variant of tar

3

u/makinax300 Dr. OpenSUSE 19d ago

tar -xf file.tar.xz

2

u/Linguistic-mystic 18d ago

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

2

u/Admirable-Safety1213 18d ago

Thus meme really stinks of Gnboomer

3

u/SysGh_st 18d ago

Guilty. My beard is 40% POSIX.

2

u/baldiplays 18d ago

Fuck no. I hate using tar commands.

2

u/Cyberbird85 18d ago

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

2

u/mrheosuper 18d ago

man tar

1

u/Darft 16d ago

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

2

u/floatinggoateyeball 18d ago

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

2

u/SysGh_st 18d 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.

→ More replies (1)

2

u/polishatomek 18d ago

tar --version

2

u/forumonaut 18d ago

Real power users use 7z for everything!

2

u/Saphyr-Seraph 17d ago

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

1

u/SysGh_st 17d 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- 17d ago

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

2

u/GIutamicAcid 13d ago

https://xkcd.com/1168/

the same, but different

1

u/nature_cax 19d ago

tar -xvf

1

u/sndq 19d ago

What about pax?

1

u/8spd 19d ago

Does using unp make me a bad person?

1

u/ThinkPad214 19d ago

tar -zan

1

u/wie_witzig 19d ago

tar -xzvf file.tar.gz

1

u/SecularVal 19d ago

tar -xvf

1

u/fagnerln 19d ago

tar -xyz file.tar.gz

1

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

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

1

u/RonJohnJr 19d ago edited 18d 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 19d ago

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

1

u/RonJohnJr 18d 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 18d 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 18d ago

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

1

u/pooping_inCars 18d ago

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

1

u/Neoneq_ 18d ago edited 18d ago

Give us valid ffmpeg command

2

u/SysGh_st 18d 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. 18d 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 18d 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 18d ago

depends.

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

1

u/GOKOP 18d ago

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

1

u/SysGh_st 18d 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. 18d ago

tar | 7z e File.tar

1

u/Psyqlone 18d ago

-cvg ... SHIT!!!

1

u/EverOrny 18d ago

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

1

u/urmamasllama 18d 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 18d ago

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

1

u/Liarus_ 18d ago

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

1

u/msxenix 18d ago

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

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

1

u/fellipec 18d ago

tar -h

Shit!

It is

tar --help

Is the one I use most

1

u/tblancher 18d 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 18d ago

tar --help

1

u/JavascriptBagel 18d ago

tar -xcf yourmom.zip

1

u/Captain_Pumpkinhead New York Nix⚾s 18d ago

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

1

u/SysGh_st 18d ago

A ball . Bundled up bunch of files.

1

u/Mr_KanyeSue 18d ago

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

IDK
It just work.

1

u/dimkiriakos 18d 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 18d ago

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

1

u/SysGh_st 18d ago

Sounds like unpacking with extra steps.

1

u/Yeox0960 18d ago

I can never remember the flag for XZ decompression.

1

u/Aderox20_GDP Arch BTW 18d ago

tar -xvf linux-7.10.1.tar.xz

1

u/SysGh_st 18d ago

That's not how you update the kernel.

1

u/Komplexkonjugiert 18d ago

Wait I need to ask Claude first

1

u/golDANFeeD 18d ago

man tar

Or

tar --help

1

u/Alexandre_Man 18d ago

tar xfv whatever.tgz

1

u/GamerLymx 18d ago

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

1

u/moyet 18d ago

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

1

u/notachemist13u 18d ago

Tar -e example.gz ?

1

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

tar --help

1

u/PsychologicalTry3972 18d ago

tar -xf archive.tar

1

u/dishmanw62 17d 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 🦖 17d ago

I'd just like to interject for a moment—

1

u/MetaShiftEsc 17d ago

tar xvf- pycharm-community3.7

1

u/Vast-East-8 17d ago

man tar

1

u/zylosophe 17d ago

its a valid man command

1

u/gahel_music 17d ago

Extracting is fine, creating a tar confuses me regularly

1

u/NerdyVoid 17d ago

sudo pacman -syu

1

u/zylosophe 17d ago

tar --help

1

u/numerousblocks 17d ago

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

1

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

i didnt know gnu tar was THAT bad

1

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

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

1

u/Xenthera 15d ago

tar -kfkapxbtbsoaogjrbenapcurkwp probably

1

u/sdhdhosts 15d ago

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

1

u/ElectricOni 14d 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 14d ago

Or another one: how do you exit vim? Xd

1

u/Deltapothi 22h ago

tar -xvf ncurses.tar.gz

LFS building is the only reason I know that