by bluenose69 · 4y ago · 0 comments
Is it really difficult to learn that e.g. "rm" stands for "remove"? I've known very few people who found it difficult to learn the key things very quickly.
And not having to type (and spell) full words is a relief. (I know a shell can take care of spelling, but not all unix commands are entered interactively.)
Still, the article is interesting, and worth reading.
As another example : the -v option. In most tools this means "verbose". In some tools, but not all, you can pass it multiple times to increase the level of verbosity. But then there are a few tools, e.g. top, where -v seems to mean "version" [0]. Or take the -h option. On many tools it stands for "help". But on tools like ls or sort, it stands for "human-readable".
To me personally this is not an issue - I know by heart a few combinations of options that I use frequently, and I know where to find out the details of those, as well as other options I use less frequently. But I can see how it would be easier for people to pick it up if those things were just a little more standardised.
This version of ps accepts several kinds of options:
1 UNIX options, which may be grouped and must be preceded by a dash.
2 BSD options, which may be grouped and must not be used with a dash.
3 GNU long options, which are preceded by two dashes.
And:Note that "ps -aux" is distinct from "ps aux". The POSIX and UNIX standards require that "ps -aux" print all processes owned by a user named "x", as well as printing all processes that would be selected by the -a option. If the user named "x" does not exist, this ps may interpret the command as "ps aux" instead and print a warning.
Edit: On my system, "ps -aux" does the same thing as "ps aux" and no warning is printed, despite the what the man page says. I'm not going to try to create a user named 'x' though.
PS> gcm *build*
CommandType Name Version Source
----------- ---- ------- ------
Alias Build-Checkpoint 5.8.6 InvokeBuild
Alias Build-Parallel 5.8.6 InvokeBuild
Alias Invoke-Build 5.8.6 InvokeBuild
Application mcbuilder.exe 10.0.2200… C:\Windows\system32\mcbuilder.exe
Or find everything from a module: PS> gcm -m InvokeBuild
CommandType Name Version Source
----------- ---- ------- ------
Alias Build-Checkpoint 5.8.6 InvokeBuild
Alias Build-Parallel 5.8.6 InvokeBuild
Alias Invoke-Build 5.8.6 InvokeBuild
And at least if you use `MenuComplete` for tab (`Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete` in your profile), you can also just write `*<noun>` and hit tab. It will offer completions regardless of the verb.