It should be a crime to directly link XKCDs images without the corresponding page.
I understand and sympathize with Rob on a spiritual level.
tar --help
cross fingers
tar --hep
Fuck.
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
^r tar
and adjust as needed. Got itMy
tar
command istldr tar
thenctrl + c
/ctrl + v
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?
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.
Does every Linux command have options as words instead of single letters?
Most commands will have expanded arguments started with 2 dashes that usually look like ‘–verbose-name-of-option’, they’re usually listed in the man page/documentation along with the abbreviated letter version
Many do as it’s considered good practice, but it’s not guaranteed, it just depends on the individual command (program). Usually you can use the
--help
option to see all the options, so for instancetar --help
.Tar is as old as IT, that’s why it’s syntax is a bit special.
tar -xf
is not really special combining short options isn’t uncommon.Where tar is nonstandard is that you can leave out the
-
,tar xf
is actually how POSIX specifies it. And we’ve kinda come full circle on that one with many modern utilities using a command syntax, you can readtar xf
as “tar extract file” just as you can readgit pull
as, well, “git pull”.If you want to see a standard command with truly non-standard syntax have a look at
dd
.
tar
, please eXtract the Vucking File!tar -xvf tarbomb.tar
.I would also recommend -v for verbose and -z when compressing for gzip
What does --auto-compress do?
Auto compress will use gzip if the file ends with .gz, bzip if it ends with .bz, and so on without mentioning -z
Just use Ouch!
So a serious question from someone who can’t remember console commands ever despite using them constantly.
Why are so many linux CLI commands set up with defaults that no one ever uses? Like if you pretty much always need
-f
,-v
is often used, and--auto-compress
is needed to recognize type by extension. Why aren’t those the defaults to just usingtar
?A lot of applications I find are like this too, they don’t come with defaults that work or that anyone would ever use.
One reason to keep in mind is backwards compatibility and the expectancy that every Linux system has the same basic tools that work the same.
Imagine you have a script running on your server that uses a command with or without specific arguments. If the command (say
tar
) changes its default parameters this could lead to a lot of nasty side effects from crashes to lost or mangled data. Besides the headache of debugging that, even if you knew about the change beforehand it’s still a lot effort to track down every piece of code that makes use of that command and rewrite it.That’s why programs and interfaces usually add new options over time but are mostly hesitant to remove old ones. And if they do they’ll usually warn the others beforehand that a feature will deprecate while allowing for a transitional period.
One way to solve this conundrum is to simply introduce new commands that offer new features and a more streamlined approach that can replace the older ones in time. Yet a distribution can still ship the older ones alongside the newer ones just in case they are needed.
Looking at pagers (programs that break up long streams of text into multiple pages that you can read one at a time) as a simple example you’ll find that
more
is an older pager program while the newerless
offers an even better experience (“less is more”, ¿get the joke?). Both come pre-installed as core tools on many distributions. Finally an even more modern alternative ismost
, another pager with even better functionality, but you’ll need to install that one yourself.That makes sense!
Damn, I’m using the “tape archiver” (this is what tar means) since I installed HPUX8 in the 90s, from tape, yes…
Yes, that’s all very well, but you’ll still need to find that image the next time you want to use it.
daily-standup.png eh… :)
Who is taking pics of the standup… :)
That looks really cool. And finally a guide that knows
-z
is not necessary all the time.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.
These “uber commands” tend to be much better since they are more explorable with
--help
explanations and readable flags.Much better than the random jumble of characters you’re expected to have memorised for awk, sed, find et al.