Command line interface - UNF



Command line interfaces: DOS (command line Windows) vs Unix

• Commands must be written with an exact syntax (order): command source target

o Some commands only require the command itself or use a default value for source and target (see “dir”)

o Some commands require an explicit source or target (see “copy”, “rd”)

• In a tree or hierachical structure, you must know at what level you are before executing commands

• To avoid ambiguity, use the complete path to a directory or file, separating each level with a \

| |DOS (Command line WinX) |UNIX |

|Directory Manipulation: | | |

|list files/directories |dir drive: |ls |

| |dir /p /w (pause, wide) |ls –l (long) |

|change current directory |cd |cd |

| |cd .. (to parent) |cd .. (to parent) |

| |cd \ (to root) |cd ~ (to home) |

|create (make) directory |md dirname |mkdir /dirname |

| |mkdir \dirname |mkdir /homepage |

|delete (remove) directory |rd dirname |rmdir /dirname |

| |rmdir \dirname | |

| | | |

|File Manipulation: | | |

|create file |copy con filename.txt |vi filename (or pico filename) |

| |(enter lines of text) |(enter lines of text) |

| |^z (to quit and save file) | :wq (write and quit) |

|rename (move) file |ren \oldfile \newfile |mv /oldfile /newfile |

| |rename oldfile newfile | |

|copy file to another location |copy source target |cp source target |

|delete file |del filename |rm filename |

| | | |

|Miscellaneous commands: | | |

|help |command /? |man command |

|print |print filename PRN |lpr –Pprinter filename |

| |copy filename lpt1: | |

| |type filename > lpt1: | |

|display file (on screen) |type filename |cat filename | more |

| | |less filename |

|path of working directory |-- |pwd |

|change password |-- |passwd |

|set file or directory rights |-- |chmod |

|logout of remote system |-- |lo |

|format floppy disk |format drive: |-- |

| |format a: /s (format a: and include system files | |

| |– create bootable DOS diskette) | |

|wildcard characters |* (match any number of chars) |* (match any number of chars) |

| |? (match one character) |? (match one character) |

+ - to toggle between full-screen and windowed DOS session.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download