Getting Your Bearings

Learn about the command-line interface, pwd, and ls command.

The CLI

When we first open the CLI, we’re be presented with something that looks like this:

root@educative:/#

This is the prompt, and it’s the CLI’s way of saying it’s ready for us to type a command. This prompt is from the Ubuntu operating system.

In this case, the current working directory is represented by a tilde (~), which means our home directory. Our home directory is where we find documents, music, and settings for our programs. We have total control over our home directory. We can create and delete files and directories, move things around, and even install whole programs without administrative privileges. When we launch the CLI, it opens the session in our home directory.

The computer’s disk stores files in a hierarchy of folders or directories called the filesystem. We explore this in detail in Navigating the Filesystem. When we use the GUI, we click a folder to open it and see its contents. An indicator at the top of the GUI window tells us where we are on the filesystem.

Using the pwd command

Our prompt may tell us what directory we’re currently viewing. But a clearer way to tell is with the pwd command, which stands for “print working directory.”

$ pwd

Get hands-on with 1200+ tech skills courses.