Lab 1 KCC: Getting Familiar with Linux

Objectives

The objectives of this lab are to get familiar with the systems and software you will be using in this course. Linux, the operating system you will be using for this course, is a powerful operating system (which actually works! :-)). While the features and capabilities of Linux is a never ending learning process, with just a few basic commands and concepts, you can become productive in Linux very quickly. The goal of this lab is to get you started. As the semester progresses if you see something new in lecture or the lab, or see others do useful things with Linux, ask about how to do that. You will quickly see the power, consistency, and usefulness of Linux. During this lab, the TA will show you how to do the steps described below and give you a chance to try them for yourself. Don't be afraid to explore and try different things in Linux, and ask the TA if you get stuck.

Lab Tasks

Identify Your Teammates

Form Teams of 3. Teams of 2 will only be allowed if there is not enough people.

If you are having trouble please ask your TA.

Teams will not be used for this Lab but this will give the instructor time to inspect the team sizes and adjust before the start of Lab 2.


Logging In

  • From a Mac, use the ssh command in a Terminal command line window; for Windows, use PuTTY.
  • One of first things you should do is to set up your environment so you can use the commands specific to EE 160. Open a wiliki window and do the steps described in the "Setting Up Your Environment" section of Homework 0.


Exploring Unix

  • Explore navigating in the Unix file system using commands like:
    • pwd
    • cd
    • ls
    • cat
    • more
  • Explore managing files and directories using commands like:
    • mkdir
    • cp
    • mv
    • rm


Exploring Text Editors

  • You will write code this semester using a text editor (not a word processor). In wiliki, you have a choice of using either vi or pico as your text editor. Pico is easier to learn because it is more pc-like, and is fine for sending email and creating text files. It can be used to edit program files, however vi is much better for programming. You may use whatever editor you like in this course, however, it is a good idea to be familiar with the basics of vi.
  • vi has a steeper learning curve, but is much more powerful for editing code, and as you become familiar with it, you will be faster and more productive in editing programs. To get started, you can run a tutorial for vim (an improved version of vi that is the default vi on wiliki). Run the follwoing command and follow the steps there:
  • vimtutor


Exploring Email

  • What is your email address on wiliki?
  • What is your TA's email address on wiliki?
  • Send an email to the three classmates you found in the previous section to introduce yourself. Make sure they received the email and respond to any emails you receive from classmates so they know you got their email. (Note: you may use either elm or pine as your email application).
  • Send an email to your TA telling him the names of the three classmates you corresponded with above.


Finish Homework 0

  • Read about the different types of Learning Styles. Take the Learning Styles quiz HERE. Remember the results of the quiz in order to answer the question in the info file in the next step.
  • (HW 0 has the instructions on how to copy the info file) Copy the info file from the ~ee160 directory and edit it to answer the questions there as described in the "What You Turn In" section of Hw0
  • (HW0 also has instructions on how to send the file to the instructor) Send your edited info file to chris.uh.class@gmail.com


Exploring Sources of Info

  • Spend some time to explore how to find out more about Unix, including:

As you have questions about how these systems work and how you can use them, be sure to ask your TA, during this lab, as well as throughout the semester.

Setting Up Your Environment (Wiliki Students Only)

For this class, I prefer that you use the C-shell (called csh).

If you are familiar with Unix already, and are used to some other shell, you can use that; however, you will need to modify your environment for that shell to have access to the commands provided in the ee160 account.

The default shell when your account was created is called bash. You may choose to keep using bash, but you will still need to customize your environment to use the software provided for this course.

To Use bash:

You should do EITHER (1) or (2) below.

  1. If you are using bash and have already customized your bash environemnt by creating a .profile file, you will need to add the following line to the end of your .profile file:
  2. PATH=~ee160/bin:$PATH
  3. If you have not already customized your .profile file, you can set up your environment by copying the sample dotprofile_bash file to your home directory. First, make sure you are in your home directory using the command:
  4. cd
  5. Then copy the sample file using:
  6. cp ~ee160/dotprofile_bash .profile
  7. (Make sure you type this command exactly as above, including the '.' in the file name.)
  8. NOTE: if you have previously customized your environment, copying the above file will overwrite any of your custom features. You should instead modify your environment using step (1) above.

To Use csh:

This step will change your login shell to csh effective the next time you login to your account. Make sure you are in your home directory using the:

        cd

command. Then copy the sample file using:

        cp ~ee160/dotprofile_csh .profile

(Make sure you type this command exactly as above, including the '.' in the file name.)

You should then logout (type logout) and log back in to wiliki. You will be in csh.

The next step sets up your wiliki environment to enable you to use software provided in the ee160 directory. You should do EITHER (1) or (2) below.

  1. If you have some prior familiarity with Unix, you may have already customized you environment to suit the way you like to interact with Unix. You still need to modify your environment to get access to some of the software tools provided in the ee160 account. You can do this by editing your existing .cshrc file and add the following lines at the end of that file:
  2. set path=($path ~ee160/bin)

  3. If you are new to Unix or have not already customized your .cshrc file, you can set up your environment by copying the sample cshrc file to your home directory. First, make sure you are in your home directory using the:
  4. cd

  5. command. Then copy the sample file using:
  6. cp ~ee160/dotcshrc .cshrc

  7. (Make sure you type this command exactly as above, including the '.' in the file name.) NOTE: if you have previously customized your environment, copying the above file will overwrite any of your custom features. You should instead modify your environment using step (1) above.

That's it! To make the changes to your environment in effect, you should either logout and then log back in, or type:

         source .cshrc

To test if your environment is set up properly, try running the program:

        test160

If the program runs and gives you a message, your environment is correct, go on to the next section. If you get a message:

        test160: Command not found.

your environment is not correct; go back to either step (1) or (2) above and try again. See the TA if you cannot get your environment set up properly.

I also STRONGLY suggest that you create a directory for this course in your home directory on wiliki. You will be using this directory to store data and information as we go through the course. To create an EE160 directory, go to your home directory and enter:

          mkdir EE160

c