Navigating in the Terminal

Navigating in the terminal is mainly done with just three commands: cd, pwd, and ls. In fact, you could just do it with the cd command and the tab key.

Where Am I?
When you just open the terminal, you are in the home folder. This should be the "/Users/saierlab/" folder. If you don't know where you are, just use the pwd command: pwd and the terminal will tell you where you are.

Viewing Folder Contents
You can see what's in your folder, or even other folders using ls. There is a small chance your file is hidden, but problably not. If it is, you'd be able to see it by using "ls -a" on the correct folder.

Moving to Other Folders
Use cd to move to other folders. If there's a folder called "asdf" in your folder, the command is simply: cd asdf

To move back one folder: cd ..

Where's my Stuff?
The desktop is in the home folder, under "Users/saierlab/Desktop". Your stuff is usually in there. The Download folder is also in the home folder, under "Users/saierlab/Downloads". Flash drives will be mounted in "/media" or "/mnt" for Ubuntu, "/Volumes" for Mac, or something similar. Look in each of them. Note that this is "/media" and not "media", meaning the media folder is in the root directory.

Finding Files in Linux/Mac
If you don't know where the files are, use the operating system search utility. If you really, really need to use the terminal to search for files, you can do a search for them using find or locate. Locate is better than find, unless it's a file you just created today.

Tab Shortcuts
This is a shortcut that may help you navigate folders more quickly. If you're not quite sure what a folder name was, tap the tab key twice and the terminal should show you a list of files and folders in the path that you've typed so far.

If you type a part of a file name, and press tab once, the terminal will complete the file name as far as it can, but will stop if there's two files that begin with the same prefix. For example, if so far you've typed cd /Users/sai and you press tab before you press enter, it will complete the command to "cd /Users/saierlab". This generally works from the command line no matter what command you are using.