Why use the terminal?
"Under Linux there are GUIs (graphical user interfaces), where you can point and click and drag, and hopefully get work done without first reading lots of documentation. The traditional Unix environment is a CLI (command line interface), where you type commands to tell the computer what to do. That is faster and more powerful, but requires finding out what the commands are."
— from man intro(1)
This page gives an introduction to using the command-line interface terminal, from now on abbreviated to the terminal. There are many varieties of Linux, but almost all of them use similar commands that can be entered from the terminal.
There are also many graphical user interfaces (GUIs), but each of them works differently and there is little standardization between them. Experienced users who work with many different Linux distributions therefore find it easier to learn commands that can be used in all varieties of Ubuntu and, indeed, in other Linux distributions as well.
For the novice, commands can appear daunting:
However, it is important to note that even experienced users often cut and paste commands (from a guide or manual) into the terminal; they do not memorize them.
It is important, of course, to know how to use the terminal — and anyone who can manage typing, backspacing, and cutting and pasting will be able to use the terminal (it is not more difficult than that).
Starting a terminal
In Unity
Unity is the default desktop environment used as of 11.04. Where systems are not ready for Unity they revert to GNOME which is also used in previous releases such as Ubuntu 10.04 LTS (Lucid), see next sub-section.
The easiest way to open the terminal is to use the ‘search’ function on the dash. Or you can click on the ‘More Apps’ button, click on the ‘See more results’ by the installed section, and find it in that list of applications. A third way, available after you click on the ‘More Apps’ button, is to go to the search bar, and see that the far right end of it says ‘All Applications’. You then click on that, and you’ll see the full list. Then you can go to Accessories -> Terminal after that. So, the methods in Unity are:
Dash -> Search for Terminal
Dash -> More Apps -> ‘See More Results’ -> Terminal
Dash -> More Apps -> Accessories -> Terminal
Keyboard Shortcut: Ctrl + Alt + T
In GNOME
GNOME is the classic desktop environment for Ubuntu 11.04 (Natty) and is the default desktop environment in earlier releases, such as Ubuntu 10.04 LTS (Lucid).
Applications menu -> Accessories -> Terminal.
Keyboard Shortcut: Ctrl + Alt + T
In Xfce (Xubuntu)
Applications menu -> System -> Terminal.
Keyboard Shortcut: Super + T
Keyboard Shortcut: Ctrl + Alt + T
In KDE (Kubuntu)
KMenu -> System -> Terminal Program (Konsole).
In LXDE (Lubuntu)
Menu -> Accessories -> LXTerminal.
Keyboard Shortcut: Ctrl + Alt + T
Commands
sudo: Executing Commands with Administrative Privileges
The sudo command executes a command with administrative privileges (root-user administrative level), which is necessary, for example, when working with directories or files not owned by your user account. When using sudo you will be prompted for your password. Only users with administrative privileges are allowed to use sudo.
Be careful when executing commands with administrative privileges — you might damage your system! You should never use normal sudo to start graphical applications with administrative privileges. Please see RootSudo for more information on using sudo correctly.
File & Directory Commands
) symbol stands for your home directory. If you are user, then the tilde (
pwd: The pwd command will allow you to know in which directory you’re located (pwd stands for "print working directory"). Example: "pwd" in the Desktop directory will show "
ls: The ls command will show you (‘list’) the files in your current directory. Used with certain options, you can see sizes of files, when files were made, and permissions of files. Example: "ls
To navigate to your home directory, use "cd" or "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 /var/www" to go directly to the /www subdirectory of /var/. As another example, "cd
mv: The mv command will move a file to a different location or will rename a file. Examples are as follows: "mv file foo" will rename the file "file" to "foo". "mv foo
-
To save on typing, you can substitute ‘
Note that if you are using mv with sudo you can use the
shortcut, because the terminal expands the
to your home directory. However, when you open a root shell with sudo -i or sudo -s,
Here is an example of when it would be necessary to execute a command with administrative privileges. Let’s suppose that another user has accidentally moved one of your documents from your Documents directory to the root directory. Normally, to move the document back, you would type mv /mydoc.odt
/Documents/mydoc.odt, but by default you are not allowed to modify files outside your home directory. To get around this, you would type sudo mv /mydoc.odt
/Documents/mydoc.odt. This will successfully move the document back to its correct location, provided that you have administrative privileges.
Running a File Within a Directory
So you’ve decided to run a file using the command-line? Well. there’s a command for that too!
./filename.extension
After navigating to the file’s directory, this command will enable any Ubuntu user to run files compiled via GCC or any other programming language. Although the example above indicates a file name extension, please notice that, differently from some other operating systems, Ubuntu (and other Linux-based systems) do not care about file extensions (they can be anything, or nothing). Keep in mind that the ‘extension’ will vary depending upon the language the source code is written in. Also, it is not possible, for compiled languages (like C and C++) to run the source code directly — the file must be compiled first, which means it will be translated from a human-readable programming language to something the computer can understand. Some possible extensions: ".c" for C source, ".cpp" for C++, ".rb" for Ruby, ".py" for Python, etc. Also, remember that (in the case of interpreted languages like Ruby & Python) you must have a version of that language installed on Ubuntu before trying to run files written with it.
Finally, the file will only be executed if the file permissions are correct — please see the FilePermissions help page for details.
System Information Commands
df: The df command displays filesystem disk space usage for all mounted partitions. "df -h" is probably the most useful — it uses megabytes (M) and gigabytes (G) instead of blocks to report. (-h means "human-readable")
du: The du command displays the disk usage for a directory. It can either display the space used for all subdirectories or the total for the directory you run it on. Example:
In the above example -s means "Summary" and -h means "Human Readable".
free: The free command displays the amount of free and used memory in the system. "free -m" will give the information using megabytes, which is probably most useful for current computers.
top: The top (‘table of processes’) command displays information on your Linux system, running processes and system resources, including CPU, RAM & swap usage and total number of tasks being run. To exit top, press "q".
uname -a: The uname command with the -a option prints all system information, including machine name, kernel name & version, and a few other details. Most useful for checking which kernel you’re using.
lsb_release -a: The lsb_release command with the -a option prints version information for the Linux release you’re running, for example:
ip addr reports on your system’s network interfaces.
Adding A New User
The "adduser newuser" command will create a new general user called "newuser" on your system, and to assign a password for the newuser account use "passwd newuser".
Options
The default behaviour for a command may usually be modified by adding a —option to the command. The ls command for example has an -s option so that "ls -s" will include file sizes in the listing. There is also a -h option to get those sizes in a "human readable" format.
Options can be grouped in clusters so "ls -sh" is exactly the same command as "ls -s -h". Most options have a long version, prefixed with two dashes instead of one, so even "ls —size —human-readable" is the same command.
"Man" and getting help
man command, info command and command —help are the most important tools at the command line.
Nearly every command and application in Linux will have a man (manual) file, so finding them is as simple as typing "man "command"" to bring up a longer manual entry for the specified command. For example, "man mv" will bring up the mv (move) manual.
Move up and down the man file with the arrow keys, and quit back to the command prompt with "q".
"man man" will bring up the manual entry for the man command, which is a good place to start!
"man intro" is especially useful — it displays the "Introduction to user commands" which is a well-written, fairly brief introduction to the Linux command line.
There are also info pages, which are generally more in-depth than man pages. Try "info info" for the introduction to info pages.
Some software developers prefer info to man (for instance, GNU developers), so if you find a very widely used command or app that doesn’t have a man page, it’s worth checking for an info page.
Virtually all commands understand the -h (or —help) option which will produce a short usage description of the command and it’s options, then exit back to the command prompt. Try "man -h" or "man —help" to see this in action.
Caveat: It’s possible (but rare) that a program doesn’t understand the -h option to mean help. For this reason, check for a man or info page first, and try the long option —help before -h.
Searching the manual pages
If you aren’t sure which command or application you need to use, you can try searching the manual pages. Each manual page has a name and a short description.
To search the names for <string> enter:
For example, whatis -r cpy will list manual pages whose names contain cpy. The output from whatis -r cpy will in part depend on your system — but might be as follows:
To search the names or descriptions for <string> enter:
For example, apropos -r "copy files" will list manual pages whose names or descriptions contain copy files. The output from apropos -r "copy files" will in part depend on your system — but might be as follows:
Other Useful Things
Prettier Manual Pages
Users who have Konqueror installed will be pleased to find they can read and search man pages in a web browser context, prettified with their chosen desktop fonts and a little colour, by visiting man:/command in Konqueror’s address bar. Some people might find this lightens the load if there’s lots of documentation to read/search.
Pasting in commands
Often, you will be referred to instructions that require commands to be pasted into the terminal. You might be wondering why the text you’ve copied from a web page using Ctrl + C won’t paste in with ctrl+V. Surely you don’t have to type in all those nasty commands and filenames? Relax. ctrl+shift+V pastes into a GNOME terminal; you can also do middle button click on your mouse (both buttons simultaneously on a two-button mouse) or right click and select Paste from the menu. However, if you want to avoid the mouse and yet paste it, use "Shift + Insert", to paste the command. If you have to copy it from another terminal / webpage, you can use "Ctrl + Insert" to copy.
How to Open Terminal in Ubuntu Linux
When you are absolutely new to Ubuntu, things could be overwhelming at the beginning. Even the simplest of the tasks like opening a terminal window in Ubuntu could seem complicated.
That’s okay. It’s nothing to be ashamed of. You are in a completely new environment and it could take some time to getting used to it.
Let’s focus on the terminal here and let me show a few ways to launch the terminal in Ubuntu.
Method 1: Launch Ubuntu terminal using keyboard shortcut
I find using keyboard shortcuts in Ubuntu a lot more convenient. To open a terminal, you can press Ctrl, Alt and T keys together.
It’s not that complicated. Press and hold Ctrl first and then press Alt key and hold on to it as well. When you are holding both Ctrl and Alt keys, press T and you’ll see that a new terminal window is opened.

Terminal application in Window
That was easy, right? But I can understand that you may not remember the shortcut always, even though it is really easy. In that case, the second method comes to your rescue.
It's FOSS Abhishek Prakash

Method 2: Open terminal from the menu
This is the generic method for opening any installed application in Ubuntu.
Press the Windows key (also known as super key in Linux) and type terminal. It will show the terminal application icon and you click on it to launch the terminal.

Launching terminal in Ubuntu from the menu
You can use this method to launch any other application. Just type the name of the application and it will show all the installed applications that match your searched term.
You cannot go wrong with this method.
It's FOSS Abhishek Prakash

Bonus Tip: Open current directory location in terminal from Nautilus
Did you know that you can open a particular location in the terminal from the file explorer (called Nautilus)?
When you are in the file explorer, right click on an empty space. In the context menu, you’ll see the option of ‘Open in Terminal’.

Right click in the file explorer and select ‘Open in Terminal’
You click on this option and it will open a new terminal window with the same directory location you were in the file explorer.

Opened terminal window in the same folder as it was in Nautilus
This saves some time when you are in a deeply nested directory and have to edit something there in the terminal.
That’s cool. You learned not only to open a terminal window in Ubuntu but also learned to open a terminal with a specific directory from Nautilus. How cool is that?
5 способов открыть терминал в Linux: Ubuntu, Debian, Mint и др. (terminal ∼черное окно с командной строкой)

При работе в Linux нередко требуется вводить определенные команды в терминале (представляет он из себя что-то похожее на командную строку в Windows: то же черное окно с предложением ввести текстовую команду). Судя по комментариям, — не все начинающие пользователи могут с наскоку найти и открыть окно терминала, а потому решил кратко рассмотреть неск. способов его запуска. 👌
Зачем может понадобиться терминал:
- устанавливать, удалять приложения; копировать файлы, каталоги и пр.;
- обновлять систему, ядро и пр.;
- создавать пользователей;
- производить настройку сети, DNS, IP, и пр.;
- настраивать права доступа;
- запускать приложения, скрипты, настраивать расписание их запуска в авто-режиме;
- перезагружать и выкл. машину;
- и многое-многое другое.

Способы
Первый: ярлыки на раб. столе, в меню
Пожалуй один из наиболее простых и очевидных способов запустить терминал — это воспользоваться соотв. ярлыком в меню «ПУСК» («Приложения»), либо на рабочем столе, либо с нижней/верхней панельки (в зависимости от вашей версии Linux — ярлыки могут находиться в разных местах 😉).
Прим.: осмотрите вкладки «Система», «Администрирование», «Служебные» и пр. Как правило в них почти наверняка есть ярлык для запуска терминала.

Меню ПУСК (приложения системные, администрирование)
Второй: горячие клавиши
Попробуйте воспользоваться «горячими клавишами». В Ubuntu, Debian это обычно:
- Ctrl+Alt+T
- Win+T
Посмотреть какие именно клавиши заданы можно в настройках клавиатуры (вкладка «Комбинации клавиш» ).

Ctrl+Alt+T — сочетание клавиш для вызова окна терминала
Третий: через обозреватель
Попробуйте открыть какой-нибудь каталог через стандартный обозреватель, а потом нажмите правой кнопкой мыши по свободному месту — должно появиться контекстное меню, в котором будет ссылка на терминал. См. пример ниже.👇

Щелчок правой кнопкой мыши в обозревателе
Четвертый: окно поиска
Во многих граф. средах (оболочках) Linux есть возможность воспользоваться строкой поиска: ее можно вызвать либо прямо мышкой через элемент интерфейса, либо нажав сочетание ALT+F2 .
В строке поиска можно попробовать набрать одно из нижеприведенного:
- gnome-terminal
- terminal
- xfce4-terminal
Как правило, система сама вам подскажет какой вариант ввести и предложит открыть терминал. Удобно?! 👌

ALT+F2 — окно поиска
Пятый: виртуал. системная консоль
При запуске системы Linux создаются 7 вирт. консолей, последняя из них реализует графическую оболочку (shell), которую мы и видим (с рабочим столом, панельками и т.д.).
Разумеется, можно переключиться и на ту консоль, которая представляет собой «текстовый вариант» (терминал). Для этого достаточно нажать сочетание клавиш: Ctrl + Alt + F1, либо Ctrl + Alt + F2, либо Ctrl + Alt + F3 .
📌 Важно! На некоторых ноутбуках функциональные клавиши F1-F12 работают только при зажатой Fn!
Далее потребуется ввести свой логин и пароль — и можно работать! Для выхода из консоли введите команду Exit , а затем нажмите сочетание Ctrl + Alt + F7 .

📌 Примечание: как получить права ROOT, как закрыть терминал
Для выполнения ряда команд требуются права ROOT (администратора машины). Чтобы их получить — достаточно в терминале воспользоваться одной из команд:
- набрать команду «sudo bash» и ввести пароль;
- набрать команду «su — root» .
- Разумеется, далее вам потребуется ввести пароль администратора, который вы задавали при установке системы!
Для выхода из терминала:
-
в графическом окружении: достаточно нажать на крестик в углу окна (либо ввести команду «exit» и нажать Enter);

Дополнения по теме — приветствуются! Их можно оставить в комментариях ниже.
What is a terminal and how do I open and use it?
The terminal is an interface in which you can type and execute text based commands.

Why use it:
It can be much faster to complete some tasks using a Terminal than with graphical applications and menus. Another benefit is allowing access to many more commands and scripts.
A common terminal task of installing an application can be achieved within a single command, compared to navigating through the Software Centre or Synaptic Manager.
For example the following would install Deluge bittorrent client:
To save a detailed list of files in the current directory tree to a file called listing.txt :
Sometimes you will also see the following notation:
This means that the command whoami is executed which gives calum as output. Following that command, ls is executed which outputs Downloads Documents .
A similar notation is:
This means that the command should be run as root, that is, using sudo :
Note that the # character is also used for comments.
How do I open a terminal:
Open the Dash (Super Key) or Applications and type terminal

Use the keyboard shortcut by pressing Ctrl + Alt + T .
For older or Ubuntu versions: (More Info)
Applications → Accessories → Terminal
Alternative names for the terminal:
- Console
- Shell
- Command line
- Command prompt
Common commands & Further information
- Ubuntu Documentation: Using The Terminal
A Terminal is your interface to the underlying operating system via a shell, usually bash. It is a command line.
Back in the day, a Terminal was a screen+keyboard that was connected to a server. Today, it is usally just a progam.
You can open it via the utilities part of the apllications menu, or press Alt + F2 and type gnome-terminal .
The terminal (also known as console) is an application in which you can execute commands directly. It looks like:

You can start the terminal from Applications -> Accessories -> Terminal.
If you’re not using Gnome, but KDE (Kubuntu), you would find it under: Kickoff menu -> Applications -> System -> Konsole.
The Ubuntu wiki has an article about the terminal which includes information on starting the terminal in Xubuntu and Lubuntu, and a basic overview of commonly used commands. It’s recommended for reading as it includes much examples as well.
A Terminal is a command interpreter. A Terminal is an entity that takes input from the user and deals with the computer rather than the user deal directly with the computer. If the user had to deal directly with the computer he would not get much done as the computer only understands strings of 1’s and 0’s
Example
When a person drives a car, that person doesn’t have to actually adjust every detail that goes along with making the engine run, or the electronic system controlling all of the engine timing and so on. The dashboard would also be considered part of the the Terminal since pertinent (Having logical precise relevance to the matter at hand) information relating to the user’s involvement in operating the car is displayed there. In fact any part of the car that the user has control of during operation of the car would be considered part of the Terminal.
Terminal is a program that allows the user to use the computer without him having to deal directly with it. It is in a sense a protective shell that prevents the user and computer from coming into contact with one another.