MLHA - PC- Software - DOS - Commands
| Redirection: filters and pipes |
2dos.homepage.dk/batutil/help/INDEX.HTM
boss.iele.polsl.gliwice.pl/public/Windows98/OldMSDOS/
home.freeuk.com/foxy2k/doszone/cmdref.htm : DOS Commands Reference
www.computerhope.com/msdos.htm : MS-DOS Commands
www.csulb.edu/~murdock/dosindex.html : DOS Command Index
www.houlden.f9.co.uk/msdos/alphacomm.htm : Alphabetical Index
www.helpfixmypc.com/dos.htm : DOS usage information
www.microsoft.com/technet/archive/msdos/07_refer.mspx

 

Internal Commands: (in COMMAND.COM)
BREAK, CALL, CD, CHCP, CHDIR, CLS, COPY, CTTY, DATE, DEL, DIR, ECHO, ERASE, EXIT, FOR, GOTO, IF, MD, MKDIRr, PATH, PAUSE, PROMPT, RD, REM, REN, RENAME, RMDIR, SET, SHIFT, TIME, TYPE, VER, VERIFY, VOL
 
External Commands: (.COM and .EXE programs)
APPEND, ASSIGN, ATTRIB, BACKUP, CHKDSK, COMMAND, COMP, DEBUG, DEFRAG, DISKCOMP, DISKCOPY, DOSSHELL, EDIT, EDLIN, EXE2BIN, FASTOPEN, FC, FDISK, FIND, FORMAT, GRAFTABL, GRAPHICS, HELP, JOIN, KEYB, LABEL, LINK, MEM, MODE, MORE, MSD, NLSFUNC, PRINT, QBASIC, RECOVER, REPLACE, RESTORE, SELECT, SHARE, SORT, SUBST, SYS, TREE, XCOPY
>External Commands / DOS version

 

  DOS

Internal (in command.com)

External (.com, .exe)

  ver Command Batch Command TSR* Utility
1981 1 copy, date, delete/del, dir, erase, rename/ren, time, type pause, rem chkdsk, comp, diskcomp, diskcopy, format, link, mode, sys command debug, edlin
1982 1.1-2     exe2bin    
1983 2 break, chdir/cd, cls, ctty, exit, mkdir/md, path, prompt, rmdir/rd, set, ver, verify, vol echo, for, goto, if, shift assign, backup, fc, find, more, recover, restore, sort, tree graphics, print fdisk
1984 3     attrib, graftabl, keybda, label, select share  
1985 3.1     join, subst    
1986 3.2     replace, xcopy append  
1987 3.3 chcp call keyb, nlsfunc fastopen  
1988 4     mem   shellc, dosshell
1991 5     expand, loadfix, mirror, setver, undelete, unformat doskey edit, help, qbasic
1993 6   choice deltree dblspace, msav, vsafe defrag, msd

* a TSR (Terminate and Stay Resident) program loads (resident) code into RAM memory - and terminates the loader part of the program.

 

Redirection, Pipes and Filters

Redirection
Directing output ( > ) from a program to a specific file or device (different from the 'standard output' device: the screen).
Directing input ( < ) to a program from a specific file or device (different from the 'standard input' device: the keyboard).
Pipe
A data-channel ( | ) in RAM that takes output from a program and feeds the data as input to another program.
Filter
A program that accepts input data - does something to the data - and delivers output data.
Both input and output may be redirected or piped.
DOS filters: find, more, sort

 

Examples:

dir > list.txt   redirect output from dir to the file list.txt
- if the file does not exist, it is created
- if the file exists, it is overwritten.
dir >> list.txt redirect and append output from dir to the file list.txt
- if the file does not exist, it is created
- if the file exists, output is appended to end of file.
sort < names.txt > list.txt use the file names.txt as input to sort
- output from sort is sent to the file list.txt.
dir | sort pipe output from dir to sort
- output from sort is sent to standard output: the screen.
dir | sort > c:\temp\list.txt - output from sort is sent to the file c:\temp\list.txt.
dir | sort | more - output from sort is piped to more
- more (a filter) delivers output one screenfull at a time.

 

Redirection and pipes may be used in batch files.