Как запустить gedit ubuntu

Обновлено: 03.07.2024

gedit - текстовый редактор (gnome editor) для среды GNOME.
xed - текстовый редактор (x editor), основанный на Pluma (MATE), созданный разработчиками Mint, как унифицированное приложение для дистрибутива Linux Mint 18.

В своём ежемесячном послании в "The Linux Mint Blog" от 28 января, основатель Linux Mint - Clement Lefevre (Клемент Лефевр) опубликовал интересную информацию о разработке и внедрении в Linux Mint 18 унифицированных приложений X-Apps.
Унифицированные - это значит приведённые к единообразной системе и форме - приложения, которые будут внедрены в дистрибутивах Linux Mint (Cinnamon, Mate и Xfce).
Это связано с тем, что разработчики Gnome в компоненты GNOME 3.18 внесли большие изменения, с целью минимизировать интерфейс многих приложений, следуя моде, взятой у Apple, что вызвало, мягко говоря, недоумение у многих обычных пользователей, особенно у новичков в Linux.
Конкретно в статье обозначено для примера приложение gedit (GNOME editor) - текстовый редактор, которое теперь в Linux Mint 18 будет называться xed, с функциями текстового редактора, но с привычным интерфейсом и основанном на текстовом редакторе Pluma - форк Gedit в Linux Mint MATE.

Вот как выглядят оба приложения в Ubuntu 16.04:


Аннотация и характеристики xed:

Лично для меня более удобно и привычней работать в минтовском xed, чем в гномовском gedit. Поэтому я установил xed в Ubuntu 16.04.


Установка xed в Ubuntu 16.04

Выполните в терминале одну из следующих команд, согласно архитектуры вашей системы:

Для систем 32-bit:

Для систем 64-bit:

После установки, оба приложения в меню будут отображаться, как Текстовый редактор. Чтобы не путаться, можно удалить gedit:

Text Editor (gedit) is the default GUI text editor in the Ubuntu operating system. It is UTF-8 compatible and supports most standard text editor features as well as many advanced features. These include multilanguage spell checking, extensive support of syntax highlighting, and a large number of official and third party plugins.

gedit is suited for both basic and more advanced text editing and is released under the GNU General Public License.

gedit.screenshot1.jpg

gedit is located in Ubuntu's Main repository and is installed by default. gedit can be installed in Kubuntu, Xubuntu and other distributions although additional libraries are necessary and will be installed on non-GNOME systems.

gedit incorporates a graphical user interface (GUI) and is opened by going to Applications → Accessories → Text Editor or by pressing Alt+F2 and typing gedit

Command Line Tips

Create Backup Copy: Edit → Preferences → Editor tab. This option is enabled by default and creates a copy of the file before saving changes. Backup files saved in this manner are appended with a trailing "

    Tag List. Displays common tags in a side pane and allows for easy insertion into the file.

For descriptions of standard plugins distributed with the gedit package visit this link.

Many additional plugins are available from third-party resources. See the Links section near the bottom of this page.

A very useful feature of gedit is the ability to color programming code. Using syntax highlighting makes simple errors easier to recognize. gedit uses the GtkSourceView for syntax highlighting. The .lang file for a specific programing language is located in the /usr/share/gtksourceview-3.0/language-specs/ folder. These files may be edited or additional files created to further define the highlighting definitions.

Using gedit for XML / Docbook XML

    Under the View tab make the following selections. Selecting most of the options just make life easier.

Now comes the most interesting part, go to View > Highlight Mode > Markup and while we want Docbook one can also see XML and both look slightly different from each other:

Experiment with gedit's settings and markup in general to have a feel of what works best for you.

If you are running Ubuntu and attempt to remove gedit via Synaptic or apt, the system will also attempt to remove the ubuntu-desktop metapackage. If you try to remove ubuntu-desktop specifically in Synaptic the user will be cautioned with:

If the user is experiencing problems with gedit, it may be preferable to first reset the user's preferences by removing the user's .config/gedit folder rather than attempting to remove the entire application and the ubuntu-desktop metapackage. Learn more about Ubuntu's MetaPackages.

