Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
It should be a crime to directly link XKCDs images without the corresponding page.
I understand and sympathize with Rob on a spiritual level.
I remember it like this:
tar -extract ze file
and
tar -compress ze file
And also tar -the fuck is in this file
z is for gz files only though, there are plenty of others. xf autodetects and works with all of them (with GNU tar att least).
I hope whoever thought -l
should mean "check links" instead of list has a special place in Hell set aside for them.
I have no idea what print a message if not all links are dumped
even means.
Was gonna say this. Why TF is list not -l as...everywhere else?
You also don't need the dash for the short options.
Also, if you're compressing with bzip2 and have archives bigger than a few megabytes I'll like you a lot more if you do it with --use-compress-prog=pbzip2
You also don’t need the dash for the short options.
True, but I refuse to entertain such a non-standard option format. It's already enough to tolerate find
's.
Technically the notation with dashes is the non-standard one - the dash form is a GNU addition. A traditional tar on something like Solaris or HP-UX will throw an error if you try the dash notation.
It's also traditional to eat raw meat, but we discovered fire at some point.
Those are straightforward; it's the remaining 900 options that are confusing. I always need to look up --exclude
s and always get --directory
wrong, somehow.
Ah yes, that's the linux community as I know it. There is one thing someone wants to achieve and dozens of ways to do it. ;)
Nah I just use 7z
Why when explaining, giving examples of shell command are people so often providing shortened arguments. It makes it all seam like some random letters you have to remeber by heart. Instead of -x just write --extract. If in the end they endup using the tool so often they need to write it fast they'll check the shortcuts.
I don't even mind the shortened arguments too much, though it doesn't help. It's more that every example seems to smush them together into a string of letters.
I would have found
tar -x -f pics.tar ./pics
to be clearer when I was learning. There's plenty of commands which allow combining flags but every tar tutorial seems to do it from the beginning.
I don't think tar is actually hard, we are just in the time where we externalize more information into resources such as Google. Its the same reason why younger people don't remember routes by name or cardinal direction as much anymore.
side note: $ tldr is much better than man for just getting common stuff done.
Yes, but still tar options are kinda janky.
The “-“ is often not necessary. I use it as a guide to see how long the person running tar has been using it.
Example:
tar -xf file.tar == tar xf file.tar
They are functionally flags though and uniletter flags should be preceded by a '-', so I would still prefer to have the '-' written, because it conforms with the standard.
Simple:
tar -(whatever options you want here, my go to is xvzf or cvzf) archive-name.tar file/folder-to-compress
Create ze vuking file
Xtraxt ze vuking file
I know the basics off by heart. Not the hardest command syntax to learn all things considered.
The most annoying would be the growing collection of "uber commands" which are much more of a pain in the ass - aws, systemctl, docker, kubectl, npm, cargo, etc. - the executable has potentially dozens of subcommands, each of which has dozens of parameters.
I use Linux for years and still Google every time I have to use it!
Why?
For me it's because I don't use it very often, mostly just archiving stuff every few months or so.
tar
is just the worst shell command in existence. Why do people still bother with it?
Because it is faster to transport one big ass tar than 10k individual files, and compression is waste of time.
Yes, that's all very well, but you'll still need to find that image the next time you want to use it.
What is "listing"?
lists the files in the archive. So you don't need to extract the entire archive. Useful for huge archives.
Thanks!
As a mnemonic I usually read the "f" as "fucking":
tar
,c
ompressf
uckingpics.tar.gz
with junk from./pics
tar
, ex
tractf
uckingpics.tar.gz
That's only for scripting though. Most of the time I simply right-click the directory or archive, and let Engrampa deal with it.
Thank you, I still don't understand.
I just have pack
and extract
functions in my shell RC files that look at file extensions and use the proper tool with proper arguments.
Wrote them 10 years ago and they've worked flawlessly ever since!
dtrx is the way to do it. It's short for "do the right extraction", and it just works.
Also, all you have to remember for tar is "-xtract -zee -vucking -files" (extract the fucking files, but first letters only)