JackGreenEarth ,
@JackGreenEarth@lemm.ee avatar
tar -h
woelkchen ,
@woelkchen@lemmy.world avatar

Just tar, no arguments. Does nothing, still a valid command, no?

foobaz ,

Exit code 2 -> boom

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

Boom. tar --help for anyone wondering

kameecoding ,

I do tax -xvf filename

WhiskyTangoFoxtrot ,

tax

Boom.

kameecoding ,

ah fuck, didn't even notice

justme ,

quod erat demonstrandum :D

Karyoplasma ,

or quod errat demonstrator, both fit.

gandalf_der_12te ,
@gandalf_der_12te@discuss.tchncs.de avatar

quod erat expectandum?

justme ,

Quot expocto patronum!

Bosht ,

Christ this comment chain is perfect lmfao

DogWater ,

I like the way you pointed that out lmao

Voroxpete ,

.... aaaaaand you've killed us all.

doggle ,

tar --version

You're welcome

bitwaba ,

I'd have gone with tar --help

flying_sheep ,
@flying_sheep@lemmy.ml avatar

It's insane that this isn't consistent.

Any combination of -h, -? and --help exists

FMEEE ,

So would have been 1:4

zaphod ,

Never seen -?, it's either -h, --help, or -help for programs that just want to be different.

flying_sheep ,
@flying_sheep@lemmy.ml avatar
zaphod ,

I suppose I usually try -h and if that doesn't work I try the long version or the man page.

Aganim ,

Sorry, the bomb was running MacOS. Your command was not valid and you've doomed us all.

Andrew15_5 ,
@Andrew15_5@mander.xyz avatar

It's literally there at the bottom.

What isn't valid is MacOS, it's macOS now.

prettybunnys ,

tar -czvf tar_name.tar.gz ./

rockSlayer ,

Yep, have this one committed to memory. Though if it asked me to uncompress a tarball, then I'd be fucked

thejml , (Bearbeitet )

tar xzvf this_awesome_file.tgz

… fixed. Apparently I can’t type.

hallettj ,
@hallettj@leminal.space avatar

I think you want to remove the c because that means "create" an archive, and you're missing a z which applies gzip decompression/compression

_thebrain_ ,

I suppose it is tar version dependent, but on any recent Linux version I have used, you can just tar xvf <tar_name.tar.{z,gz,xz,etc}> and it will automatically figure out if it is compressed, what tools were used to compress it, and how to decompress it.

But you are right, x and c are mutually exclusive.

thejml ,

Yeap, apparently I can’t type. So, we’d all be dead anyway with that bomb.

gravitas_deficiency ,

QED 🫠

Aurenkin ,

File not found, now we are dead.

prettybunnys ,

Sounds like an error message from a valid tar command

v_krishna ,
@v_krishna@lemmy.ml avatar

I even read this aloud in my head as "CREATE ZE VUCKING FILE" in a particularly bad German accent same as over 20 years ago when a friend I worked for drilled it in my head.

RealPuyo ,

Read it in tf2 medics voice

Edgarallenpwn ,
@Edgarallenpwn@midwest.social avatar

I didn't realize that was my default German voice in my head. Thx

gravitas_deficiency ,

lol that’s honestly a great mnemonic

Lime66 ,
tar --version
Oderus ,
@Oderus@lemmy.world avatar

Read my mind. :D

b3an ,
@b3an@lemmy.world avatar

Somehow, idk why. This one is stuck in my head:

tar -zxvf filename.tar.gz
far_university1990 ,

tar xzvf

eXtract Ze Vucking File

Bread ,

I have to do this command often at work and I can never remember the letters perfectly. This is actually useful, thanks!

9point6 ,

Same, never used a mnemonic for it or anything, just

zxvf

Like it's any other word

MonkderDritte , (Bearbeitet )

z=zip (default in most tar), x=eXtract, v=verbose (not needed in most cases), f=target

prettybunnys ,

verbose … not needed?

If the words don’t happen how can I trust computer magic?

InFerNo ,

Yeah, how do I know that the PC isn't slacking?

Slotos ,

Monitor the room temperature.

BestBouclettes ,

The bomb runs AIX. I'm sorry, you're dead

MonkderDritte ,

tar zxvf filename.tar.gz?

BestBouclettes ,

Nope, tar doesn't handle compression on AIX. So it would be something like gzip -cd filename.tar.gz | tar xvf -

MonkderDritte ,

Ugh.

llothar ,

tar -xzf stands for tar eXtract Ze Filez

kshade ,
@kshade@lemmy.world avatar

I like tar xaf (eXtract All Files) better.

01101000_01101001 ,

You can skip the z; tar is smart enough to figure it out on its own

brlemworld ,

tar --help

JargonWagon ,

That was my first thought too lol

grrgyle ,
@grrgyle@slrpnk.net avatar

Rofl me too twins

Zos_Kia ,
@Zos_Kia@lemmynsfw.com avatar

There's an easy mnemonic for that : Compress Ze Vucking File !

synapse1278 ,
@synapse1278@lemmy.world avatar

Always think about tar commands in your best German accent !

j4k3 ,
@j4k3@lemmy.world avatar

tar --version

WhoLooksHere ,

Or is it -v

tiredofsametab ,

Depends. Short options are probably safer if the particular version and flavor of tar are unknown.

0x4E4F ,
@0x4E4F@sh.itjust.works avatar

So you either het version or verbose...slick AF 😏.

