What is a command?
Commands, and the command line, are another way to tell the computer what to do. For example, you can click the google chrome icon, or you can run the command google-chrome
.
This may seem a silly thing to do, but when you click the icon, that's what the computer does! It also is much easier to do some tasks with the command line.
For example, installing programs can be quicker and easier - just use sudo apt-get install program
, rather than navigating through the software center.
And if my Bluetooth stops working, I run a command to fix it - that's the only way!
Anyway, how do you run a command?
This is also simple, although there are many ways to do it.
Simply, you open a Terminal and type (or copy / paste) the command in, then press Enter. In the image, I've run the command ls Desktop/
which will list all files on my desktop. Note that to paste you press Ctrl + Shift + V in the terminal.

By default you open the terminal by pressing Ctrl + Alt + T, or opening the Dash and searching for "Terminal".
What is a tty
?
Sometimes, you may be told to run a command in the tty
- often followed by a number, for example tty2
. The GUI runs on tty7
. (Update for 2021: the GUI now often runs on tty1
or tty2
).
To access this, you press Ctrl + Alt + FX - where FX is replaced with the Function key that corresponds to the number. For example, to access tty2
you would press Ctrl + Alt + F2.
You have to login to this, but some things need the tty
to work.
Getting back to the GUI will depend on your Ubuntu version, but trying each tty
in turn should work until you find it. If you can’t find it on any tyy
1-8, you may need to restart - but ask the person who is helping you by commenting below the answer!
What about GUI (Graphical User Interface) programs?
The terminal can also launch GUI programs. This can have the advantage of viewing the output the program gives - for example running software-centre
looks like this:

You can also provide extra "arguments" - also known as "parameters" and "options" to the command.
For example, if I run google-chrome --app=http://youtube.com
it opens a window without the URL bar or the tabs:

Bear in mind, if you close the terminal, you also lose the Google Chrome window...
One final method
This is only good for GUI programs, like Chrome, Firefox and Gedit. However, it also means you don't have a terminal lying around - which you could accidentally close. It's no good for sudo apt-get install program
or similar, because you can't type your password after running it.
Press Alt + F2, and a "Run Dialouge" appears - a bit like the run window on Windows:
Ubuntu: Windows:


You can type any command into here, and it will run it!
sudo
commands, etc. to them. This is one question I certainly won't be linking to. – muru Feb 28 '16 at 20:01sudo apt-get update
from the run dialog. That's all I have to say. – muru Feb 28 '16 at 20:05