Old XKCD, still relevant
Old XKCD, still relevant
Was trying to extract a totally legit copy of Skate 3 I downloaded today to play on my Steam Deck
tar --help
148 1 ReplyIn the true spirit of UNIX, it’s
tar -h
146 0 ReplyF
37 1 ReplyIt's
tar --help
on my system 💥13 0 Replytar -?
,-h
is dereference or smth.4 0 Reply
You just killed us all by putting a space between the dashes
68 0 ReplyFuckin autocorrect was the death of us all.
61 0 ReplyOr by using gnu style options on potentially bsd tar
27 0 Reply
tar -h
85 0 ReplyJust
tar
, no arguments. Does nothing, still a valid command, no?51 0 ReplyExit code 2 -> boom
34 0 Reply
tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options Try 'tar --help' or 'tar --usage' for more information.
31 0 ReplyBoom.
tar --help
for anyone wondering24 0 Reply
I do
tax -xvf filename
72 0 Replytax
Boom.
149 0 Replyah fuck, didn't even notice
49 0 ReplyI like the way you pointed that out lmao
22 0 Reply
.... aaaaaand you've killed us all.
44 0 Reply
tar -czvf tar_name.tar.gz ./
52 0 ReplyI 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.
47 0 ReplyRead it in tf2 medics voice
14 0 Replylol that’s honestly a great mnemonic
1 0 Reply
Yep, have this one committed to memory. Though if it asked me to uncompress a tarball, then I'd be fucked
10 1 Replytar xzvf this_awesome_file.tgz
… fixed. Apparently I can’t type.
9 0 Reply
File not found, now we are dead.
6 0 ReplySounds like an error message from a
valid tar command
3 0 Reply
tar --version
You're welcome
51 0 ReplyI'd have gone with
tar --help
17 0 ReplyIt's insane that this isn't consistent.
Any combination of
-h
,-?
and--help
exists between tools (from 0 to all 3 of them)11 0 Reply
Sorry, the bomb was running MacOS. Your command was not valid and you've doomed us all.
6 0 ReplyIt's literally there at the bottom.
What isn't valid is MacOS, it's macOS now.
2 1 Reply
tar --version
45 0 ReplyRead my mind. :D
3 0 Reply
Somehow, idk why. This one is stuck in my head:
tar -zxvf filename.tar.gz
45 0 Replytar xzvf
eXtract Ze Vucking File
85 0 ReplyI have to do this command often at work and I can never remember the letters perfectly. This is actually useful, thanks!
16 0 Reply
The bomb runs AIX. I'm sorry, you're dead
17 0 Replytar zxvf filename.tar.gz file
?7 0 Reply
Same, never used a mnemonic for it or anything, just
zxvf
Like it's any other word
2 0 Replyz=zip (default in most tar), x=eXtract, v=verbose (not needed in most cases), f=target
2 0 Reply
tar -xzf stands for tar eXtract Ze Filez
43 0 ReplyI like
tar xaf
(eXtract All Files) better.7 0 ReplyYou can skip the z; tar is smart enough to figure it out on its own
6 0 Reply
tar --help
40 0 ReplyThat was my first thought too lol
4 0 ReplyRofl me too twins
2 0 Reply
tar --version
34 0 ReplyOr is it -v
16 0 Reply-v is verbose
21 0 ReplyDepends. Short options are probably safer if the particular version and flavor of tar are unknown.
6 0 Reply
There's an easy mnemonic for that : Compress Ze Vucking File !
33 0 ReplyAlways think about tar commands in your best German accent !
10 0 Reply
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
27 0 ReplyNext time I build a bomb I let the timer continue while the command is running.
35 0 ReplyYeah, what kind of idiot doesn't parallelize their timer function.
15 0 Reply
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"
26 0 Replyi assume its looking for exit code of 0
2 0 Replyecho || tar -xfzhd
2 0 Reply
I'd like to know if there are any XKCDs that are no longer relevant.
22 0 ReplyI'd like to know if there's an XKCD about an XKCD that's no longer relevant.
7 0 ReplyThere 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.
4 0 Reply
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 thexf
part.2 1 Reply
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
redditLemmy 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.19 0 ReplyStay by the phone always. We may need you to defuse a bomb someday.
15 1 ReplyNever thought I'd learn how to use
tar
on a meme post.9 0 ReplyMemes are one of the best source for Linux info 👍.
3 0 Reply
tar -cvzf /etc/
Edit: we're dead :(
18 0 Replytar -xvf or we all kill
16 0 Replyshouldnt there be a filename argument ?
9 0 ReplyYes. 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."
5 0 ReplyI 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
2 0 Reply
ya blew it kid
6 0 Reply
Actually this reminds me, what is the deal with tar command recommendations to use or not use dash? I know GNU tar accepts both (e.g.)
tar xvf file.tar
andtar -xvf file.tar
, but at some points people were like "NO! Don't use the dash! It's going to maybe cause issues somewhere, who knows!" and I was like "OK". Something to do with people up designing the Unix specs?16 0 ReplyI didn't even know the dash was optional. I guess you learn something new everyday.
5 0 ReplyI still use it though. Its how I learned it all those years ago and its ingrained as muscle memory when typing the command.
2 0 Reply
No idea, but with tar I never use dashes. Just tar xf away.
2 0 ReplyPOSIX. POSIX didn't get designed but documented behaviour that was portable between different UNIX flavours and was then declared a standard.
If you're annoyed by it just consider the
xvf
intar xvf
to be a subcommand aspull
is ingit pull
. Tar simply has a fancy subcommand syntax. At least it's notdd
.2 0 Replyidk if it's optional why bother typing it
2 0 Replypersonally, it is a little easier to read, especially in a script. and its more consistent with other commands
9 0 Reply
I just can recall
tar xvzf
but can't even remember what it's supposed to do.15 0 ReplyeXtract, Verbose, gZip, File.
Not sure why it doesn’t need the dash though.
29 0 ReplyThe dash used to be how to could tell how long someone had been using tar. If they started with Linux, they probably use a dash. If they started on a UNIX variant, they probably don’t. Either way, the dash isn’t needed.
Also recently learned that recent versions of tar will autodetect compression. So for extraction, you just need “tar xf “
16 0 ReplyI always learnt it as Xtract Zee File and to make a tar ball, you want to Compress Zee File
14 0 Replytar doesn’t need dashes because it’s weird.
1 0 Reply
Remember: Just tell tar to Xtract Z File.
15 0 ReplyXtract gZipped File
13 0 Reply
I guess
man tar
is cheating, but it is a command involving tar. Not a command using tar, but a tar command...14 2 ReplyI suppose
tar --help
would technically be a valid invoking of the binary itself ifman tar
doesn't13 0 ReplyBut it would not work on older non-GNU versions of tar.
GNU introduced the "--foo" style long options, and it was a long time before Unix versions began adopting them.
3 0 Reply
It didn’t say you could only enter one try, just that you had 10 seconds. The man page should give you something
2 0 ReplyTrue. But then I would use
curl cheat.sh/tar
1 0 Reply
Sudo halt -fn
11 1 Replytar -xzvf file.tar
10 0 ReplyThat's what I had in mind too. Tar's arguments are really intuitive.
x - eXtract
z - use gZip
v - Verbose
f - File (requires the path as an argument)
1 0 Reply
I know tar zxf and xjf off by heart. I probably do 100x as many extracts as creates. Tar is a stupidly antiquated command though.
9 0 ReplyWhy remember/include the algorithm? Tar can infer that. It's just
bsdtar xf filename.*
for everything. (bsdtar handles .zip as well)6 0 ReplyThe bomb said tar.
2 0 Reply
tar cJf file.tar.xz /path/to/file
tar xJf file.tar.xz /path/to/file.tar.xz -C /path/to/untar
is not very hard to remember
8 0 ReplyUnless you use it daily, I think that's something I'd struggle with memorising, I'd just alias it tbh along with ls options
6 0 Reply
tar
8 0 Replytar --help
7 0 Replytar x
7 0 Replytar --help
5 0 Reply
| man tar
9 2 ReplyThis is a valid
man
command, but not atar
command9 0 ReplyI’ll use the man page to find a command; it said 10 seconds, not 1 try!
3 0 Reply
tar -cf file.tar directory/
7 0 Replythat was 8 seconds. close one, i saved us all
6 0 ReplyHow do you know
directory
exists? 😨2 0 Reply
Do people not use tab complete?
7 1 ReplyFound the person who's never used tar :-P
5 0 Reply- Thats not true and
- I am fully aware that there are 127 flags. That just makes this even sillier because you have so many valid options to disarm the bomb.
1 0 Reply
tar -zxvf yourmom.tgz /home/xkcd/yourmomnude/* This was wrong. I intended to be creating a file -zcvf.
6 0 Replytar, the tape archiver, I used it with tape, early 90s
5 0 ReplyI just use ouch
4 0 ReplyI've never had a problem remembering tar, but properly using PV, somehow I'm just not able to store that information in my brain.
4 0 ReplyI memorized tar -cavf file.tar.bz2 directory/* and tar -xavf file.tar.bz2
3 0 ReplyThe fact that this thread contains, like, TONS of invalid invocations that people have been editing for correctness is fucking hilarious.
Also, QED 🤠
3 0 ReplyAnyone else make an untar.sh?
2 0 Replycpio is way worse
2 0 ReplyAll those years of using nautilus have made me weak
2 0 Replytar --extract --file file.tar.gz
2 0 ReplyI always remember that it's eXtract Ze File,
tar -xzf
... But I'll be honest, I've not used it in years and years2 0 ReplyNow do a standard
pax
command.1 0 ReplyWell, bye everyone.
1 0 ReplyTar -xvf
1 0 Reply