DOS is dead, long live the command line
The command prompt window
Internal and external commands
There are two kinds of commands that can be run from the command prompt. There are the internal commands that are built into the command interpreter like “del” and “dir”. These commands can only be run from a command prompt (or by invoking the command interpreter in some other way). They are listed in the table below. There is also a large list of external commands that use an additional executable file that can be run from either the command prompt or the Start-Run line. Details of the various commands are available in several places. In the Professional version of Windows XP there is a help file ntcmds.chm, which has details of all the commands and their many switches. The help file can be opened by entering (without the quotes) "hh ntcmds.chm" into Start-Run. It may or may not be in the Home Edition, depending on what setup you have. However, in both versions a list of many (but not all) of the commands available can be obtained by entering "help" (without quotes) into a command prompt. For more detail on a specific command, enter "help command-name" or "command-name /?" For example to get information on the command xcopy, enter "help xcopy" or "xcopy /?”. Microsoft keeps moving things, but the last time I checked they had a command line reference at this link. Some of the commonly used commands are discussed on this page and in the list given here.
assoc | dir | move | set |
break | echo | path | setlocal |
call | endlocal | pause | shift |
cd | exit | popd | start |
cls | for | prompt | time |
color | ftype | pushd | title |
copy | goto | rd | type |
date | if | rem | verify |
del | md | ren | volume |
Some symbols that are used
In addition to the commands, there are several symbols that are used. These modify or combine the actions of commands. The table below gives a list.Symbol | Function | Example |
---|---|---|
> | Sends output to a named file. If file does not exist, it creates one. Overwrites existing file | command > somefile |
>> | Appends output to contents of a named file or creates a file if none exists | command >> somefile |
< | Uses contents of a named file as input to a command | command < somefile |
¦ | Sends ("pipes") the output of command1 to the input of command2 | command1 ¦ command2 |
& | Used to combine two commands. Executes command1 and then command2 | command1 & command2 |
&& | A conditional combination. Executes command2 if command1 completes successfully | command1 && command2 |
¦¦ | Command2 executes only if command1 does not complete successfully. | command1 ¦¦ command2 |
@ | Used in batch files at the beginning of a line to turn off the display of commands | @echo off |
A frequent use of the redirection is to save some output to a text file. For example the command
dir somefolder > somefile.txt
sends a list of the files in "somefolder" to a text file "somefile.txt". More about this type of use is on this page. A common use of the "pipe" is to control the screen display of some command with a lot of output. For example, if you want to check the list of files in a folder with many files, you can display one full screen at a time by piping to the command "more" dir somefolder ¦ more
EN LOS PROXIMOS DIAS TENDREIS LA INFORMACION DE COMO QUITAR LA PROTECCIÖN DE LA GENERALITAT VALENCIANA
ResponderEliminar