Skip to main content

Using the Command Line

Hands-On Lab

 

Photo of Michael Christian

Michael Christian

Course Development Director in Content

Length

00:45:00

Difficulty

Beginner

It's time for your first command line experience! In this lab, we will use SSH to connect to a remote server, log in, and run a few commands. The purpose of this lab is to help you become familiar with and comfortable using the command line to connect to a remote Linux host. This is somethign you're going to be doing often as you work with Linux, so let's practice!

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Using the Command Line

Introduction

It's time for your first command line experience!

In this lab, we will use SSH to connect to a remote server, log in, and run a few commands. The purpose of this lab is to help you become familiar with and comfortable using the command line.

Connect to the Remote Server

  1. Open your terminal application, and run the following command (remember to replace <PUBLIC_IP> with the public IP you were provided on the lab instructions page):
    ssh cloud_user@<PUBLIC_IP>
  2. Enter yes at the prompt.
  3. Enter your cloud_user password at the prompt.

Run Some Commands

  1. Run the following commands and note their output:

    whoami
    ls
    pwd
    last
    uptime
  2. Add man to the front of the whoami command, and run it again.

    man whoami
  3. Press q to exit the man page.

  4. Repeat steps 2 and 3 with the following commands:

    man ls
    man pwd
    man last
    man uptime

Conclusion

Congratulations, you've successfully completed this hands-on lab!