Using the command line

Using the command line might seem like a big challenge to first time users being afraid of ruining everything and having to start from scratch. But do not be afraid, you do not need to be a computer expert to be able to use it, we just would like you to be curious to try things out.

Here we want to provide you with the basics for the first steps to get started. Then you can keep exploring the command line using the Opens internal link in current windowtools and exercises of the OpenForis Geospatial toolkit, or one of the many online resources available, for example:

How to open the command line/the terminal?

On Unity, go to the dash and search for "Terminal". In some systems, you also find it under Applications --> Accessories or Utilities --> Terminal. The keyboard shortcut is Crtl + Alt + T in most cases.

Once you opened it, you should see something like this:

user@gis:~ $

user is the name of the user that is currently logged in, and gis is the name of the computer. The part after the : is the working directory, in this case ~. This stands for the home directory, in this case /home/user because the user is called user. After the $ sign, you can type in commands.

 

The working directory

The command "pwd" prints your current working directory (pwd stands for print working directory). When you open the terminal, the working directory will always be the home directory. To navigate to other directories, you can use the "cd" command. To navigate to the folder "OFGT_data" in your home directory, you can for example use:

user@gis:~ $ cd ~/OFGT_data

If the directory does not exist yet, use the "mkdir" command to create (or "make") the directory:

user@gis:~ $ mkdir ~/OFGT_data

Some useful hints for using the cd command:

  • To navigate to your home directory, use "cd" or "cd ~"
  • To navigate up one directory level, use "cd .."
  • To navigate to the previous directory (or back), use "cd -"
  • To navigate into the root directory, use "cd /"
  • To navigate through multiple levels of directory at once, specify the full directory path that you want to go to. For example, use "cd ~/OFGT-data/images" to go directly to the images subdirectory in the OFGT-data folder. As another example, "cd ~/Desktop" will move you to the Desktop subdirectory inside your home directory.

Only knowing these commands, you will already be able to download the Opens internal link in current windowexample data set using the command line, and getting started with the Geospatial Toolkit!