Command line
The command line is often mentioned as a tool for starting or setting up Flightgear, Terrasync, FGCom and other programs related to FlightGear. Many users aren't aware of the command line or how to make use of it. This article may help...
Operating System independent advice: Try to use copy & paste as much as possible in order to avoid spelling mistakes, whenever you try to execute command line commands! The system will do exactly what you tell it on the command line and when you get it wrong, the system will do it wrong.
Windows
On Windows, you can get to the command line by clicking the "Start" button and then choosing "Run...". As a handy shortcut to the "Run..." prompt: Hold down the "Windows" key (the one with the windows flag on it) and tap the "R" key.
Type "cmd" (without quotation marks) into the field and hit Enter.
You should see the so called prompt now, which says something like that:
Microsoft Windows [Version x.y.zz.abc] Copyright and stuff C:\Windows>_
That says you're operating on drive C in directory Windows. The blinking cursor awaits your commands.
You can simply change drives by entering <drive-letter>: as shown below:
C:\Windows> d: D:\>_
And return to drive C in the same way:
D:\> c: C:\Windows>_
Now how about changing the directory? Assuming you downloaded Flightgear into the directory "Flightgear", that is located on drive D and its directory "Simulators". You do the following:
C:\Windows> d: D:\> cd Simulators D:\Simulators> cd Flightgear D:\Simulators\Flightgear>_
Easy, isn't it? You can also change directly into subdirectories:
C:\Windows> d: D:\> cd Games\Flightgear D:\Games\Flightgear>_
And if you got into the wrong directory somewhere, just try "cd .." to go one directory downwards:
D:\Games\Flightgear> cd .. D:\Games> cd .. D:\>_
That's most you'll need to know about the command line, when operating under Windows. Any commands that appear in the forums or in a wiki can be executed directly on the command line, after you have changed into the correct directory first.
Linux
Basics
On Linux systems, there are several ways to get a command line. As Flightgear does only run in a graphic X-Window system, we'll use a so-called terminal.
The most often used window managers are Gnome, KDE and Xfce. One way of getting to a console would be using the window managers menu:
- KDE KDE-Menue > System > Konsole
- Gnome Applications > Accessories > Terminal
- Xfce Applications > Terminal
A different approach would be pressing Alt F2. That should open a dialog box, where you can enter one single command. Depending on which distribution of Linux you chose and which window manager you use, you can try (all without quotation marks) "xterm", "konsole", "gnome-terminal", "gtkterm", "kterm", "xfce4-terminal"... there's a lot of graphical console emulators!
Now as you've got your console window, it will say something like that:
username@computername:~$_
This (especially the dollar sign) is the so called "prompt", where username should be the name of the currently logged on user and computername is the name of your computer. If your prompt is "#" instead of "$", you are logged in as root (superuser) and probably shouldn't be.
Note the "~" (tilde) sign before the prompt. On Linux systems that sign indicates, that you're in your home directory, which normally should be equal to "/home/username".
On Linux systems, you can change directories equally to the above described Windows method:
username@computername:~$ cd Flightgear username@computername:~/Flightgear$ cd data username@computername:~/Flightgear/data$ _
To go one directory back, you have to use "cd ..":
username@computername:~/Flightgear/data$ cd .. username@computername:~/Flightgear$ cd .. username@computername:~$ _
Now if you downloaded Flightgear to another place than your home directory, you can go anywhere else (remember, that "~" says you are in "/home/username"):
username@computername:~$ cd .. username@computername:/home$ cd .. username@computername:/$ _
Notice, that the "~" sign disappeared, as you went out of your personal home directory from "/home/username" to "/home". The directory "/" is the so called root directory - you can't go downwards from here as all directories are based here.
To change directly to a specific directory, you may use:
username@computername:~$ cd /any/path/you/like username@computername:/any/path/you/like$ cd /home/username username@computername:~$ cd /some/other/path username@computername:/some/other/path$ cd ~ username@computername:~$ _
Notice, that cd-ing to /home/username produces the "~" sign, indicating, that you're at your home directory, as well as "cd ~" directly brings you there.
One last note, before we finish this thing:
Linux systems are case sensitive, so you have use the correct case sensitive spelling of files and directories. Otherwise the command line won't act as expected!
Now this should be enough, to change to a desired directory, where commands can be executed.