Some commands in the middle of linux are a horizontal bar and some commands are two horizontal bars. Is there any difference?

  html5, question

Such as mkdir –help and mkdir-p.

Is it true that using simplified commands is one horizontal position and using all commands is two?
For example, ls -a and ls-all ……

Is linux a great god?

Just a while ago“UNIX Programming Art”In10.5Section mentioned, come and answer it.

There are three types of command line options for Unix programs: Unix, GNU, and X toolkit.

Unix style

That is what the subject said-aThis. When an option requires parameters, it can be followed by the option (or with spaces). For example, when logging into mysql server:

$ mysql -u root -p

Or ..

$ mysql -uroot -p

Either way. In this case, root is the parameter of U, which means logging in with root user. In addition, there is no clear stipulation on how to deal with the program with or without spaces.

GNU style

That is what the subject said--helpIn this case, two hyphens plus a keyword (instead of a single character) are used. This style was developed because there are some complicated GNU programs, only 26 letters (or 52 uppercase and lowercase) are not enough. The other one is a little easier to understand, because there are no longer abbreviated letters. Option parameters can be split with spaces or with “=”. For example:

$ ls --human-readable --sort=time

If Unix style is used, the last command is

$ ls -ht

Is it easier to read?

X toolkit style

This is a less common style, using a single hyphen plus keywords. Only X-related programs use this style, which is generally not recommended.

$ xeyes -display joesws:0 -geometry 1000x1000+0+0

It looks similar to GNU except that the double hyphen has been changed to a single hyphen.