saigot ,

-v is verbose

elrik ,

How does it verify the command is valid? Does it run what I enter?

If so, just give it an infinite loop followed by some attempt at a tar command:

while true; do :; done; tar -xyz
velvetThunder ,

Next time I build a bomb I let the timer continue while the command is running.

Voroxpete ,

Yeah, what kind of idiot doesn't parallelize their timer function.

mlg ,
@mlg@lemmy.world avatar

Blue Team: "Okay everyone let's make sure this is absolutely the correct input"

Red Team: "Lmao lets try this 90mb list of bash command injection patterns"

lseif ,

i assume its looking for exit code of 0

lseif ,

echo || tar -xfzhd

samus12345 ,
@samus12345@lemmy.world avatar

I'd like to know if there are any XKCDs that are no longer relevant.

xorollo ,

I'd like to know if there's an XKCD about an XKCD that's no longer relevant.

DerisionConsulting ,

There are some that were wrong to begin with, I remember 622 bothering me.
https://xkcd.com/622/

But it could also just be that in the comic, the professor is wrong.

Faresh , (Bearbeitet )

This one, if by unix he also means modern linux systems. Nowadays you can simply use tar xf my-file.tar.whatever and it should work on most linux systems (it worked on every modern linux system I've tried and every compressed tar file I've tried). I don't think it is hard to remember the xf part.

atx_aquarian ,
@atx_aquarian@lemmy.world avatar

I hitched my horse to just what I consider the basics--zip and unzip--and that has made it easy for me. But I've been stuck on those.

Extract anything:

tar xf <archive_file>

Create a tbz2 archive:

tar cjf <archive_file.tbz2> <stuff to put in it>

(And tossing in a -v is pretty universal, if that's your thing.)

Some day, instead of commenting on a reddit Lemmy post, I think I'll Google how to tell it to use .xz.

Ok, you know what? Today is finally that day. It's just capital -J instead of lower-case -j! That's easy enough to remember, I guess.

partial_accumen ,

Stay by the phone always. We may need you to defuse a bomb someday.

governorkeagan ,

Never thought I'd learn how to use tar on a meme post.

0x4E4F ,
@0x4E4F@sh.itjust.works avatar

Memes are one of the best source for Linux info 👍.

UnculturedSwine ,

tar -cvzf /etc/

Edit: we're dead :(

tisktisk ,
@tisktisk@monero.town avatar

tar -xvf or we all kill

lseif ,

shouldnt there be a filename argument ?

Enfors ,
@Enfors@lemm.ee avatar

Yes. However, if you had skipped the -f, it would have been valid. Without the filename argument, it assumes it should extract from the tape drive (TAR = Tape ARchive). The tape device is probably something like /dev/rmt0, but you don't need to specify that. Using the -f is technically an exception which means "instead of extracting from the tape like you'd normally do, pretend that this file is the tape device instead."

barsoap , (Bearbeitet )

GNU tar, at least a modern one, that is the one that happens to come with my system, won't try to read from /dev but stdin and then complain that it's a terminal and refuse.

Quoth POSIX on the f flag:

Use the first file operand [...] as the name of the archive instead of the system-dependent default.

That is GNU is compliant, here, the default is system-dependent. f - is required to be stdin, though, so you can bunzip2 foo.tar.bz2 | tar xf - or such in a portable manner, don't have to rely on tar having a z option (which is nonstandard) or it auto-detecting compression (even more nonstandard). What is not standard either is tar -x: Tar doesn't take leading hyphens. Tar is one of those programs so old its command line syntax got standardised before command line syntax standards were established. OTOH it's not nearly as bad as dd, you can interpret how tar does things in the same way as git pull: It's a subcommand, not a flag.

tisktisk ,
@tisktisk@monero.town avatar

"one of those programs so old its...syntax got standardized before command line syntax standards were established."
--This is wild to learn, but also confusing. How does tar not take leading hyphens, but I've only ever used it as such without error of any kind? Not even bragging I've been doing that for 10+ years too lol

barsoap , (Bearbeitet )

Hmm. Actually you prompted me to dig a bit deeper: tar goes all the back to Version 7 UNIX, 1979, but the command line syntax is shared with tap, included in Version 1, man page dated to 1971-11-03. Development of C started 1972. Might've been written in B, you'd have to unearth a source archive I bet it's around somewhere. But anyway if you look through the other Version 1 commands a lot of them don't take hyphen commands, ls does, e.g. rm doesn't on account of only taking file names as arguments.

dd is actually younger, Version 5, 1974, the syntax apparantly comes from IBM's JCL.

Admittedly, that's all before my time.

Both BSD and GNU tar take hyphens, I don't really have any experience with anything else but a short stint with Solaris in the early 2000s (very emphatically before Sun got gobbled up by Oracle) and I don't remember hyphens tripping me up. Much unlike killall. And I'm apparently not alone in that.

tisktisk ,
@tisktisk@monero.town avatar

I definitely still killed us all, but at the same time how are you supposed to know any of the filenames if none are given from the comic?
I guess my real answer is to 'tar -xvf' then hit tab with hopes of decent file completion functionality lol

lseif ,

tar -czf $(ls | head -n1) if we dont trust globs

or run find in /bin or something

recapitated ,

ya blew it kid

  • Alle
  • Abonniert
  • Moderiert
  • Favoriten
  • random
  • linuxmemes@lemmy.world
  • haupteingang
  • Alle Magazine