Command (computing)

Command (computing)

In computing, a command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell.

Specifically, the term command is used in imperative computer languages. These languages are called this, because statements in these languages are usually written in a manner similar to the imperative mood used in many natural languages. If one views a statement in an imperative language as being like a sentence in a natural language, then a command is generally like a verb in such a language.

Many programs allow specially formatted arguments, known as flags, which modify the default behaviour of the command, while further arguments describe what the command acts on. Comparing to a natural language: the flags are adverbs, whilst the other arguments are objects.

Examples

Here are some commands given to a command line interpreter (Unix shell).

This command changes the user's place in the directory tree from their current position to the directory /home/pete. cd is the command and /home/pete is the argument:

 cd /home/pete

This command prints the text hello out to the standard output stream, which, in this case, will just print the text out on the screen. echo is the command and "Hello World" is the argument. The quotes are used to prevent Hello and World being treated as separate arguments:

 echo "Hello World"

These commands are equivalent. They list files in the directory /bin. ls is the command, /bin is the argument and there are three flags: -l, -t and -r:

 ls -l -t -r  /bin
 ls -ltr  /bin

This displays the contents of the files ch1.txt and ch2.txt. cat is the command and ch1.txt and ch2.txt are both arguments.

 cat ch1.txt ch2.txt

This lists all the contents of the current directory. dir is the command and "A" is a flag. There is no argument. Here are some commands given to a different command line interpreter (the DOS, OS/2 and Microsoft Windows command prompt). Notice that the flags are identified differently but that the concepts are the same:

 dir /A

This displays the contents of the file readme.txt. type is the command. "readme.txt" is the argument. "P" is a parameter...

 type /P readme.txt

See also

External links


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Command — may refer to: Command (computing), a statement in a computer language COMMAND.COM, the default operating system shell and command line interpreter for DOS Command (military formation), an organizational unit Command key, a modifier key on Apple… …   Wikipedia

  • Command line completion — is a common feature of command line interpreters, in which the program automatically fills in partially typed tokens. Depending on the specific interpreter and its configuration, these elements may include commands, arguments, environment… …   Wikipedia

  • command — com‧mand [kəˈmɑːnd ǁ kəˈmænd] noun [countable] COMPUTING an instruction given to a computer using the keyboard or the mouse: • When you have typed the document, use the save command to save it. * * * command UK US /kəˈmɑːnd/ noun [C] …   Financial and business terms

  • Command-line interface — Screenshot of a sample Bash session. GNOME Terminal 3, Fedora 15 …   Wikipedia

  • computing — noun 1. the procedure of calculating; determining something by mathematical or logical methods • Syn: ↑calculation, ↑computation • Derivationally related forms: ↑computational (for: ↑computation), ↑compute …   Useful english dictionary

  • Command, Control and Interoperability Division — The Command, Control and Interoperability Division is a bureau of the United States Department of Homeland Security s Science and Technology Directorate, run by Dr.David Boyd. This division is responsible for creating informative… …   Wikipedia

  • command line — noun commands that a user types in order to run an application • Hypernyms: ↑instruction, ↑command, ↑statement, ↑program line * * * command line noun (computing) A blank line on the screen to the right of a prompt where the user types a command • …   Useful english dictionary

  • Computing Technology Industry Association — The Computing Technology Industry Association (CompTIA), a non profit trade association, was created in 1982 as the Association of Better Computer Dealers, Inc. (ABCD) by representatives of five microcomputer dealerships. Over the course of a… …   Wikipedia

  • Command and control — This article is about command and control in the military. For command and control in the context of civilian organizations, see Command and control (management). Warfare Military history Eras …   Wikipedia

  • Command-line completion — Example of command line completion in Bash. Command line completion (also tab completion) is a common feature of command line interpreters, in which the program automatically fills in partially typed commands. Command line interpreters are… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”