Starting applications from the terminal
The purpose of this guide is to teach you about starting applications from the terminal. Most applications are started by clicking on menu entries and icons on desktops and in panels, or using keyboard shortcuts, but it is useful to know how to start applications from the terminal too. Occasions when you might want to start an application from the terminal, include:
- When you are having a problem with an application. Often when you start an application from the terminal, messages concerning whatever errors are occurring are displayed in the terminal.
- When you want to start an application with root permissions. For example if you want to use a file manager to move a file in a directory that requires root permissions. Some applications need to be started with root permission, in order to function.
- When an application has no menu entry or icon, and can only be started with a command.
Table of Contents
- How to start applications in the terminal with normal user permissions.
- How to start applications in the terminal with root permissions.
- How to start applications from the terminal as background processes.
- Starting applications with normal user permissions.
Simply type the name of the application into the terminal, and press enter. The names of most applications are obvious. For example for Firefox, it's
firefoxThe names of some applications are not so immediately obvious. If you get a "command not found" error when you type what you think is the name of an application into a terminal, then to find its actual name try typing the word again, but preface it with apropos. For example:
al@my_desktop_pc:~$ chromium chromium: command not found al@my_desktop_pc:~$ apropos chromium chromium-browser (1) - the web browser from Google al@my_desktop_pc:~$
- Starting applications with root permissions
For security reasons, do not start applications with root permissions unless it is necessary to do so.
To start a command line application from the terminal with root permissions, preface the name of the application with sudo then enter your password at the prompt. For example to open nano text editor with root permissions, type:
sudo nanoFor security reasons the terminal doesn't display any feedback when you type your password, but just type it anyway then press enter.
To start GUI applications from the terminal with root permissions, sudo must not be used. Using sudo to start GUI applications has the potential to change file ownership permissions. On most desktops the command used in place of sudo to start GUI applications, is gksudo. For example to start Nautilus from the terminal with root permissions, type:
On KDE, it's kdesudo. For example to start Dolphin on KDE with root permissions, type:
- Starting applications as background processes.
Some applications are automatically forked to the background when they are started from the terminal, but most are run in the terminal. This means that closing the terminal would kill the process, closing the application. To start an application as a background process, so that you can close the terminal without killing the process and so leave the application running, append the name of the application with &.
For example to start the default Conky as a background process, type:
If the terminal doesn't return to the command prompt after starting an application as a background process, press Ctrl + C on your keyboard.
Edited by computerxpds, 11 April 2015 - 07:19 PM.