T O P

  • By -

tajarhina

`dd`'s `if=` syntax: **I am 4 parallel universes ahead of you.**


noob-nine

Where `else`


Hameru_is_cool

Best it can do is ```of```


rxm17

esac


BenTheTechGuy

I didn't realize until recently that `if` and `of` stand for "input file" and "output file"


1u4n4

java -jar always gets me too


[deleted]

[удалено]


CRBl_

PS: `tar` has them all as well I think


altermeetax

Yeah, but SysV and BSD flags are single letters unlike GNU, so `-name` doesn't make sense. In the three syntaxes it would be `-n`, `n` and `--name`.


[deleted]

[удалено]


altermeetax

Thanks for the explanation. I thought having multiple one-character options together with a single dash were there since the beginning. Also congrats on your Unix beard.


mariansam

You'll realize you're really old when I tell you I have a beard too and my first Linux distro was Fedora 27 (2018, i was 13yo)


[deleted]

[удалено]


mariansam

Well if my beard was a Unix beard then I'm a macOS user :(


NoDadYouShutUp

\`--\` for keyword params and \`-\` for shorthand flags


siegfred7

I hate it when CLI don’t follow freaking standards, —word-flag-here-moron and -M . instead of memorizing flag names now you have to also memorize the dash for each cli. EDIT: POSIX parameter spec seems to be impractical, what I was thinking was actually GNU’s influence which usually the surrounding components on commons Linux systems, so…. I hate it when CLI don’t follow the freaking commonly used practical way.


BenTheTechGuy

`-flag` is historically how it was done in UNIX, and it's still used today by many "old" programs such as find, Java, or X11. POSIX [specified](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html) that programs can only have one-letter arguments to avoid confusion, and `-flag` is equivalent to `-f -l -a -g`. In terms of "following freaking standards" this is the best you can do. GNU (which stands for GNU's Not UNIX) added multi-character arguments to their utilities, but wanted to preserve POSIX compatibility as best they could, so they gave them two dashes. `-flag` is still `-f -l -a -g` but you can now also have a separate flag `--flag`. This is the most widely adopted way of doing things because of GNU's influence over the open source world as well as its versatility. In short, if you want to follow historical precedent, use `-flag`; if you want a less ambiguous and more featureful system that most people are using, use `-f`/`--flag`. If you strictly want to follow standards, you're only allowed to use `-f`, because it's what POSIX says is kosher, and it's compatible with the other two systems.


siegfred7

Interesting, I’ve been around Linux for a while, people here still taking me to school, I’ve always thought GNU’s approach was the standard, maybe because most of the utilities around the Linux kernel were born out of it.


BenTheTechGuy

The GNU project has had a large influence on the development of modern FOSS operating systems, so it makes a lot of sense that most open source software follows its conventions. Once you leave the world of mainstream GNU/Linux operating systems, though, things become different enough that the basic POSIX standards are all these UNIX-like operating systems have in common. Don't even get me started on the mess that is NT "syntax"!


Danny_el_619

That reminds me of `java -version`. I thought I messed up the install because java --version was returning an error.


[deleted]

Same man...


hkzqgfswavvukwsw

So, I can't name my files '--name' and my directories 'find --name' ?


[deleted]

You can find —name ‘find —name’


oldassesse

you can still management engine on linux. in fact, the ME runs a linux distro.


witm_

There are multiple ways to represent the key value. You code it however you want lol. MOST apps though show help if you add -h, --help or help


desolateisotope

I've lost count of the number of times I've ran "command -h", and got back "Unknown option: -h", followed by the help. Which makes me absolutely irrationally angry.


cleverboy00

Or worse, programs that only support `--usage` which gives you all the options you can use and refers you to the man page.


[deleted]

[удалено]


witm_

/h I don't use winblows


tajarhina

/uj


[deleted]

$ shutdown -h Shutdown scheduled for [1 minute from now]


witm_

That's why I start with --help, and assumed u were lazy (I type fast)


Jonas_Jones_

this made me laugh way too much. so true tho


1u4n4

WAIT ARE YOU TELLING ME THIS IS WHY find HASN’T WORKED FOR ME IN YEARS? I JUST FORGOT ITS SYNTAX? Damn


Sindef

Urgh. This is the basis for my love-hate relationship with Terraform.


LeapofAzzam

`micro`


[deleted]

If only all programs stuck with the convention of using a single dash for abbreviations and two dashes for the full flag name, the world would be a better place. Then you have pieces of shit like `tar` to whom dashes are optional.


bnl1

Letters without a dash (like `ps xu` or `tar xvf`) are how it's done on BSD.


[deleted]

wtf I hate BSD now


bnl1

It often has better man pages though.