Btw, GNU tar has long options.
Programmer Humor
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
I just remember zxvf, but if I have to do anything else then extract a tar.gz we’re fucked.
I remember those 2 and thats all I need.
tar -extrakt ze file
tar -compress ze file
tar -extract -file
tar -compress -xz -file
tar -extract -any -file is easier, auto detect the compression based on filename.
xtract ze vucking file
Then comes a .tar.bz2 file along and you're screwed. xtract je vucking file?
Pro tip: -z, -j are not needed by tar anymore since many years, tar will autodetect what compression was used if your distro is anything remotely modern.
Pro tip: -z, -j are not needed by tar anymore since many years, tar will autodetect what compression was used if your distro is anything remotely modern.
😵
v is just verbose, right?
Yep.
I'm so proud of me when I remember this. Hackerman!
Yeah tar is easy. Regex on the other hand..
Oh jeez, I use regex at least 2-3 times a week. It's really not too bad for simple stuff and doing basic search and replace operations in text editors
Nothing a .*
can't solve
I can remember regex, but I need to check tar almost every time.
A little trick I learned on here was to imagine yourself as a little evil man saying "Extract ze files!" in a German accent. Extract ze files >>> xzf.
That sounds a lot like Czech, "ze" means "from" if you translate it into English
Looks, not sounds. Ahoj!
I still use that. 😅
Only works for tar.gz. Remember there's also tar.xz, tar.bz, tar.bz2 and half have their own extractor flag. FUN. It's usually J.
The post only calls for "a valid tar command", not that it has to work for any specific circumstance.
tar -tvf
is a favorite of mine.
I wish more people knew about dtrx (Do The Right eXtraction).
Or in this case, https://github.com/tldr-pages/tldr
And it’s fast implementation, https://github.com/dbrgn/tealdeer
I didn't know about -d
.
They meant the command dtrx, the combination of dtrx as parameters to tar make no sense. Extract AND append?
haha, ok thanks. So https://github.com/dtrx-py/dtrx
I'd initially assumed that it was a mnemonic but yes, listing and appending and extracting together is nonsensical, as tar notes: tar: You may not specify more than one '-Acdtrux', '--delete' or '--test-label' option
Ayy Debian has been my main for like ten years. Dtrx is one of the ten things I apt immediately every time I have a re install
tar --help
is a valid command
For GNU tar
it is, for any other version I would not be so sure. Especially when disabling an atomic bomb.
More of a request than a command, I'd have argued
I command you to show me the manual
tar xvf somearchive.tar
Is that right? )= I'm scared I lost.
user@server:~> tar xvf somearchive.tar
tar: somearchive.tar: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
Scheiße...
Yep that's valid.
Wouldn't tar --help suffice? Afaik, it returns exit code 0.
Depends. Is it GNU tar, BSD tar or some old school Unix tar?
Double hyphen "long options" are a typical GNU thing.
If you can't tar to a pipe into ssh to a remote host and untar into an arbitrary location there, are you really using Unix?
What the fuck lmao I didn't know that was possible
I had to pipe dd through gzip over SSH recently to locally image a disk on a cloud server. That was fun.
tar -cvf CowsLookLikeMaps.tar CowsLookLikeMaps