Skip to main content

Navigating Files and Directories

Overview​

Questions​

  1. How do you navigate files and directories on your computer?
  2. How do you list files and directories?
  3. How do you find your current location in the file system?

Objectives​

  • Explain the similarities and differences between a file and a directory.
  • Convert an absolute path to a relative path and vice versa.
  • Build absolute and relative paths to locate specific files and directories.
  • Use options and arguments to change shell command behavior.
  • Use Tab completion and explain why it helps.

The File System​

The part of the operating system that manages files and directories is called the file system. It organizes data into:

  • Files: hold data or information.
  • Directories (folders): hold files or other directories.

Check Your Location with pwd​

To see where you are, run pwd (short for print working directory). Whenever you use a shell, you are in one specific place called your current working directory. Most commands read and write files here by default, so knowing your current directory matters.

$ pwd

Next, we will use the shell window to create, inspect, rename, and delete files and directories.