

To move up one directory (to the parent folder) use:įor example if you were in the “Miscellaneous” directory mentioned above, doing “cd. (Replacing “parentfoldername” with the name of the parent folder, etc.) To navigate into a child folder, you can do:Ĭd parentfoldername/childfoldername/additionalchildfoldername If you want to switch to a folder (directory) that isn’t within your current working directory, you still have options. In this scenario, the folder you’re switching to is commonly referred to as the “argument” for the “cd” command. On the desktop, there’s a folder called “Miscellaneous.” If you’re in the Mac terminal and your current working directory is M圜omputer, doing “cd misc” it will output an error such as:Ĭd: no such file or directory: miscellaneousīut if your working directory is Desktop in the above example, when you do “cd miscellaneous,” it will switch you to the folder titled “miscellaneous” that’s on the desktop. Let’s say that your computer has a parent folder called “M圜omputer.” Within that folder, there’s a “Desktop” folder. That may sound confusing, but think of it like this: However, the directory (folder) you’re switching to has to be within the current working directory.

Find file mac terminal command how to#
If you’re wondering how to navigate to a folder in Terminal, look no further.Ĭd stands for “change directory.” This command switches you into the directory you specify (i.e.: it changes the “working directory”). If all it said was “Games,” you might not be sure where on your computer the “Games” folder was nested.

I.e.: it shows you exactly where you are. “ls” and “pwd” are helpful for showing where you are in the filesystem. “pwd” stands for “print working directory.” It shows the name of the directory you’re currently in, aka the “working directory.” Often abbreviated as stderr, this refers to an an error message outputted by a failed process. Often abbreviated as stdout, this refers to information outputted after a process is run.įor example, if you did an “ls” command, the standard output would be the list of files/folders it showed as a result. Often abbreviated as stdin, this refers to any information (for example text) inputted into the terminal through the keyboard or input device.įor example, standard input could be whatever command you enter. So you might have a path like:ĭesktop/Music/Albums/OliviaRodrigo/DriversLicenseLyrics.txt Standard Input: Each of those folders would also have their own folders within them. Within that folder, you might have folders for Art, Music, Programming, and Pictures. The first directory in the filesystem is the “root directory.” It’s the parent of all other directories and files in the filesystem.įor example, let’s say you have a folder called “Desktop” as your root directory. Whatever folder (or directory) you’re currently looking at in the terminal is called the “working directory.” Filesystem:įiles and directories on your computer are organized into a “filesystem.” This organizes the computer’s files and directories into a tree-like structure. When using the command line, folders are called “directories.” When talking about the command line/Mac terminal, an “argument” is the subject of a command. When you see the shell prompt at the end of a line, you’ll know that it’s ready to accept commands. For example, when you first open the terminal, you’ll see a placeholder line like ~ $ This is called a “shell prompt.” It shows up when the Mac terminal is ready to accept a command. Then, simply double-click the Terminal app result. To open Terminal on your Mac, you can click the magnifying glass search icon in the top bar, and type “Terminal.” How to Open Terminal on Mac:Īccessing the terminal app on your Mac is easy. Tip before you dive in: although you might see commands with quotation marks below, you don’t need to use the quotation marks in the terminal. And if you aren’t sure where to start, you can use the cheat sheet below! It contains commands as well as common vocabulary.

Once you get the hang of the commands, using the terminal can become second nature. But the good news is that it follows straightforward rules. You might immediately become anxious seeing a reference to the “command line” – or as it’s known on Mac, “terminal.” It’s true that it can feel daunting to use at first.
