Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Command (computing)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|External instruction to a computer program}} {{redirect distinguish|System command|system call}} {{other uses|Command (disambiguation)#Computing{{!}}Command Β§ Computing}} {{refimprove|date=May 2008 }} In [[computing]], a '''command''' is an instruction received via an external [[Interface (computing)|interface]] that directs the behavior of a [[computer program]]. Commonly, commands are sent to a program via a [[command-line interface]], a [[scripting language|script]], a [[network protocol]], or as an event triggered in a [[graphical user interface]]. Many commands support arguments to specify input and to modify default behavior. Terminology and syntax varies but there are notable common approaches. Typically, an '''option''' or a '''flag''' is a name (without [[Whitespace character|whitespace]]) with a prefix such as [[dash]] or [[Slash (punctuation)|slash]] that modifies default behavior. An option might have a required value that follows it. Typically, flag refers to an option that does not have a following value. A '''parameter''' is an argument that specifies input to the command and its meaning is based on its position in the command line relative to other parameters; generally ignoring options. A parameter can specify anything, but often it specifies a [[file (computing)|file]] by [[filename|name]] or [[file path|path]]. The term ''command'' is sometimes also used for internal program instructions, but often other terms are more appropriate such as [[statement (programming)|statement]], [[Expression (computer science)|expression]], [[Function (computer programming)|function]], or [[Conditional (computer programming)|conditional]].<ref>Maurizio Gabbrielli, Simone Martini (2010). Programming Languages - Principles and Paradigms. Springer London, ''6.3.2 Conditional Commands'', p. 140</ref> For example, printing a message in Bash is via the ''command'' [[Printf (Unix)|printf]], while in Python it is via the ''function'' print().<ref>{{cite web | url = https://docs.python.org/3/library/functions.html#print | access-date = 23 October 2023 | title = Built-in Functions - print | publisher = python.org }}</ref> Further, some aspects of adjacent technology are conflated with commands. For example, conditional logic in Bash and Python is called an ''expression''<ref>{{cite web | url = https://docs.python.org/3/reference/expressions.html | access-date = 23 October 2023 | title = Conditional expressions | publisher = python.org }}</ref><ref>{{cite web | url = https://www.gnu.org/software/bash/manual/html_node/Bash-Conditional-Expressions.html | access-date = 23 October 2023 | title = Bash Conditional expressions | publisher = gnu.org }}</ref> and ''statements'' in Java.<ref>{{cite web | url = https://docs.oracle.com/javase/tutorial/java/nutsandbolts/if.html | access-date = 23 October 2023 | title = The if-then and if-then-else Statements | publisher = oracle.com }}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)