Next Previous Contents

3. Commands, Unix -vs- Dos

Listed below are the Unix commands and the Dos counterparts most commonly used. Not all of the Unix commands have an equivalent Dos counterpart, since Unix is more comprehensive than Dos.

3.1 cd - cd * Change directory

The Unix change directory command "cd" is identical to the one in Dos. There is a difference in syntax in that the directory is denoted with a forward slash in Unix and a back slash in Dos.

        Unix syntax:            cd /my/first/unix/directory

        Dos syntax:             cd \my\first\dos\directory
type "cd" with no argument to return to your ~home directory

type "man cd" for detailed information about this command.

3.2 cp - copy * Copy files

These commands are almost identical for Unix and Dos.

Syntax:
        cp < path/file name >
    or: cp -r < path/file name >
    or: cp < path >
    or: cp -r < path >

        -r      Copy  directories  recursively,  copying  all  
                non-directories as if they were regular files.
type "man cp" for detailed information about this command.

3.3 d2u - (no/dos) * Dos to Unix file conversion

The "d2u" command converts a Dos - Windows - Mac file to the Unix format. Unix files do not contain carrige return characters, only end line characters. The "d2u" command simply removes the carrige return characters.

Syntax:
        d2u < file name >
There is of course, a "u2d" command that works the same way to put the carrige returns back into the file.

If you import files via the "ftp" command, they will contain the excess carrige return characters. If you simply paste the contents of the file into an edit window or generate the file on-line, they will not contain any carrige return characters.

If you forget, the end of each line will look like this. M

3.4 kill - (no/dos) * Kill Process

The "kill" command allows you to kill or otherwise send a signal to a process running on a Unix machine. We will only touch on the abilty to kill or dispose of an unwanted task.

To "kill" a task type at the command line:

        kill 
                where the process id is the number assigned
                to the task by the operating system.
                See the command "ps" further on in the document.
or
        kill -9 
                to "really" kill it. Some are reluctant to die.
type "man kill" for detailed information about this command.

3.5 ls - dir * List Directory

These commands are very similar in both Unix and Dos.

        ls      lists the visible files in the directory

        ls -l   (little "L") list the files in long format
                with their size, creation times, etc...
type "man ls" for detailed information about this command.
When used within an ftp window, the "ls" command may produce a long listing since the "list default" is set by the operator of the ftp site.

3.6 less - (see more) * Paging File Reader

Less is a program similar to more, but which allows backward movement in the file as well as forward movement. Also, less does not have to read the entire input file before starting, so with large input files it starts up faster.

Minimum command keystokes you need to know.

b (N)
Scroll back N lines, default is one screen.
f (N)
Scroll forward N lines, default is one screen.
g
Go to top of file.
G
Go to bottom of file.
/ string
Search for string.
n
Find the next occurence of the search string.
q
Quit.

type "man less" for detailed information about this command.

The output of other commands may "piped" to less.

        ls -l | less    will pipe the output of the list command
                        to the pager to view one screen at a time.

3.7 more - more * Paging Viewer - primitive

More is a filter for paging through text one screenful at a time. This version is especially primitve. Users should realize that less provides more emulation with extensive enhancements.

Don't bother with more. Use less instead.

type "man more" for detailed information about this command.

3.8 man - (no/dos) * Read Manual

Format and display the on-line manual pages.

        type    man    for the man page on .
man - uses the pager less to view the man pages. See the instructions for less (above) for manipulating the viewing screen.

type "man man" for detailed information about this command.

3.9 mkdir - md or mkdir * Make directory

The Unix and Dos commands are basically the same.

Syntax:
        mkdir < dir name >
type "man mkdir" for detailed information about this command.

3.10 mv - move * Move file or directory

The Unix and Dos commands are basically the same.

Syntax:
        mv < from name > < to name >
The mv command can be used to move files or directories.

To move files from or to the "current" directory, use

                ./

type "man mv" for detailed information about this command.

3.11 ps - (no/dos) * Process Status

ps gives a snapshot of the current processes and shows their process id's (pid's). The process id in conjunction with the kill command can be used to terminate a running process. See kill (above).

type "man man" for detailed information about this command.

3.12 pwd - (no/dos) * Print Working Directory

Print the name of the current working directory. Helps you find out where you are when you get lost in the directory tree.

3.13 rm - del * Remove or Delete a file or directory

The rm command without options is very similar dos del with the same syntax.

Used with the "-r" option, rm is similar to dos rmdir except that it will unconditionally remove all files and subdirectories if a directory is specified for > file name < .

        Syntax:         rm < file name >
            or:         rm -r < file/directory name >
Wild card characters are allowed anywhere in the file name.
type "man rm" for detailed information about this command.


Next Previous Contents