All Topics  
Command (computing)

 

   Email Print
   Bookmark   Link






 

Command (computing)



 
 
In computing
Computing

Computing is usually defined as the activity of using and developing computer technology, computer hardware and computer software. It is the computer-specific part of information technology....
, 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
Command line interface

A command-line interface is a mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks....
, such as a shell
Shell (computing)

In computing, a shell is a piece of software that provides an Interface for users. Typically, the term refers to an operating system shell which provides access to the services of a kernel ....
.

Specifically, the term command is used in imperative
Imperative programming

In computer science, imperative programming is a programming paradigm that describes computation in terms of statement s that change a program state ....
 computer languages. These languages are called this, because statements
Statement (programming)

In computer programming a statement can be thought of as the smallest standalone element of an imperative programming language. A program is formed by a sequence of one or more statements....
 in these languages are usually written in a manner similar to the imperative mood
Imperative mood

The imperative mood is a grammatical mood that expresses direct commands or requests. It is also used to signal a prohibition, permission or any other kind of exhortation....
 used in many natural language
Natural language

In the philosophy of language, a natural language is a language that is spoken, Sign language, or writing by humans for general-purpose communication, as distinguished from formal languages and from constructed languages....
s.






Discussion
Ask a question about 'Command (computing)'
Start a new discussion about 'Command (computing)'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In computing
Computing

Computing is usually defined as the activity of using and developing computer technology, computer hardware and computer software. It is the computer-specific part of information technology....
, 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
Command line interface

A command-line interface is a mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks....
, such as a shell
Shell (computing)

In computing, a shell is a piece of software that provides an Interface for users. Typically, the term refers to an operating system shell which provides access to the services of a kernel ....
.

Specifically, the term command is used in imperative
Imperative programming

In computer science, imperative programming is a programming paradigm that describes computation in terms of statement s that change a program state ....
 computer languages. These languages are called this, because statements
Statement (programming)

In computer programming a statement can be thought of as the smallest standalone element of an imperative programming language. A program is formed by a sequence of one or more statements....
 in these languages are usually written in a manner similar to the imperative mood
Imperative mood

The imperative mood is a grammatical mood that expresses direct commands or requests. It is also used to signal a prohibition, permission or any other kind of exhortation....
 used in many natural language
Natural language

In the philosophy of language, a natural language is a language that is spoken, Sign language, or writing by humans for general-purpose communication, as distinguished from formal languages and from constructed languages....
s. 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 argument
Parameter

In mathematics, statistics, and the mathematical sciences, a parameter is a quantity that defines certain characteristics of systems or function s....
s describe what the command acts on. Comparing to a natural language: the flags are adverbs, whilst the other arguments are object
Object (grammar)

An object in grammar is a sentence element and part of the sentence Predicate . It denotes somebody or something involved in the subject's "performance" of the verb....
s.

Examples

Here are some commands given to a command line interpreter
Command line interpreter

A command-line interpreter is a computer program that reads lines of text entered by a user and interprets them in the context of a given operating system or programming language....
 (Unix shell
Unix shell

A Unix shell is a command-line interpreter and script host that provides a traditional user interface for the Unix operating system and for Unix-like systems....
):
  • 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.
  • ls
    Ls

    In computing, ls is a command to list files in Unix and Unix-like operating systems. ls is specified by POSIX and the Single UNIX Specification....
     -l -t -r /bin
    Filesystem Hierarchy Standard

    The Filesystem Hierarchy Standard defines the main directories and their contents in most software systems using UNIX and Unix-like operating systems....
  • ls
    Ls

    In computing, ls is a command to list files in Unix and Unix-like operating systems. ls is specified by POSIX and the Single UNIX Specification....
     -ltr /bin
    Filesystem Hierarchy Standard

    The Filesystem Hierarchy Standard defines the main directories and their contents in most software systems using UNIX and Unix-like operating systems....
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
    Cat (Unix)

    The cat command is a standard Unix program used to Concatenation and display files. The name is from :wikt:catenate, a synonym of concatenate....
     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 DOS
DOS

DOS, short for "Disk Operating System", is a shorthand term for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions Windows 95, Windows 98, and Windows Me....
, OS/2
OS/2

OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "IBM Personal System/2 " line of second-generation personal computers....
 and Microsoft Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
 command prompt). Notice that the flags are identified differently but that the concepts are the same:
  • dir /A
This lists all the contents of the current directory. "dir" is the command and "A" is a flag. There is no argument.
  • type
    Type (command)

    In computing, type is a command in various OpenVMS, CP/M, DOS, OS/2 and Microsoft Windows command line interpreters such as COMMAND.COM, cmd.exe, 4DOS/4NT and Windows PowerShell....
     /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.


See also

  • List of Unix programs
    List of Unix programs

    This is a list of UNIX utilities as specified by IEEE Std 1003.1-2004, which is part of the Single UNIX Specification .These utilities can be found on UNIX Operating systems and most UNIX-like operating systems....
  • List of DOS commands
    List of DOS commands

    A partial list of the most common Command s for DOS follows.In versions 5 of DOS and later, the user can get help by typing help at the shell prompt....
  • Formal grammar
    Formal grammar

    In formal language theory, grammars, also called formal grammars or generative grammars, are a formalism used to describe formal languages – i.e....


External links

  • from FOLDOC