"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).

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.

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

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".

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 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:

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.


Возможности программы

Использование вкладок.
Поддержка различных кодировок.
Подсветки синтаксиса для ряда языков программирования и разметки.
Проверка орфографии.
Нумерация строк.
Подсветка текущей строки.
Функции поиска и замены текста.
Переход к указанной пользователем строке.
Настраиваемые цвета и шрифты, используемые редактором.
Печать с возможностью предпросмотра.
Автоматический перенос строк в указанной позиции.
Подсветка соответствующих открывающих и закрывающих скобок.
Автоматическое сохранение резервных копий файлов перед изменением.
Поддержка плагинов.

Gеdit действительно является мощным редактором, чем это может показаться на первый взгляд. В частности, система плагинов позволяет получить почти все функциональные возможности, которые есть в Notepad Windows.

В дистрибутивах Ubuntu текстовый редактор Gеdit установлен по умолчанию:



С помощью Gеdit можно делать простые заметки и документы, используя некоторые из его дополнительных функций, использовать в качестве собственной среды разработки программного обеспечения, а также редактировать текстовые файлы системы:




1. Написание текстов.

Для написания и корректировки статей на этом сайте Gеdit меня вполне устраивает, как текстовый редактор, который вполне заменяет громоздкий LibreOffice Writer.

2. Редактирование файлов.

Вы наверное иногда выполняли команды на открытие и редактирование файлов, не задумываясь над тем, что все они открываются именно в текстовом редакторе Gеdit (примеры):

Когда откроется редактор Gedit с файлом, в нижней части списка заставок (НЕ в конец файла), нужно скопировать/вставить следующую строку:

GL: qmlsaver --root 1 \n\

Должно получиться следующим образом:


Когда откроется текстовый редактор, скопируйте строку ниже и вставьте в конец файла .bashrc:

Должно получиться как на снимке:


Сохраните и закройте редактор.


Вы можете сами редактировать какие-то файлы, открывая и изменяя их в Gedit. Я уже упоминал об этом в статье Терминальные команды в Linux, где говорится о том что когда вы на одном из сайтов нашли нужную программу и установили её терминальной командой, но потом решили удалить и не нашли команду на удаление, то можете переделать данную команду, чтобы она соответствовала команде на удаление, а затем выполнить её в терминале (пример):

Предположим вы хотите установить браузер Chromium.

sudo apt-get install chromium-browser

Данная команда устанавливает браузер, но затем вы решили удалить его, а команды на удаление рядом не оказалось. Что можно сделать в данном случае? Можно отредактировать команду непосредственно в терминале (об этом в другой статье), но это сложнее сделать для новичка в Linux, чем в текстовом редакторе. Откройте Gedit и скопируйте в него команду:


Выделите слово install (установить), как на снимке и в выделенном тексте напечатайте remove (удалить):


Теперь у вас получилась команда на удаление. Осталось скопировать её в терминал и выполнить удаление.
Проделайте установку приложения, редактирование команды и удаление прямо сейчас и вы поймёте насколько это просто.

3. Замена текста.

Редактирование текста может занять много времени. Для экономии времени, в Gedit есть функция Заменить, которая может находить и заменять часть текста.

Откройте инструмент Заменить, выбрав Поиск ->Заменить или нажмите Ctrl+H.
Введите текст, который нужно заменить, в поле Найти:.
Введите заменяющий текст в поле Заменить на:.
После ввода исходного и заменяющего текста, выберите нужные параметры замены:
Чтобы заменить только следующий соответствующий фрагмент текста, нажмите кнопку Заменить.
Чтобы заменить все совпадения искомого текста, нажмите кнопку Заменить все.

4. Поиск текста

Поиск может помочь найти конкретную последовательность текста внутри файла.

Более подробную информацию вы можете почитать в Справке - Текстовый редактор Gedit. Для её открытия достаточно открыть окно c Gedit и нажать клавишу F1:

Читайте также: