Appendix 1: Using the command line (aka Terminal, Console)

Windows

If you have to type something which is has spaces in it, and you want to make programs consider it as one argument (instead of breaking at the spaces), put it between qutation marks.
Every Linebreak is considered as a new command, so don’t use linebreaks in the middle of a command!!!

Launching the command line:

  1. Go to the start menu, and choose Run…
  2. In the window that pops, type cmd and click ok

Changing the working directory:

  1. To change a drive (such as c, d, f or whatever drive you have), type DRIVE_LETTER:
  2. To go to a subdirectory, type cd SUB_DIRECTORY_NAME
  3.  To go upwards one directory type cd ..
  4. You can specify a larger path of directories for cd by seperating the directories with ‘\’.
    For example, cd ..\.. (two directories upwards), cd ..\Java (change to a directory in the same level that is called java).
  5. You can specify absolute paths for cd. For Example: cd c:\Program Files\Java
  6. Use the Tab key to autocomplete the name of a directory/file that you began to type

Modifying an environment variable the Path:

  1. To view an environment variable, type echo %VARIABLE_NAME%
  2. To change a variable, type set VARIABLE_NAME=NEW_VALUE
    For example, if you want append the directory c:\Program Files\Java to your path, type the following command: set PATH=%PATH%;c:\Program Files\Java  (since all the paths in the PATH variable must be sperated with semicolons).

Linux (works on most distributions)

Launching the command line:

  1. Go to the Applications menu (or Kmenu on KDE)
  2. Choose Accessories (or System - depending on your linux version) and then choose Terminal

Changing the working directory:

Similar to the way you do it on Windows except for the fact that the seperator is ‘/’ and not ‘\’. To get to the root directory, type cd \.
See the explanation above for more details.

Modifying an environment variable the Path:

  1.  To view an environment variable, type echo $VARIABLE_NAME
  2.  To change a variable, type VARIABLE_NAME=NEW_VALUE
    For example, if you want append the directory /mydir to your path, type the following command: PATH=$PATH:/mydir (all the paths in the PATH variable must be sperated with ‘:’).
Leave a Reply