Linux Basics for Hood CS Students


Table of Contents

To login
To change your password
To print a text file
To create a new directory
To use a USB memory stick
To use a CD


To logout
Search Path
Terminal Type
A Space in a File Name
Editors and X Window

  1. To login


    1. On Campus
      1. In the HT 319 Lab

        To work on pluto

        On the screen, type your user name and press Enter, and type password and press Enter.

        You can access your files on pluto using graphic file manager Konqueror.

        For using command lines, start a terminal window by clicking Fedora icon (at the left bottom corner) -> System Tools -> Terminal. You might want to add the Terminal icon on the panel to start a terminal by clicking it on your desk top.

        The lab computers have two desktops installed, GNOME and KDE. To change your desktop, click Options -> Session... and select a desktop you want to use on the login screen before logging in.

        To work on wyrd

        If you want to login wyrd server, type either of the followings in your Terminal window:

             ssh your_login@wyrd

        or

             telnet wyrd

      2. In the Windows Lab

        Run the ssh or telnet program to connect to CS servers. You will be prompted for your user name and password.


    2. Off Campus


      Connect to the Internet and then connect a CS server with a ssh program.

      It is no longer possible to reach departmental servers via insecure telnet (or ftp). Please use ssh (and sftp) instead. Free SSH implementations are listed at the following web site.

            For Windows users:

                  http://www.openssh.org/windows.html

            For Mac users:

                  http://www.openssh.org/macos.html

      To use ssh on UNIX/Linux workstations to connect to pluto server from off campus, type:

            ssh pluto.hood.edu      (or    ssh your_login@pluto.hood.edu)


  2. To change your password


    When you would like (or need) to change your password, type command "passwd" at the prompt. For example:

    passwd Changing password for xxxx
    (current) UNIX password:      (type your current password)
    New UNIX password:      (type your new password)
    Retype new UNIX password:      (type your new password again)

    If you change your password on pluto, propagating the change to client machines in HT 319 takes a while. So if you are on campus, change your password in the HT 319 Lab.


  3. To print a plain text file


    Type "lpr your-filename". For example, if your file name is "myfile", type the following command:

    lpr myfile

    It prints the file to the printer in HT 319. Please don't send your binary file or a formated text file to a printer. When you are not sure if your file is a plain text, the following command will tell you.

    file myfile

    To get a printout with line numbers, type the following command:

    pr -n myfile | lpr

    lpr does not do any formatting. If your file has lines that are too wide for the output page, the printer will truncate them. The following command will give you a solution.

    fold myfile | lpr

    To print man (short for manual) page:

    man ls | col -b | lpr

    This prints a man page for the ls command to the printer in the lab.


  4. To create a new directory


    1. Command Line Method

      Type command "mkdir dir-name". For example, if you'd like to create a directory called "my_dir", type the following:

                mkdir my_dir

      It creates a directory called "my_dir" in the current directory.

      Note on directory permissions: If you don't want to everyone on the system to use your files, nor to snoop around in your directory, you should give only user (you) read, write, and access permissions, not group and other. When you list the new directory, it should look like drwx------ . If your directory does not look like this, the following command will set to the permission.

      chmod 700 my_dir

      If this directory is part of your web site, you need to give execute (or search) permission to the directory. Use the command below to change the permission for the directory.

      chmod 711 my_dir
    2. Graphical Method

      Click Fedora icon -> Internet -> Konqueror, and then go to your Home directory by selecting Go -> Home. This will display your home directory. Click the directory in which you want to create a new directory. Under Edit menu, click Create New -> Folder. This will display New Folder window. Type the directory name you want to use. Then click OK. Select the folder you just created and Right-click on the folder and choose Properties. Click Permissions tab and choose Forbidden for Group and Others. If you want to fine-tune the permission, click Advanced Permissions ...


  5. To use a USB memory stick


    When you want to use your USB memory stick in the ht319 lab:

    1. Connect your memory stick to the computer. A window will appear saying "A new medium has been detected. What do you want to do?". Select "Open in New Window", then a Konqueror window will open. Also, the "Removable Device" icon will appear on your desktop. You can copy your files using Konqueror.

    2. After your work is done, close Konqueror. Then right click on the icon and choose Safely Remove. This will umount your memory stick safely.

      This step is easy to forget but important because writing to/from a memory stick is asynchonous (or a background job). This command assures you that all writing has been done.


  6. To use a CD


    1. To access a file on a CD, insert your CD after you have logged on. Then a window will appear. Highlight "Open in New Window." and click on OK. You can copy files from CD using Konqueror.

    2. To remove your CD from the drive, right click on the CD icon on your Desktop and choose Eject. After taking your CD disk, please close the CD drive by pushing the button.


  7. To logout


    1. In HT 319

      On graphic screen, click KDE or Fedora icon, depending on the destop you are using, at the left bottom corner and click "Log Out...". Then click "End Current Session'.

    2. Remote connection

      Type "logout".


  8. Search Path


    The default search path is only bin directories, such as /bin, /usr/bin and bin in your directory. To invoke your program in your current directory, you need to type "./program_name". If you want to include your current directory (.) in the search path so that you can type just your program name to execute it, add a current directory to your .bash_profile file (for a remote login) and/or .bashrc (for ht319 lab). as follows:

    PATH=/bin:/usr/bin:$HOME/bin:.        (the last dot)


  9. Terminal Type


    When you connect to Linux server from other machines, the vi editor's arrow keys do not work, or when you use "script" command, you get extra stuff on your typescript file, most likely your terminal setting is not compatible with the programs. Try with vt100 terminal by doing either of the followings.

    Typing the following command at the prompt.

    export TERM=vt100     (for bash)


  10. A space in a file name


    If your file name has a space (or spaces) and you type the file name in a command line, you have an error message: such as "no such file or directory".  The solution for this is using quotes. For example:

             cp  'file name'  file_name


  11. Editors and X Window


    Besides the vi editor, Linux supports several editors, such as "emacs", "nano", "gedit", "Kate", "Kedit" and "kwrite" editors. "Kate, "gedit", "Kedit" and "kwrite" are graphical editors. When you are connected to the server remotely using MS Windows, you need X window, such as Cygwin/X, Exceed (Hummingbird), and MI/X (MicroImages), to display graphical programs on MS Windows. If your are using Unix or Linux workstation, X window is already installed. When you are using ssh and your computer has X window installed, just type a program name on your remote server. The program will be displayed on your local machine.


          Updated: April 23, 2008