1 | 2 | Current Level: 3 | 4 | 5 | 6 | 7 | 8
Understand files and directories
Find your current location Open your terminal and type:
pwd
(This stands for “print working directory.”) You’ll see output like this:
/Users/nelle
This tells you your current working directory—like your current location in the file system.
What does this location mean? Think of the file system like an upside-down tree:
/
└── Users
├── imhotep
├── larry
└── nelle
/
is the root (the top level of the system)./Users
contains a folder for each user./Users/nelle
is Nelle’s personal folder.
That’s why pwd
shows /Users/nelle
—Nelle is the current user.Know that your result may look different Your output might vary based on your operating system:
/Users/yourname
/home/yourname
/c/Users/yourname
If your prompt doesn’t show your home folder, you can move there by typing:
cd ~
Understand slashes
/
means “start from the root.”/Users/nelle/data
means the data
folder inside nelle
, inside Users
, starting from root.Use cd
to move to other folders
Try this:
cd Desktop
This moves you into the Desktop
folder inside your current directory.
💡 OneDrive Users: If you’re using OneDrive, you might need to use
cd OneDrive/Desktop
instead ofcd Desktop
.
To go back:
cd ..
This means “go up one level.”
Use ls
to list the contents of a directory
While in a folder, type:
ls
This shows the files and subfolders in that folder.
/
) when you want to refer to a file from anywhere in the system.