Exercise 3: If You Get Lost

As you go through these instructions you may get lost. You may not know where you are or where a file is and have no idea how to continue. To solve this problem I am going to teach you the commands to type to stop being lost.

Whenever you get lost, it is most likely because you were typing commands and have no idea where you've ended up. What you should do is type pwd to print your current directory. This tells you where you are.

The next thing is you need to have a way of getting back to where you are safe, your home. To do this type cd ~ and you are back in your home.

This means if you get lost at any time type:

pwd
cd ~

The first command pwd tells you where you are. The second command cd ~ takes you home so you can try again.

Do This

Right now figure out where you are, and then go home using pwd and cd ~. This will make sure you are always in the right place.

You Learned This

How to get back to your home if you ever get lost.

Buy The Python 3 Edition!

When you buy Learn Python 3 The Hard Way, you'll receive the Python 3 Edition PDF, special access to a paid HTML version, and 12 hours of 1080p video, one video for each exercise. All files are DRM free and you can download them to your computer for offline viewing. Digital Download Only! You do not get a physical book.

$29.99

Buy Digital Download From Zed

Try a a free sample of Learn Python the Hard Way right here, video lectures not included.

Other Buying Options

Buy on Amazon Buy from Barnes & Noble