Lesson 8-1

Commands in Terminal

I mentioned this before, but just to be clear, these commands will also work in puTTY.

Anyways, Terminal as you know is our way of interacting with Git and a server at the same time. We use it to connect to a server, do stuff to files (create, edit, save, and compile), and we also can use it to help us navigate the harddrive (on Macs only, puTTY doesn't do it on PC, that I know of.)

A command is a word that is entered in the bottom of the terminal window after the $ sign. It looks something like this:
$insertCommandHere

Commands come in all different shapes and sizes. Some require 0 input (like ls) and some might require 1 or more inputs (like cd Desktop/). By default, when you enter terminal, you are placed in your hard drives root directory. This usually looks like YourComputerName:~ CurrentLoggedInUser$.

Here are some things to keep in mind when using Terminal:

  1. To go up a directory, type in cd ../
  2. When typing a cd/ command, you can sort or autofill by pressing the TAB button to have Terminal fill in the rest of your directories name. This also works with files.
  3. Aliases are shorthand commands to run tasks. They can make your life a lot easier. For example, when I was an undergrad at Indiana University, I used an alias called i495/ to run the ssh command to log into terminal. I did similar ones to access mySQL databases as well. These can save you a lot of typing, and I learned how to do it here. (follow the instructions labeled under "Permanent Aliases".
  4. Be aware of what version of terminal that you are running. There are many, and some commands are supported on a select few versions.
  5. All commands are case sensitive, as are file and directory names. Case and point, Terminal interactions are case sensitive.


In the next section I will point out the most useful/frequently used commands in Terminal.