Você está na página 1de 3

Unix and DOS Command Cross-Reference

Leo Leung The Unix command listed in this cross reference are categorized into four areas: Directory Management File Management Misc (including control keys) Foreground/Background Job Control (for ksh and bash) mtools (for floppy disk access)

Directory Management
Unix Command ls ls -l ls | more ls -a ls -F mkdir dir rmdir dir cd dir cd pwd DOS equivalent dir /w dir dir /p Remarks list (ls) directory entries dir in long format dir page by page show all files (including hidden files) show file type (dir/ exe*) make directory remove directory change directory back to home directory print working directory (i.e., current directory)

md dir rd dir cd dir cd

File Management
Unix Command cp file1file2 cp filedir mv file1file2 mv filedir rm file rm -r dir cat file more file lpr -x file find . -name "file" -print DOS equivalent copy file1file2 copy filedir ren file1file2 move filedir del file deltree dir type file type file | more print file dir file /s Remarks make a copy of file1, name the duplicate as file2 copy a file into the dir rename file1 as file2 move a file to another dir remove (delete) a file remove the entire dir and its subdirectories display the content of file display the content of file, page by page print a file search a file

Misc
Unix Command man command clear DOS equivalent help cls Remarks online help clear screen

echo $PATH who am i who finger user history r r n [Ctrl-S] [Ctrl-Q] [Ctrl-D]

path

[F7] [up-arrow] [F9] [Ctrl-S] [any key] [Ctrl-Z]

exit

show the current search path show the current userid show who else are on the system show the information of user show the previously entered commands (for Korn Shell) repeat last command (for Korn Shell) repeat command no. n shown in the history (for Korn Shell) suspend the screen display resume the screen display mark the end of input (If you press [Ctrl-D] at prompt of your login shell, you're telling the shell that you will not issue commands to it any more, which is just another saying of logging off.) logoff

Foreground/Background Job Control (for ksh, bash)


Shell Command ./executable Remarks run the program "executable" in foreground (Note that ./ means the executable file is in your current directory, this could be omitted if you have included current directory in your search path.) run the program "executable" in background break the execution of the foreground job (Note: you can only have one foreground job running) stop temporarily (not break) the execution of the foreground job and put it in the background list all background jobs, running or stopped (Note: a job no. (assigned by Korn Shell) and a process id (assigned by Unix) will be shown in the first and the third column respectively.) resume running a stopped background job (job no. jobNum) in foreground resume running a stopped background job (process ID pid) in foreground resume running a stopped background job (job no. jobNum) in background resume running a stopped background job (process ID pid) in background kill (or break) a running job (job no. jobNum) kill (or break) a running job (process ID pid) "sure kill" a running job (job no. jobNum) (Note: "-9" informs the "kill" command to send a "sure kill" signal to the specified process in order to break its execution.) "sure kill" a running job (process ID pid) kill all background jobs

./executable & [Ctrl-C] [Ctrl-Z] jobs -l

fg %jobNum fg pid bg %jobNum bg pid kill %jobNum kill pid kill -9 %jobNum kill -9 pid kill 0

(Note: the argument of this command is a zero, not the letter oh.)

mtools (for floppy disk access)


Command mdir a: mcopy -t sourceFiletargetFile Remarks check directory on floppy diskette (a: is optional) -t is for copying text files (omit if copying binary files) mcopy -t sourceFiletargetDir If the target is floppy, use "a:" for the targetDir. If the target is the current directory on Unix, use a dot (.) for the targetDir. Note: All mtools commands are DOS commands prefixed by the letter 'm'. So, just prefix any DOS file handling command with the letter 'm' and see if it works on Unix. Try, e.g., "mcd", "mdel".

Você também pode gostar