ist346-content

Lab B - Learning the linux command line

Learning Objective

In this lab you will:

Before You Begin

Prep your lab environment

This should be done before every lab! On the computer where your labs are located:

  1. Open the PowerShell Prompt
  2. Change the working directory folder to ist346-labs
    PS > cd ist346-labs
  3. Update your git repository to the latest version:
    PS ist346-labs> git pull origin master
  4. Change the working directory to the lab-B folder:
    PS ist346-labs> cd lab-B
  5. Start the lab environment in Docker:
    PS ist346-labs\lab-B> docker-compose up -d

This will bring up an Ubuntu Linux container for you to use as part of the lab.

Login to the Linux Container

You will need to login to the Linux container as user scott with password IST346. Once you do that you will be able to follow the videos which are part of the lab. The name of the linux container is workstation.

Procedure:

  1. Connect the the Linux Container: PS ist346-labs\lab-B> docker-compose exec workstation login
    NOTE: The name of the Docker container is linux and the command we wish to execute on that container is login.
  2. This will initiate a login prompt on the Linux container:
    workstation login:
    At the login prompt, enter the user scott
  3. At the password: prompt, enter the password IST346
    NOTE: All passwords in the labs are IST346 unless stated otherwise.
  4. You will now see a Linux Bash command prompt like this: scott@workstation:~$

You are ready to follow along with the lab on Lynda.com

Logging in to Lynda.com with your Syracuse University Account

All Syracuse University students have accounts on Lynda.com, a leading technology learning platform for busy professionals. Here’s the procedure for logging on:

  1. Nagivate your web browser to https://lynda.syr.edu
  2. This will prompt you with a Syracuse University login screen. Login with your Syracuse University NetID and Password.
  3. Once your are logged on you will see the Lynda.com home page. You can jump directly to the course here: https://www.lynda.com/IT-tutorials/Learning-Linux-Command-Line/753913-2.html?org=syracuse.edu

The entire course is about 2 hours long. We will only complete parts 2, 3 and 4 which should take you about 90 minutes.

NOTE: You’ll probably want to use a pair of headphones so you can listen to the audio of the video lessons in private.

Okay! You’re now ready to start the Lab!

Learning the Linux Command Line

You should follow along with the Lynda.com video https://www.lynda.com/IT-tutorials/Learning-Linux-Command-Line/753913-2.html?org=syracuse.edu starting for these chapters:

Tips for getting the most out of the videos!

Lab Teardown / Lab Reset

When you are finished, do not forget to tear-down your lab. You can also reset the lab back to its default state if you screw something up or just want to try the lab again!

  1. From the Linux prompt, type: scott@localhost:~$ exit
    to quit linux and return to the PowerShell Prompt
  2. At this point you’ve exited the container, but its still running. If you type:
    PS ist346-labs\lab-B> docker-compose exec linux login
    You can log back into the container. (Don’t do this unless that’s what you want!)
  3. If you wish to tear down the lab so that you can work on the next lab, or restart this lab, type: PS ist346-labs\lab-B> docker-compose down This stops the container and deletes all changes made to it.
  4. The command:
    PS ist346-labs\lab-B> docker-compose up -d will start the container back up again restoring it to the original state.

Questions

  1. For the command docker-compose exec foo bar What does foo represent? What does bar represent?
  2. How do you get help in Linux?
  3. What is a pipe?
  4. For the following file:
    -rw-r-xr-- 1 scott comedians 1474 Jun 21 20:54 poems.txt
    1. The file is readable by?
    2. What is the group associated with this file?
    3. Who can execute this file?
    4. How large is the file?
    5. Who can write to the file?
  5. How can you determine if you are a root user from the command line?
  6. Which command allows a user to elevate to run command as the super-user?
  7. What is a link? What are the two types of links?
  8. Write the Linux command to move a file named a.txt in the Documents folder into the Desktop folder. Note: Assume both folders are the same parent directory.
  9. Write the Linux command to list files in a folder two folder up from the current working directory.
  10. Write the Linux command to find the files that begin with the letter t in the /bin folder.