Short Introduction to Unix


  How to Login

	login: yourname
	password: yourpassword (not echoed)
The default window manager will start and you will have several options (terminals, netscape, emacs, etc) by clicking right and middle mouse buttons. Remote login is not presented here. The commands described below are only related to a terminal (console) window only!

  Directories

    cd - Change Directory

    Move around in directories can be done in two ways:

    pwd - Print Working Directory

    	% pwd
    	/home/[yourusername]
    

    ls - List

    	% ls
            Dotfiles.html   emacstutorial.html   index.html   unixtutorial.html
            emacstutorial2.html  latextutorial.html
    
    For more information about files you can specify -a and/or -l as parameters to ls:
    	% ls -l
            total 35
            -rw-r--r--   1 you users    5045 Sep 17 22:35 Dotfiles.html
            -rw-r--r--   1 you users    5761 Sep 17 23:51 emacstutorial.html
            -rw-r--r--   1 you users    2421 Sep 17 23:52 emacstutorial2.html
            -rw-r--r--   1 you users    5328 Sep 17 23:21 index.html
            -rw-r--r--   1 you users    1478 Sep 17 23:58 latextutorial.html
            -rw-r--r--   1 you users    6951 Sep 18 00:22 unixtutorial.html
            % ls -al
            total 83
            drwxr-xr-x   2 you users    1024 Sep 18 00:23 .
            drwxr-xr-x   8 you users    1024 Sep 17 22:39 ..
            -rw-r--r--   1 you users    5045 Sep 17 22:35 Dotfiles.html
            -rw-r--r--   1 you users    5761 Sep 17 23:51 emacstutorial.html
            -rw-r--r--   1 you users    2421 Sep 17 23:52 emacstutorial2.html
            -rw-r--r--   1 you users    5328 Sep 17 23:21 index.html
            -rw-r--r--   1 you users    1478 Sep 17 23:58 latextutorial.html
            -rw-r--r--   1 you users    6948 Sep 18 00:23 unixtutorial.html
    
    

    mkdir - MaKe a DIRectory

         % cd 
         % mkdir games
    

    rm -rf - ReMove (Recursive & Force)

         % rm -rf games
    


  Files

Any character can be part of the name, and the names can be as long as desired(< 255, it depends on system). But some of them must be escaped inside the shell command line: \\, \ (space), etc

    cp - CoPy

    	
    	cp source_file destination
    
    	% cp myfile myfile-old
    

    mv - MoVe

    	mv source destination
    
    	% mv myfile-old myfile.old    
    	% mv myfile.old backups/myfile.old   
    

    rm - ReMove

    	rm file_to_be_removed
    
    	% rm random.file
    


  Viewing Files

	% cat myfile      (displaying only capabilities)
        % less myfile     (displaying and scrolling capabilities)
        % emacs myfile &  (displaying and editing capabilities)


  EXECUTING FILES

Executable programs are just like any other files in Unix. To execute them, just use their name as a command:
	% ls 
        % finger 
        % date
        % w
        % ps aux | grep root
To abort a program, just type Ctrl-C while in the shell that is executing the program. This should cause the program to terminate.

  GETTING HELP

You can always refer to manual pages to help you out.
	man command
	man -k keyword

        % man -k suid
        getresuid, getresgid (2) - get real, effective and saved user or group ID
        setfsuid (2)         - set user identity used for file system checks
        setresuid, setresgid (2) - set real, effective and saved user or group ID
	% man grep
        ...
        % info emacs


  Other Links


CS103