Thanks to Mark Leonard and Chad Clark for this file.

Table of Contents:

  1. Introduction
  2. Pronunciation
  3. Folders and Directories
  4. Case sensitivity
  5. Manual pages
  6. I need HELP!
  7. PINE
  8. Password changing
  9. Telnet
  10. Basic commands
  11. Aliasing commands
  12. File and Folder permissions
  13. Showing files
  14. System bulletins
  15. Using Typescript to hand in assignments
  16. Printing things (hardcopy)
  17. How paths work
  18. Going to the bathroom (locking your workstation)
  19. Death and life (of processes)
  20. Running out of space
  21. How to make your life easy (using GREP)
  22. Finding out stuff about the system
  23. Making the screen look good (setting your terminal)
  24. How to tell your code to shove it (redirects)
  25. How to get control (control characters)
  26. Putting things off (job control)
  27. Editing files with Emacs and vi
  28. Moving files between machines
  29. Getting lazy (file name completion)

  1. Introduction
    This document was made by the Computer Science Undergrad Society (CSUS) at the University of Calgary. It is intended as reference for people needing help with UNIX. There may be errors or blatant lies herein, be warned.
    Back to the top.
  2. Pronunciation
    #
    hash
    |
    pipe
    !
    bang
    \
    wack (aka 'back-slash')
    /
    slash (aka 'forward-slash')
    :
    colon
    ;
    semi colon
    ~
    tilde said either 'tilled' (rymes with 'milled') or 'tilda' (sounds like 'till da')
    .
    dot (aka period)
    ,
    comma
    ^
    caret (said like the veggi 'carrot')
    &
    ampersand (said like 'amp er sand'). Also known as 'and'.
    *
    star
    @
    at (see here for more details.)
    RTFM
    said by pronouncing the letters 'R-T-F-M'
    #!/bin/bash
    'hash bang slash bin slash bash'
    linux
    'lin ick ss' ('lin' rymes with tin. 'ick' is when you squish a spider. 'ss' just like a snake hiss.) Rhymes with 'cynics'
    vi
    just say the letters ('V I') some people also say this to rhyme with 'pie'. NEVER EVER call this 'six' (as if it were roman numerals)
    unix or UNIX or Unix
    'you nicks' ('you' just like you and me. 'nicks' think of lots of guys named nick.)

    Back to the top.
  3. Files and Directories
    A folder in windows is the same as a directory in UNIX. Directories contain other directories or files. An example of a file is a word document or excel file. Some files take the form of programs which can be run. Other files are used to store information for us and the computer. In unix everthing is treated as a file. The mouse is represented as a file in the /dev/ directory with the filename mouse. The full path and name to the mouse file is /dev/mouse The slash symbol is used to separate directories and files.

    Typicaly the log of who logged in and when is kept in /var/log/ in a file called messages. The full path and name is /var/log/messages. In this case log/ is a directory in the /var/ directory.

    The / at the beginning of a directory name means that the directory is in the root. The root can be thought of as the trunk of a tree. From the root there are "branches" these branches are the directories. If you are working in the directory /usr/local/ and you refer to the bin/ directory, that is not the same as the /bin/ directory. In this case, bin/ refers to /usr/local/bin/ and NOT /bin/. This is the distinction between a relative path and an absolute path. If the path begins with a slash, it is absolute, if it does not, it is relative.

    Relative to what? Relative to the Present Working Directory (PWD). When you first log onto a system, your PWD is normally /home/username. There will be more on this later.

    A pair of very interesting shortcuts exist for relative paths; "." and "..". The single dot refers to the current directory, and the double-dot refers to the "parent" directory. The "parent" is the directory one step closer to the root or trunk of the tree.

    This can take a little getting used to, but /usr/local/bin/../ refers to the same thing as /usr/local/ and the same as /usr/./././././local/./././ (confusing?) Basically, if there is a single-dot, go nowhere, if there is a double-dot, go backwards one step. This will come in handy later on.
    Back to the top.
  4. Case sensitivity
    Unlike Windows UNIX is case sensitive. This means that UNIX sees pine differently than it sees PINE or Pine. This means that when you type a command for UNIX you have to get the case correct or else it may not work. UNIX uses lowercase for almost all commands.
    Back to the top.
  5. Manual pages
    Wow all of this is confusing. Is there any documentation and where can I find it? UNIX does have tons of help pages to remind you how to use a command. These help pages are known as the 'man pages'. Where 'man' is short for manual. To see the man page for a command just type man and then the name of the command. So man man would give you the manual entry for the man command. Yes there is a man page on man itself. Sometimes we can't remember the name of the command we want. man can help us out here to. To use man to find the name of a command we have to use an option with the man command. If we want to find a command to read our e-mail we would try man -k mail. The -k part just stands for 'keyword'. After we type this command the screen is filled with a list of every command that has 'mail' as part of it's description. Sometimes this list is very long and we have to look through it to find what we want. man -k is useful when you are trying to remember a command name when you only know what it does.
    Back to the top.
  6. I need HELP!
    The first thing to do is to check the man pages. If the man pages were not able to solve your problems then you need to seek help. Here is where to turn to for help on campus.

    If the problem is with a program on the system or some other software problem you can send an e-mail to software@cpsc.ucalgary.ca.
    If the problem is related to hardware like a smashed mouse (from a 455 student) you should direct your email to hardware@cpsc.ucalgary.ca.

    Sometimes a problem will keep you from using email. In this situation you can turn to the cool but busy people who keep things running smoothly in the tech department. You can find them through the door in the south west corner of the first floor computer lab. The room number is MS145. Find the corner with the pop machine then walk down the long way toward the next corner. You can also try room MS130 - The Computer Science Undergraduate Society. ( Go give these people five dollars for a membership. Then you can get free coffee untill the end of the winter term! ) If the door is open then someone should be there. Just walk in and ask really nicely. These people don't get paid or anything like that but we do up these usefull notes for people anyway and will usually try to help.
    Back to the top.


  7. PINE
    So now that you want to send email. It would be nice to know how right? PINE is the Program for Internet News and Email. Most students here use PINE to send and read their email. To start PINE just type the command pine. The first time you use pine it sets up your mail folders and such. If it asks you to press enter to continue just go ahead and press it. Once that is done you will see the main menu. For security you need to tell pine who you are if you are using it on the computer science departments machines. Pine will show you your user id at the bottom of the screen. You just press enter to confirm that it is also your email id. After that pine asks for you password. This is just the same password you use to login with.

    Pine is pretty helpful and you can usually use the arrow keys to move around. At the bottom of the screen pine will show you what keys to press to do things. These keys show up in coloured blocks next to the keyword. Sometimes you need to use 'control characters'. Control characters are simply keys that you have to press together. They are often shown as ^X and we say this as 'control X'. To enter a control character we just press the character while holding down the control key. The control key is often labeled 'ctrl'. When pine starts and is done all of it's setup stuff we see the main menu. At the very top of the main menu we see that pressing the '?' key will bring us to the help page. This is the first thing you should look at when you run pine for the first time. This help page explains how to use pine.

    If you just want to send an email follow these instructions. First run the pine command. Press enter to confirm your user id. Type your password and press enter. Then at the main menu press C for compose. At the top on the line labeled 'To :' type the email address you are sending this message to. Use the arrow keys to move to the 'Subject :' line. Type a description of your message so whoever you are sending the message to knows what the message is about. When you press enter the cursor moves to the bottom part of the screen under the heading '----- Message Text -----' . Now you can type your message. When you are all done just press ^X to send it. So you just hold down the control key while pressing the X key. Usually with control characters even though they may be written in capital letters you can use lowercase as well. So ^D is the same as ^d. This is in general true but not necessarily a computer law.
    Back to the top.


  8. Password changing
    The VERY FIRST thing you should do when you login to your account for the first time ever is change your password. One common way of breaking into someone's account is by finding out their default password. The Computer Science department has acctually suspended accounts in the past because a few months after issuing the password it still hadn't been changed. Now that you're worried here is the easy way to protect yourself. Just type the command passwd and follow the instructions. You will have to wait a few minutes (about 15) before all of the machines will accept the new password so don't worry if it doesn't work right away. If you run into problems go talk to the software people in the South-West corner of the lab.
    Back to the top.
  9. Telnet
    Telnet is your friend and also probably the most common way of connecting to your unix accounts. From one unix account you just type the command: telnet HOSTNAME where HOSTNAME is the name on the network of the computer you want to connect to. One common one is 'csc.cpsc.ucalgary.ca' so the command looks like telnet csc.cpsc.ucalgary.ca After telnet connects to the other computer you can just log in as you would normaly. From Windows machines telnet is a bit more work but still really east to use.
                 Windows 95 or 98:
                    1) Click on the 'Start Menu' button.
                    2) Click on 'Run'.
                    3) In the box type 'telnet' and press enter.
                    4) Click on the 'Connect' menu.
                    5) Click on the 'Remote System' option.
                    6) In the 'Host Name' box type the host's name. (eg csc.cspc.ucalgary.ca)
                    8) Click on 'Connect'.
                Windows 2000:
                    1) Click on the 'Start Menu' button.
                    2) Click on 'Run'.
                    3) In the box type 'command' and press enter.
                    4) Type 'telnet HOSTNAME' just like you would from unix.
              
    Then you should be able to log in just like normal.

    But what machines can I use?

    Thanks to the departments unix help pages for this one.
    The department has six Solaris UNIX servers and 1 Linux server as well for general use. These machines are available to all students, regardless of year. The table below lists all of the available servers (some of which have restricted access).

    NAME PLATFORM OPERATING SYSTEM (OS)
    csb.cpsc.ucalgary.ca Sun Ultra-Enterprise2 Solaris 2.7 (SysVR4) [SunOS 5.7]
    csc.cpsc.ucalgary.ca Sun Ultra-Enterprise2 Solaris 2.7 (SysVR4) [SunOS 5.7]
    csd.cpsc.ucalgary.ca Sun Ultra-Enterprise2 Solaris 2.7 (SysVR4) [SunOS 5.7]
    cse.cpsc.ucalgary.ca Sun Ultra-Enterprise2 Solaris 2.7 (SysVR4) [SunOS 5.7]
    csf.cpsc.ucalgary.ca   TEMPORARILY UNAVAILABLE (being upgraded)
    csg.cpsc.ucalgary.ca  (Prof & Grad Use Only) Sun Ultra-Enterprise2 Solaris 2.7 (SysVR4) [SunOS 5.7]
    csh.cpsc.ucalgary.ca  (New!) Sun Ultra-Enterprise250 Solaris 2.7 (SysVR4) [SunOS 5.7]
    csl.cpsc.ucalgary.ca  (New!) Dell PowerEdge 2300 Redhat Linux 6.0
    fsd.cpsc.ucalgary.ca  (Restricted Access) Sun SPARC 5 SunOS 4.1.4 BSD UNIX

    Back to the top.


  10. Basic commands
              ls        List - lists the files in the current directory.
              cd        Change Directory - changes the current directory.
              pwd       Print Working Directory - tells you what the current directory is.
              rm        Remove - erases a file.  NOTE unix has NO RECYCLE BIN.
              touch     Touch - creates a file.  can also update the timestamp of a file.
              cp        Copy - makes a copy of a file in another directory or with another name.
              mv        Move - moves a file from one directory to another.  Also this is
                               how to rename a file in unix.
              mkdir     Make Directory - creates a new directroy.
              rmdir     Remove Directory - deletes an existing directory.
              cat       Concatonate - dumps a file out to the screen.
              more      More - shows a file on the screen one page at a time.  To
                               see the next page press the space bar.
              less      Less - just like More but you can use the arrow keys to
                               scroll up and down one line at a time.  So less is
                               more than more.
              lpr       Line Printer - send a file to be printed (in the basement
                               by default).
              

    Back to the top.
  11. Aliasing commands
    Sometimes we have a long command that we want to use but don't want to have to retype the whole thing every time. The hero that gives us this lazy freedom it known as an 'alias'. One example alias is alias acs1="ssh acs1.acs.ucalgary.ca -l ccclark" . I just have to type this whole line once. After I enter this line I just have to type the command acs1 and UNIX acts as if I have really typed ssh acs1.acs.ucalgary.ca -l ccclark. The alias part says we are giving an alias to some comand. The acs1 is the new name for the command. The = part is used for the assignment of the alias. The ssh acs1.acs.ucalgary.ca -l ccclark is the command I use to connect to my university account and is much more typing than I would like to do. The tricky thing about all of this is that alias command likes to stop after it sees a space or we press enter. To get around this we use the double quotes "

    If you like you can use alias x=ls to make x have the efect of ls. If however you want to make y have the effect of ls -l then you need to use alias y="ls -l".

    NOTE: this is only the case for the BASH shell! If you are using the CSH or TCSH then these commands would look like:
    alias acs1 ssh acs1.acs.ucalgary.ca -l ccclark
    alias x ls
    alias y ls -l
    Notice that with the CSH there is no equals sign and no double quotes are needed. In the csh the asumption is that anything after the second space is part of the command being aliased.
    Back to the top.


  12. File and Folder permissions
    Because UNIX can have many people using it we need some way to protect our files from other people. The UNIX answer to this is file permisisons. Type the command ls -l. The output will look kind of like this.
                drwxr-xr-x   3 frink    users        4096 May 14 14:48 public_html
                -rw-r--r--   1 frink    users        1454 May 20 22:19 typescript
              
    The permisions are availiable in the string on the left end. The string for the first line gets broken up like this.
                   d          rwx       r-x       r-x
              (file type)    (user)   (group)   (other)
              
    The file type in this case is a 'd' which tells us that 'public_html' is a directory so we know it holds other files. The next three are all the same sort of blocks. Each block has three character positions. If a 'r' is found in the block then the appropriate users have access to read the file. If a 'w' is found then they can write to the file. If a 'x' is found then those users can execute that file. When we run a program we say that we are executing that program. If the users of a group don't have permision to do something with a file then we fill in the blank space with a '-' character. This is so that the block still takes up three characters. Also we always list the characters in the order 'r' then 'w' then 'x'.

    Each of the three blocks of characters is for a different group of people. The first block represents the permissions for the 'user' that owns the file. In this example the user 'frink' can do all three (read, write, and execute to) the file. The second block is for the 'group' of people on the system who are a part of the 'users' group. Every user is assigned a group that they belong to (A user can belong to many groups. To see your list of groups type the groups command.) The last block is for anyone else on the system.

    To change the permisions on a file we use the chmod command. We use it like this: chmod o-r. Which will go to the other ( 'o' ) block and take away ( '-' ) the read permision ( 'r' ). We use the same characters for the permision that we want to take away or give as we see in the ls -l listing. We use '-' to take away a permision and '+' to add a permision. You might have guessed that to refer to the user we use 'u', for the group block we use 'g' and for other it is just an 'o'.
    Back to the top.


  13. Showing files
    The easy way to see the contents of a file is the cat commmand. cat just dumps the file to the screen. This is fine for small files but long files just scroll right off the top of the screen. To see a files contents just use the command cat my-files-name .

    The more command shows the contents of a file one screen at a time. In more the space bar is used to move to the next screen. The enter key moves ahead one line and somtimes the b key moves back one screen (depends on the version of more being used). To use more just type more my-files-name.

    The next advancement in file viewing is the less command. less is like more but in less the arrow keys will scroll up and down one line at a time. So we can clearly see that less is more than more. What else can be expected from a system that 'executes' commands to start them and 'kills' them to stop them? To use less we just have to type less my-files-name
    Back to the top.


  14. System bulletins
    It seems that computer scientists never get tired of reading. But this one is very important. Suppose they need to take down the server that you keep you assignments during the weekend. And suppose you need to finish your work for Monday morning. How can you find out that the system will be down and that you need to get your assignment off first? You don't want to keep bugging the admins everyday so they need some way to tell everyone.

    The solution is the Mesage Of The Day. Known as the MOTD for short (Just say the letters). When you first log in to the system some words should be printed on the screen. READ THESE WORDS EVERYDAY. They will tell you valuable things you need to know. When exam rooms get moved this is how they tell you! We don't all get a letter in the mail to inform us about these things. All students and users are expected to read this message. DON'T go to the hardware guys and say 'Why can't I use program X' untill you have checked the MOTD!

    So we know how important the MOTD is but what if we miss it? Simple we just use the command more /etc/motd. That's it. If you are loging in to the Sparc machines in the lab you get a window with the MOTD in it. To scroll this window you have to click the bar on the side of the window with the MIDDLE mouse button. Then while holding the button down move the mouse up and down. This will let you see the rest of the message if it is too long.
    Back to the top.


  15. Using Typescript to hand in assignments
    When you hand in your assignments your TA's need to see that your program really does work. To show them on paper you have to use a command called script. Just type the command script. After that type whatever commands your TA asked for. When you are all done type the command exit. Now in the current directory you should find a file called 'typescript'. This file is a copy of everything that was printed to your screen from when you typed script to when you typed exit. So now all you have to do is print the typescript file and hand it in.
    Back to the top.
  16. Printing things (hardcopy)
    Printing is a thing of it's own on UNIX systems. To print a file such as a typescript file we use the command lpr typescript. A message will print on the screen giving a box number. Remember this number. Then we wait about half an hour before we can go get our printout. The file prints in the basement of Math Sciences. Find the three elevators next to the lab doors and go down one flight of stairs. The hallway in the basement has two ends. On one end is the Microstore. Go the other way into the dispatch area. One wall is full of little cubes. Find the cube that has the number lpr printed to your screen. This is where your printout should be.

    Note that it takes time get your printouts so don't worry if it is not there right away. You can also talk to the people in dispatch if you are having troubles.

    You can also use lpr -Px2up typscript. This will print twice as much on each sheet of paper. So all of your fellow tree huggers will be happy.
    Back to the top.


  17. How paths work
    When you type a command in UNIX needs to know how to find the right program to run. The right program is a file that has the command as it's name. The UNIX file system can be really big so UNIX needs to know roughly where to look for the command's program file. To keep track of where it should look we have something called a 'PATH variable'. The path variable is just a list of the directories that could contain the command. To see what your path is just type the command: echo $PATH. You should see something like this:
               /usr/local/bin:/usr/bin:/usr/sbin:/bin:/usr/X11R6/bin:/usr/openwin/bin:/usr/games:.:/opt/kde/bin
               
    This means to look in /usr/local/bin first. If the command is not found then look in /usr/bin and so on through all of the directories which are separated by a colon. If the command is not found in any of them UNIX gives up but at least it tells you with the message command not found.

    Eventually you may need to add another directory to the PATH. We do this with the command PATH=$PATH:/home/frink/bin. Where /home/frink/bin is the directory that we are adding to the path variable.

    NOTE that this is for the BASH shell. If you are using TCSH then you should use the command set path=($path /home/frink/bin) with whatever directory name you are adding. In BASH you should use uppercase PATH. In TCSH you can use lowercase path but it is good to use PATH to be a consistant as possible.
    Back to the top.


  18. Going to the bathroom (locking your workstation)
    To lock your workstation so that nobody steals your computer while you go to the bathroom, use xlock.
    Back to the top.
  19. Death and life (of processes)
    A process is any running program. A shell is a process, so is a webserver. Almost every process has a Parent. All processes have a unique ID number. This number is called the PID (process ID). The parrent process is refered to by the PPID - the parent process ID. You can start a process by running a program. You can end (kill) a process by terminating the process.

    WHEN (not if) you have a process that will not end, you can use the kill command to forcefully end a process.

    Unless you NEED to, NEVER run kill -9.

    Anyway, kill requires a PID as a parameter. For example, if you know that a.out is process 34 you can kill it with: kill 34. Use ps -elf to get a listing of processes and their PIDs.
    Back to the top.
  20. Running out of space
    You only have so much space for code and programs. This includes your Netscape cache. To see how much space you have left, run this command: quota -v. It will tell you both how much you have and how much you have used. To see which directories are taking how much space, use this command: du -k.
    Back to the top.
  21. How to make your life easy (using GREP)
    grep is used for parsing regular expressions. I've heard of grep being used in conjunction with a word file to solve crossword files. Allow me to illustrate an example. Let's say that we have a file with one word on each line. This file contains MANY words from the english language. If you needed a five letter word: "(something)(something)ste" you could quickly search the wordfile with the grep command grep "^..ste$" wordfile The carat indicates the start of the line must be matched. The two dots can be any two characters. The dollar-sign indicates the end of the line. Any line that matches this form will be returned.

    To return all lines that contain "rle" you can simply run: grep "rle" wordfile.

    To return all lines that begin with "r" and end with "e" you can use this: grep "^r.*e$" wordfile Again, the carat matches the begining of the line, the "r" must follow. The ".*" indicates zero to infinie other characters. The "e" must precede the end of the line; "$".

    Regular expressions show up in many places in programming. Odds are they will be covered in CPSC313.
    Back to the top.
  22. Finding out stuff about the system
    One command: uname -a
    Back to the top.
  23. Making the screen look good (setting your terminal)
    When in doubt, if things don't look right on the screen, change your terminal type. This can be done in bash with this command: set TERM=vt100. Depending on the operating system (Linux or Solaris), you may also need to run the command: export TERM to apply the changes. It's a good idea to run set on it's own to make sure that the existing environment variable is called TERM... it may also be called term or Term. Replace the appropriate name in the instructions above.

    vt100 is a good terminal mode and is very well supported. Other terminal types include: ansi, vip7400 and my personal favorite Linux.
    Back to the top.
  24. How to tell your code to shove it (redirects)
    If you want a program to spew it's output to a file rather than to the screen, there is a simple command: program > outputfile
    If you want your program to suck data from a file instead of typing it in yourself, you need only remember this: program < commandfile

    A pipe (|) can be used to dump the output of one program into another. For example, if we have alot of output produced by our program, and are only concerned with lines that contain the word dog, we could use this command: program | grep dog.
    Back to the top.
  25. How to get control (control characters)
    If you have a program running and you want to stop it, <ctrl>-C will stop (break) it. In most shells (especially BASH ), you can use <ctrl>-A
    to go to the start of the line you're editing. Conversely <ctrl>-E
    will take you to the end of the same line.
    Back to the top.
  26. Putting things off (job control)
    If you run the commandps -elf on a Sun (Solaris) machine, it will give you a listing of every program or job that's running. It will also tell you who ran it, how long it's been running, and it's current state. You may also notice that some jobs (or processes) are running even though the person who owns them is not logged onto the computer. These jobs are being run in the background, and are likely outputting to a file and not to the user's screen.

    Let's say you want to do the same. You have a program that will churn away at the machine for hours or days, and you don't want to have to wait around for it. Let's also assume that you would normally run this program by typing in ./a.out. Do so. The program is now running in the foreground. If you type in <ctrl>-c you will stop and kill the process (termination). If you type in <ctrl>-z the process will be suspended. It's still there, it's just not doing anything. To resume the job (in the forground) you can type in the commandfg %1. Now you're back to where you started. Suspend the job again. This time, run the command bg %1. This will run the job in the background.

    Of course, the output will still be displayed on your screen, which can be annoying. You learned in a previous section how to redirect that to a file. If you want to run a job in the background, from the beginning, and redirect all output to a file, the command you will use is this: ./a.out > outputfile &.
    Back to the top.
  27. Editing files with Emacs and vi
    There are two flavours of emacs: emacs and xemacs. Supprisingly enough, both are run from any unix prompt by typing in their name. You do, of course, need to have them installed on the system, but that's for the administrator to worry about, not you. To learn emacs you need only run it, and read the information that is displayed on the screen.

    vi is one of the first editors. It has several benefits over emacs that I won't get into here. I have never used a unix system that did not have vi installed by default. There are also some occasions where emacs will not work properly. In conclusion vi is always there and it always works. Learning vi can take a couple hours. If you're interested in doing so, get a copy of the vilearn tutorial and work through the first file at the very least. It is provided here:
    1 - basics
    2 - moving
    3 - cutpaste
    3 - temp
    4 - inserting
    5 - tricks
    To use vilearn you change to the directory that contains the vilearn files and run the command: vi 1basics. Follow the instructions you see, and soon you'll know vi.

    I would also like to point out that this file was made using vi.
    Back to the top.
  28. Moving files between machines
    Ugh. Here's the basics; use a program called ftp. There is a version of ftp available for windows. It goes by the name ftp and is available from by going through Start -> Run... -> ftp. Anyway, unix and windows ftp works the same way. Unix ftp came first, just incase you were wondering. Anyway, in unix, you can start ftp by typing in ftp at the prompt.

    There are only a few commands in ftp. The main commands are open, close, bin, get, put, mget, mput, ls, cd.

    Let's do a little session. Note how similar this is to unix directory navigation.

    open cse.cpsc.ucalgary.ca
    (It should ask for a username and password.)
    bin
    (It should say something about changing to binary mode.)
    cd ~
    (It should move you to your home directory.)
    ls
    (This should give you a list of files in your home directory.)
    get somefilethatwaslisted
    (This will transfer some file from the machine cse.cpsc.ucalgary.ca to your local machine.)
    put somefilethatisonyourmachine
    (This will dump a file from your local machine to cse.cpsc.)
    mput and mget can be used the same as the non m version. The m versions allow you to specify wildcards as part of the filename (like *.c for all files ending in .c). cd can be used to change directories on the remote machine. lcd can be used to change directories on the local machine.

    Putting a bang (!) in front of a command will run it on the local machine. This is useful for remembering the names of files and finding out exactly where you are running ftp from.
    Back to the top.
  29. Getting lazy (file name completion)
    There are different types of unix prompt. These prompts are actually called shells. Some shells (BASH - the Bourne Again SHell for example) help you to be lazy. First, check to see if you're already using BASH by typing in set | grep -i shell One or more lines should be displayed. One of these lines should say which shell you're using. The common shells include bash, tcsh, ash, ksh, csh, sh. To temporarily change your shell, try typing in bash at the prompt. A new, slightly different prompt should appear. To exit this new shell, you can type in exit.

    Now that you're in bash, it's easy to be lazy when it comes to remembering file and directory names. If you type in a partial name, you can hit the tab key, and the shell will attempt to complete the file name for you. If there are multiple possible ends to the name, hitting tab once more should give you a list of these possible files. Trust me, this is one of the best things about the bash shell, and will save you lots of time. The UBER-cool thing about this is that if you are typing in a long path, you don't need to remember the whole thing, hitting tab twice will give you a directory listing of all the possibilities for the next portion of the path. Trust me, go out, try it, you'll never go back.
    Back to the top.