Command Options


Most of the commands given in this appendix can be given options, also known as switches or arguments. To supply an option to a command, follow the command name with a space, and then with a dash, and then the letter of the option. For example, to display a directory listing in long format, the option to use is l. Therefore, the command looks like this:

ls -l


If the option you are supplying requires more than one character (for example, if it's a complete word), you must use a double dash before the option (an example would be --password). If you don't, each letter will be treated as a separate option, which can have unexpected or even destructive effects depending on what the options do.

Note that because letters are treated as separate arguments if preceded by a single dash, you can supply multiple options to a command all in a single argument. For example, to list all the files in the directory (including hidden files) as well as list the directory in the long format, you could use the following command:

ls -al


Some options take arguments of their own, which can be specified in any of several ways:

crontab -u frank mysql --user=root


In most cases, commands that operate on files or have a certain required argument (such as the kill command, which must be given a process ID number to operate on) require that the options go between the command name and the required argument or filename. For example:

kill -1 1453


Be aware that these are only conventions, and there are commands that don't behave as described here. Always check the man page for a command you're unfamiliar with to make sure its options will behave the way you expect.




FreeBSD 6 Unleashed
FreeBSD 6 Unleashed
ISBN: 0672328755
EAN: 2147483647
Year: 2006
Pages: 355
Authors: Brian Tiemann

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net