The terminal is the Linux and Unix versions of a command-line interface. That means the program is text only (i.e. no graphics). The main reason our team uses this is to edit files directly on the robot. Note that the terminal, unlike the command prompt,
Accessing the Terminal
If you are trying to access the robot remotely, just [SSH] into it. You might have to login.
If you want to access the terminal locally on a Linux or OS X machine, simply open the application named "Terminal" (Ubuntu has this bound to Ctrl+Alt+T).
Your prompt will (probably) appear as
Like a file explorer, you will always be in one directory. Whenever you see the prompt, you can enter a command. If at any time a command gets stuck, just hit Ctrl-C (or Cmd-C if your are on a Mac) to stop the command.
- ls: This will list the contents of your current directory. By specifying a folder (like ls path/to/folder, you can list the contents of an arbitrary directory.
- Note: you will always see at least two listings (except in rare circumstances):
- "." is your current directory
- ".." is the parent directory
- cd path/to/folder: This will change your current directory to whichever one is specified. Note that folder paths can be absolute (cd /home/stephen/Desktop) or relative (cd Documents). Note that you can also use CD .. to navigate to the parent directory.
- vi: This opens up vi. If you specify a file, vi will open that file (if the file does not exist, it will create a new one with the specified name).
- ./program: If your directory contains an executable, you can run it just by typing this. Additionally, if you are in the wrong directory, you can run the file by specifying either a relative or absolute path to the file.
- echo foobar: This will print whatever follows it (replace foobar with anything). echo is escpecially useful when trying to see things like the path, which can be accessed as echo $PATH.
Sometimes, you might have downloaded a program (such as PuTTY) and want to run it from the command line. Unfortunately, you may find that you have to specify the entire path, which is tedious. Luckily, you can tell command prompt to look in certain places for programs, which would allow you to just give the program name instead of the path.
Open up the file ~/.profile, and make a line
You can extend this to include many programs if you want. If done correctly for the example, you would be able to say