Using Symbolic Links

Hands-On Lab

 

Photo of Michael Christian

Michael Christian

Course Development Director in Content

Length

00:45:00

Difficulty

Beginner

In this hands-on lab, we will practice using symbolic links. Understanding and using symbolic links is a fundamental skill for Linux system administration.

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 Symbolic Links

Introduction

In this hands-on lab, we will practice using symbolic links. Understanding and using symbolic links is a fundamental skill for Linux system administration.

Connecting to the Lab

  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.

Create the ~/ bin Directory and Add it to the PATH

  1. List the current working directory.
    pwd
  2. Make the ~/bin directory.
    mkdir bin
  3. View the current $PATH environment variable.
    echo $PATH
  4. Add ~/bin to the $PATH environment variable.
    echo 'PATH=$HOME/bin:$PATH' >> .bashrc
  5. Reload .bashrc.
    source .bashrc
  6. Verify that ~/bin was successfully added to $PATH.
    echo $PATH

Create the Symbolic Links

  1. Create a symbolic link ("symlink") for rpm_verify.
    ln -s /usr/lib/rpm/rpmdb_verify bin/rpm_verify
  2. Verify that this was successful.
    ll bin/
  3. Create a symlink for rpm_dump.
    ln -s /usr/lib/rpm/rpmdb_dump bin/rpm_dump
  4. Create a symlink for rpm_load.
    ln -s /usr/lib/rpm/rpmdb_load bin/rpm_load
  5. Verify that all three symbolic links have been created.
    ll bin/

Test the Symbolic Links

  1. View the symbolic links.
    rpm
  2. Verify that the rpm_verify symlink works.
    rpm_verify /var/lib/rpm/Packages

Conclusion

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