How to enable wireless within Linux?

Is a negative sign "-" used within Linux commands to enable or disable options?

  • Answer:

    Well, it is reasonable to assume that, in a GNU/Linux command line (shell), a "+" would "turn on" or enable a command option, while "-" would "turn off" or disable an option... Unfortunately, and for purely historical reasons, this assumption is wrong. First of all, note that the "-" character is known (in English anyway) by several names, each name having a different meaning or connotation: dash (a generic name for it), minus (implying subtraction or negation), and hyphen (in the context of hyphenating or breaking words into syllables) are probably the most common ones. In the context of the GNU/Linux command line, it's best to not use the name "minus" when talking about command options, thus removing the notion of "negation" from this use.  It's more helpful, in the command line context, to refer to this character which leads (introduces) each command option as a "dash" or a "hyphen". In fact, the man-page (online documentation) for bash (see below) doesn't call the "-" character by any name... it just uses the character literally to stand for (name) itself. A command option (or simply option) is also known as a switch or flag, and is always introduced (preceded) by one "-" or two "--" character(s).  A single "-" is used to introduce single-character options like "-h", "-v" and "-d" (for example); this form is called a "short" or "single-character" option (switch or flag). A double "--" is used to introduce what is called a "multi-character" or "long-form" option, like "--help", "--verbose" and "--debug" (for example). The rules, conventions and common practice for command options in Unix-family shells are seemingly simple at first glance; here are some examples: $ cp -v file1.txt subdir/file2.txt This is a rather ordinary copy command, using the -v "verbose" flag to copy the first file into a subdirectory using a (slightly) different filename.  Using more than one switch is likewise simple, in two equivalent forms: $ cp -v -n file1.txt subdir/file2.txt      # options specified separately... $ cp -vn file1.txt subdir/file2.txt        # ...or "combined" with one leading dash Using the equivalent long-form flags: $ cp --verbose --no-clobber file1.txt subdir/file2.txt Here, -v is equivalent to --verbose, and -n is equivalent to --no-clobber (which means "don't copy if the target file already exists"; and note that the appearance of yet another hyphen in "no-clobber" is not a problem). A few other things to note: The rules for options are primarily enforced (by the software developers who write and maintain Unix and GNU/Linux programs designed for use at the command line) by convention, not by formal standards — certain rare exceptions to (breakages of) these conventions do exist across the large repertory of Unix/GNU/Linux command-line utilities. Although there's a common practice, there is no formal standard which covers what a single-letter command option means, nor about using the same single letter to mean the same thing (option) across command utilities (programs).  Thus, although -h usually (conventionally) means "display help", and -v usually means "verbose mode", this is not enforced, and some other program is free to define its own single-letter options any way it wants. If both lower- and upper-case options exist for a particular command (program), such as -d and -D, they would implement different, distinct options, following the Unix principle of case-sensitivity. Both short and long-form options can be used in the same command, but short-form options must appear before long-form options (this according to the bash man-page). All options must appear following the command (program) name, but must precede any command arguments (things like filenames, directories, etc.). Although the basic syntax involving command options is pretty simple — and this will suffice for most folk's casual use, there are more involved syntax rules for special and advanced situations.  See the bash man-page for more information. The notion, vocabulary, syntax and practice of Unix-family (including GNU/Linux) command line options inherits from the original Unix command shell, the Bourne shell sh, written in the mid-1970s by Stephen Bourne of Bell Labs, and first released in 1977 as a standard component of Unix Version 7 (see the Wikipedia articles: http://en.wikipedia.org/wiki/Unix_shell; http://en.wikipedia.org/wiki/Bourne_shell; http://en.wikipedia.org/wiki/Shell_(computing); http://en.wikipedia.org/wiki/Comparison_of_command_shells; and http://en.wikipedia.org/wiki/Command-line_interface#Command-line_option for a history of command-line shells in general, and likely more than you wanted to know about them). On GNU/Linux, bash (the so-called "Bourne-Again shell") is the command-line shell distributed by most Linux distros by default.  Other descendants of the original sh include csh (the "C shell"), ksh (the "Korne shell"), a POSIX shell (reference standard), and assorted ash, zsh, tcsh, scsh and pdksh shells.  As all of these command-line shells operate within the Unix family of operating systems, they share the basic command option syntax using the "-" as the option-leading character. Contemporary command-line interpreters (CLI, another name for a shell) which do not follow the "-" command option syntax include DCL (Digital Command Language on VMS and OpenVMS), CMD.EXE and COMMAND.COM (on Microsoft Windows).  These command line syntaxes generally follow a convention for specifying command options which dates back to Digital Equipment Corporation's older CLIs on PDP-11 operating system like RT-11, RSX-11M and RSTS/E, where the command option is preceded (introduced) by a "/" slash. Just for a quick comparison, the DCL (VMS) copy command which is (mostly) equivalent to the first cp command give above is: $ COPY /LOG FILE1.TXT [.SUBDIR]FILE2.TXT I've shown this command in upper-case, although it could have been entered in lower- or mixed-case  — DCL case-folds lowercase letters into uppercase.  Here, /LOG is (roughly) equivalent to -v and --verbose, and the VMS directory path specification [.SUBDIR] is equivalent to the Unix/Linux subdir/ ...

Lorin Ricker at Quora Visit the source

Was this solution helpful to you?

Other answers

Minus sign is put to differentiate options from parameters.

Satyam Mishra

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.