Command line
Caveats
Most if not all pages are just rough notes, and these pages as a whole are far from complete. More notes will be added in time, eventually, maybe.
If, from reading these notes, you conclude that I am off my rocker, you won’t be the first, and you may even be right.
No doubt there are a dozen and one reasons why none of this would ever work, but perhaps somewhere deep down there is a tiny fragment that could be used for something.
Contents
Syntax
Command structure
Sub-commands should also be either formalised or proscribed. Sub-commands are where a single executable can perform multiple tasks, by way of a token on the command line that resembles a file but isn’t. For example, in the following command, “genrsa” is a subcommand and not a filename or an argument:
openssl genrsa -des3 -out domain.key 2048
More troublesome, “-des3” (use Triple DES cipher) technically means “-d -e -s 3” (three separate options) but there is no consistency with historic commands and OpenSSL is using long options with a single hyphen-minus. The netstat command in Windows accepts bundling just as with Linux, making the following commands equivalent:
netstat -an
netstat -a -n
Despite this, and despite the more general Linux convention of using a double-hyphen-minus for long options, PowerShell adopted a single hyphen-minus while using exclusively long options, furthering the confusion.
File globs
It ought to be time to determine how to satisfy the conflict between whether a term on the command line denotes a file or file glob, or whether it denotes an application-specific term. e.g. “locate 'fred*'” means ‘find all files whose names end “fred”’, not ‘find all files whose names match any of the names in the current directory whose names end “fred”’.