Bash Basics: Navigating the Command Line

Why Use the Command Line?

The command line gives you powerful control over your files and programs. While you can use the GUI for many things, you'll need to be comfortable with basic navigation for Git and Python.

Jargon

Essential Commands

Understanding Paths

Examples

Suppose you're in /home/user. Here's what happens with each command:

Interactive Exercises

Try these in your terminal:

  1. Determine your location: pwd
  2. List the files ls
  3. Create a new directory: mkdir my_test
  4. List the file again and verify you can find the directory my_test: ls
  5. Navigate into the folder: cd my_test
  6. Create a file: touch hello.txt
  7. List the files: ls
  8. Go up: cd ..

Downloadable Cheat Sheet

Bash Cheat Sheet

More Resources