Command (computing)

From Wikipedia, the free encyclopedia

(Redirected from Command (computer science))
Jump to: navigation, search

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.

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

  • cd /home/pete
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.
  • echo "Hello World"
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.
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".
  • cat ch1.txt ch2.txt
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.

Here are some commands given to a different command line interpreter (the Microsoft Windows and MS-DOS command prompt). Notice that the flags are identified differently but that the concepts are the same:

This lists all the contents of the current directory. "DIR" is the command and "A" is a flag. There is no argument.
  • TYPE /P readme.txt
This displays the contents of the file readme.txt. "TYPE" is the command. "readme.txt" is the argument. "P" is a parameter.

Wikibooks
Wikibooks' [[wikibooks:|]] has more about this subject:
Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.