Movatterモバイル変換


[0]ホーム

URL:


Microsoft Wiki

DiscordTwitter (X)Fanon Wiki

READ MORE

Microsoft Wiki
Don't have an account?
Register
Sign In
Skip to content
Microsoft Wiki
1,356
pages
Cleanup
Cleanup
To meet the Microsoft Wiki's quality standards, this article or section may require cleanup. Please help byimproving the article.
Question book-new
This articleneeds additionalcitations forverification.
Please helpimprove this article by addingreliable references. Unsourced material may be challenged and removed.


Incomputing, acommand is a directive to a computer program to perform a specific task. It may be issued via acommand-line interface, such as ashell, or as input to a network service as part of anetwork protocol, or as an event in agraphical user interface triggered by the user selecting an option in amenu.

Specifically, the termcommand is used inimperativecomputer languages. The name arises becausestatements in these languages are usually written in a manner similar to theimperative mood used in manynatural languages. If one views a statement in animperative 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 or options, which modify the default behaviour of the program, while furtherarguments may provide objects, such as files, to act on. Comparing to a natural language: the flags are adverbs, while the other arguments areobjects.


Examples[]

Here are some commands given to acommand-line interpreter (Unix shell).

The following command changes the user's working position in thedirectory tree to the directory/home/pete. The utility program iscd and the argument is/home/pete:

cd /home/pete

The following command prints the textHello World on thestandard output stream, which, in this case, just prints the text on the screen. The program name isecho and the argument is "Hello World". The quotes are used to preventHello andWorld being treated as separate tokens:

echo "Hello World"

The following commands are equivalent. They list files in the directory/bin. The program isls, having three flags (l,t,r), and the argument is the directory/bin:

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

The following command displays the contents of the filesch1.txt andch2.txt. The program name iscat, having two file name arguments:

cat ch1.txt ch2.txt

Here are some commands for theDOS,OS/2 andMicrosoft Windows command prompt processor. The following command displays the contents of the filereadme.txt. The program name istype and the argument isreadme.txt.[1]

type readme.txt

The following command lists the contents of the current directory. The program name isdir, andQ is a flag requesting that the owner of each file also be listed.[2]

dir /Q

See also[]

  • Gesture recognition
  • List of Unix commands
  • List of DOS commands
  • Formal grammar

References[]

  1. "Type - Display a text file - Windows CMD". SS64.com. Retrieved 14 March 2019. 
  2. "DIR - list files and folders - Windows CMD". SS64.com. Retrieved 14 March 2019. 

External links[]

File:Wikibooks-logo-en-noslogan.svgWikibooks has a book on the topic of


Smallwikipedialogo
Wikipedia
This page usesCreative Commons Licensed content fromWikipedia (view authors).
Community content is available underCC-BY-SA unless otherwise noted.

[8]ページ先頭

©2009-2025 Movatter.jp