Ubuntu users guide tricks and tips

Материал из NNLUG Wiki.

Перейти к: навигация, поиск

Содержание

Советы и хитрости

Как перезапустить GNOME без перезагрузки компьютера

  • Прочтите #Общие замечания
  • Сохраните данные и закройте все запущенные приложения.
Press 'Ctrl + Alt + Backspace'

или
sudo /etc/init.d/gdm restart

Как включать Num Lock при запуске GNOME?

sudo apt-get install numlockx
sudo cp /etc/X11/gdm/Init/Default /etc/X11/gdm/Init/Default_backup
sudo gedit /etc/X11/gdm/Init/Default
  • Найдите эту строку
...
exit 0
  • Перед ней добавьте следующие строки
if [ -x /usr/bin/numlockx ]; then
 /usr/bin/numlockx on
fi

Как запускать программы при запуске GNOME?

Startup Programs Tab -> Add/Edit/Delete

Как ускорить Убунту

Как переключиться в консольный режим из GNOME?

Нажмите 'Ctrl + Alt + F1' (F2 - F6)
  • Для переключения консолей в текстовом режиме
Нажмите 'Alt + F1' (F2 - F6)
  • Для переключения обратно в GNOME
Нажмите 'Alt + F7'

Как отключить возможность перезапуска X в GNOME с помощью Ctrl+Alt+Backspace?

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
sudo gedit /etc/X11/xorg.conf
  • В конец файла добавьте следующие строки
Section "ServerFlags"
	Option		"DontZap"		"yes"
EndSection

Как в GNOME по нажатию Ctrl+Alt+Del запускать System Monitor?

gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_9 "<Control><Alt>Delete"
gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_9 "gnome-system-monitor"

Как обновить рабочий стол GNOME?

killall nautilus

Как обновить панель GNOME?

killall gnome-panel

Как включить автосохронение в Gedit и отключить создание файлов вида some_file~

/ -> apps -> gedit-2 -> preferences -> editor -> save -> create_backup_copy (Снять отметку)
/ -> apps -> gedit-2 -> preferences -> editor -> save -> auto_save (Отметить)

Как в Nautilus показать все скрытые файлы/папки?

  • Прочтите #Общие замечания
  • Places -> Home Folder
  • Чтобы временно показать все скрытые файлы/папки
Нажмите 'Ctrl + H'
  • Чтобы скрытые файлы/папки показывались всё время
Edit Menu -> Preferences
Views Tab -> Default View -> Show hidden and backup files (Отметить)

Как в Nautilus просматривать файлы/папки с правами пользователя root?

sudo gedit /usr/share/applications/Nautilus-root.desktop
    • Вставьте следующие строки в новый файл
[Desktop Entry]
Name=File Browser (Root)
Comment=Browse the filesystem with the file manager
Exec=gksudo "nautilus --browser %U"
Icon=file-manager
Terminal=false
Type=Application
Categories=Application;System;
  • Для просмотра файлов/папок с правами пользователя root в Nautilus
    • Applications -> System Tools -> File Browser (Root)

Как включить отображение иконок на рабочем столе (Компьютер, Домашняя папка, Корзина)

Не для Dapper'a---firingstone

/ -> apps -> nautilus -> desktop ->
computer_icon_visible (Отметить)
home_icon_visible (Отметить)
trash_icon_visible (Отметить)

Как изменить программу, с помощью которой по умолчанию открываются файлы определенного типа?

Кликните правой кнопкой мыши на файле -> Properties
Open With Tab -> Add
Select "Open with" program
Select "Open with" program (Отметить)

Как изменить почтовое приложение, используемое по умолчанию, на Mozilla Thunderbird?

Mail Reader Tab -> Default Mail Reader -> Command: mozilla-thunderbird %s

Как открыть файлы с правами пользователя root с помощью правой кнопки мыши?

gedit $HOME/.gnome2/nautilus-scripts/Open\ as\ root
  • Вставьте следующие строки в новый файл
for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
 gksudo "gnome-open $uri" &
done
  • Сохраните файл
chmod +x $HOME/.gnome2/nautilus-scripts/Open\ as\ root

Кликните правой кнопкой мыши на файле -> Scripts -> Open as root

Как запретить звук в терминальном режиме?

Не для Dapper'a ---- firingstone

Edit Menu -> Current Profile...
General Tab -> General -> Terminal bell (Не отмечено)

Как ускорить загрузку веб-страниц в Mozilla Firefox?

Address Bar -> about:config
Filter: ->
network.dns.disableIPv6 -> true
network.http.pipelining -> true
network.http.pipelining.maxrequests -> 8
network.http.proxy.pipelining -> true
  • Перезапустите Mozilla Firefox

Как отключить звук при быстром поиске ссылок на веб-страницах в Mozilla Firefox?

Address Bar -> about:config
Filter: -> accessibility.typeaheadfind.enablesound -> false
  • Перезапустите Mozilla Firefox

Более простая замена apt-get (Synaptic)

  • Прочтите #Общие замечания
  • System -> Administration -> Synaptic Package Manager
  • Чтобы подключить репозитарии Universe и Multiverse
    1. Settings -> Репозитарии
    1. В закладке Installation Media, нажимаем Add. Тут три разных репозитария; Dapper Drake, Security Updates and Updates. Выбираем каждый репозитарий и отмечаем Officially supported, Restricted copyright, Community maintained (Universe) and Non-free (Multiverse). Убедитесь что вы нажали OK для каждого репозитария, чтобы сохранить изменения
    2. Теперь вы должны видеть эти репозитарии под Channels.
  • Чтобы добавить Backports и PLF (новые версии многий приложений. Нет поддержки. Могут содержать запрещеные пакеты. Используйте на собственный риск.)
    1. Settings -> Repositories
    2. Нажмите Add, потом Custom
    3. Вставте следующие 4 строки в окно и нажмите Add Repository, для каждой линии:
deb http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse
deb http://packages.freecontrib.org/ubuntu/plf dapper free non-free
deb-src http://packages.freecontrib.org/ubuntu/plf dapper free non-free 
  • Обновить список пакетов (аналогично apt-get update)
Edit Menu -> Reload Package Information
  • Установить все обновления ( apt-get upgrade)
Edit Menu -> Mark All Upgrades... -> Default Upgrade
Edit Menu -> Apply Marked Changes
  • Поиск пакета ( apt-cache search package_name)
Edit Menu -> Search... Ввести имя пакета
  • Установить выбранный пакет (аналогично apt-get install package_name)
Select "package_name"
Package Menu -> Mark for Installation
Edit Menu -> Apply Marked Changes
  • Удалить выбранный пакет(аналогично apt-get remove package_name)
Select "package_name"
Package Menu -> Mark for Removal
Edit Menu -> Apply Marked Changes

What packages do the extra repositories provide

  • The PLF repository provides
    1. DVD playback support (libdvdcss2)
    2. Skype
    3. Sun Java SDK (Software Development Kit) and JRE (Java Runtime Environment)
    4. Opera Web browser
    5. RealPlayer 10
    6. Win32 binary multimedia codecs

Как установить/удалить файлы .deb

sudo dpkg -i package_file.deb
  • Чтобы удалить файл .deb:
sudo dpkg -r package_name

Как сконвертировать файлы .rpm в .deb

sudo alien package_file.rpm

Как переименовать все файлы в каталоге за один раз

wget -c http://easylinux.info/uploads/mvb_1.6.tgz
sudo tar zxvf mvb_1.6.tgz -C /usr/share/
sudo chown -R root:root /usr/share/mvb_1.6/
sudo ln -fs /usr/share/mvb_1.6/mvb /usr/bin/mvb

  • Для изменения имен всех файлов в каталоге за раз
mvb NEW_NAME

How to manipulate all image files in directory at once

sudo apt-get install imagemagick
wget -c http://easylinux.info/uploads/bbips.0.3.2.sh
sudo cp bbips.0.3.2.sh /usr/bin/bbips
sudo chmod 755 /usr/bin/bbips
  • To manipulate all image files in directory at once
bbips

How to set System-wide Environment Variables

sudo cp /etc/bash.bashrc /etc/bash.bashrc_backup
sudo gedit /etc/bash.bashrc
  • Append the System-wide Environment Variables at the end of file
  • Save the edited file

Как сохранять вывод команды “man” в файлы

man command | col -b > file.txt

How to hide GRUB menu on boot-up

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
sudo gedit /boot/grub/menu.lst

  • Find this line
...
#hiddenmenu
...
  • Replace with the following line
hiddenmenu
  • Save the edited file

How to change the timeout seconds for GRUB menu on boot-up

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
sudo gedit /boot/grub/menu.lst
  • Find this line
...
timeout     3
...
  • Replace with the following line
timeout     X_seconds
  • Save the edited file

How to change default Operating System boot-up for GRUB menu

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
sudo gedit /boot/grub/menu.lst
  • Find this line
...
default     0
...
  • Replace with the following line
default     X_sequence
  • Save the edited file

How to display Splash Image for GRUB menu on boot-up

e.g. Assumed that hd0,1 is the location of Ubuntu boot partition
wget -c http://easylinux.info/uploads/ubuntu.xpm.gz
chmod 644 ubuntu.xpm.gz
sudo mkdir /boot/grub/images
sudo cp ubuntu.xpm.gz /boot/grub/images/
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
sudo gedit /boot/grub/menu.lst
  • Find this section
# menu.lst - See: grub(8), info grub, update-grub(8)
#      grub-install(8), grub-floppy(8),
#      grub-md5-crypt, /usr/share/doc/grub
#      and /usr/share/doc/grub-doc/.
...
  • Add the following line below it
splashimage (hd0,1)/boot/grub/images/ubuntu.xpm.gz
  • Save the edited file

How to convert Wallpaper to Splash Image for GRUB menu

e.g. Assumed that wallpaper.png is the Wallpaper to be converted to Splash Image
splashimage.xpm.gz is the Splash Image for GRUB menu
convert -resize 640x480 -colors 14 wallpaper.png splashimage.xpm && gzip splashimage.xpm

How to temporary skip boot-up services

Press 'Ctrl + C'

How to permanently disable/enable boot-up services

How to clean /tmp/ folder contents on shutdown

sudo cp /etc/init.d/sysklogd /etc/init.d/sysklogd_backup
sudo gedit /etc/init.d/sysklogd
  • Find this section
...
 stop)
  log_begin_msg "Stopping system log daemon..."
  start-stop-daemon --stop --quiet --oknodo --exec $binpath --pidfile $pidfile
  log_end_msg $?
...
  • Add the following line below it
  rm -fr /tmp/* /tmp/.??*
  • Save the edited file

How to scroll up and down to view previous outputs in Console mode

Press 'Shift + Page Up'
  • To scroll down to view previously outputs
Press 'Shift + Page Down'

Как узнать, какая версия Ubuntu используется

cat /etc/issue

How to set up automatic background change (GNOME)

mkdir ~/.backgrounds
cd ~/.backgrounds
wget -c http://easylinux.info/uploads/change_background.py
chmod +x change_background.py
  • To change desktop background every time you reboot your computer
export EDITOR=gedit && crontab -e
  • Add the following line at the end of file
@reboot ~/.backgrounds/change_background.py
For more information about periodic processes see
man 5 crontab

How to set up automatic background change (KDE)

  • Go to K-menu -> System Settings -> Desktop -> Background
  • Choose Slide Show
  • Press Setup...
  • Press Add... to add pictures you wish to see as desktop background
  • Set 'Change picture after' to desired picture rotation interval.
  • Press 'OK'

How to add keyboard layouts for other languages

  • Go to System -> Preferences -> Keyboard
  • Choose Layouts
  • Press Add... to add the secondary keyboard layout. It is simpler to have two layouts; the maximum is currently four for Xorg.
  • Choose Layout Options
  • Expand option Group Shift/Lock behaviour
  • Choose the key combination that enables you to switch between keyboard layouts. The default is by pressing both Alt keys at the same time. A common alternative is to use Alt+Shift.
  • Press Close.

See #How to add the Keyboard (Layout) Indicator applet to add the Keyboard Indicator applet.

How to add the Keyboard (Layout) Indicator applet

  • Right-click on empty space on the top panel so that you see the pop-up menu.
  • Click Add to Panel...
  • Choose Keyboard Indicator (it is under the Utilities section, at the end)

The Keyboard Indicator applet appears on the panel. The default language should be USA for U.S. English. You can either right-click on this applet for more options or see above on how to configure.

How to type extended characters

  • Add the keyboard layout US English International (with dead keys)
  • Make US English International (with dead keys) the default keyboard layout.

The key marked ['"] is now a dead key. When you press it, nothing happens. However if you press a consonant immediately afterwards, the consonant appears with an accent.

  • ' + a = á
  • ' + e = é
  • and so on for i-í, o-ó, y-ý, c-ć, z-ź, n-ń, l-ĺ, u-ú, r-ŕ
  • " + a = ä
  • " + e = ë
  • and so on for y-ÿ, u-ü, i-ï, o-ö

Similarly, ` and a consonant generates à, è, ù, ì, ò. Similarly, ~ and a consonant generates ã, ũ, ĩ, õ, ñ.

To type ' and ", press RightAlt+' and RightAlt+" respectively. To type ' and ", you may also press '+<space> and "+<space> respectively.

There are more characters available by keeping RightAlt pressed and typing a character. Therefore,

  • RightAlt+q = ä
  • RightAlt+w = å
  • RightAlt+e = é
  • RightAlt+r = ®
  • RightAlt+t = þ
  • RightAlt+y = ü
  • RightAlt+u = ú
  • RightAlt+i = í
  • RightAlt+o = ó
  • RightAlt+p = ö
  • RightAlt+[ and ] for « and » respectively.
  • RightAlt+a = á
  • RightAlt+s = ß
  • RightAlt+d = ð
  • RightAlt+l = ø
  • RightAlt+; = ¶
  • RightAlt+: = °
  • RightAlt+z = æ
  • RightAlt+c = ©
  • RightAlt+n = ñ
  • RightAlt+m = µ
  • RightAlt+, = ç
  • RightAlt+/ = ¿
  • RightAlt+1 = ¡
  • RightAlt+2 = ²
  • RightAlt+3 = ³
  • RightAlt+4 = ¤
  • RightAlt+5 = €
  • RightAlt+6 = ¼
  • RightAlt+7 = ½
  • RightAlt+8 = ¾
  • RightAlt+9 = ‘
  • RightAlt+0 = ’
  • RightAlt+- = ¥
  • RightAlt+= = ×
  • RightAlt+! = ¹
  • RightAlt+@, then o = ő (and Ő).
  • RightAlt+#, then a = ā (and Ā). Similarly for ēĒ, ūŪ, īĪ, ōŌ.
  • RightAlt+$ = £
  • RightAlt+% =
  • RightAlt+^ =
  • RightAlt+& =
  • RightAlt+*, then a = ą (and Ą). Similarly for ęĘ, įĮ.
  • RightAlt+(, then a = ă (and Ă)
  • RightAlt+(, then g = ğ (and Ğ)
  • RightAlt+), then a = å (and Å)
  • RightAlt+_ =
  • RightAlt++ = ÷

How to set the Compose key to type special characters

  • Click System, Preferences, Keyboard.
  • Under Layout Options, expand on Compose key position.
  • Choose Right-Win key is compose, click Close.

Now you can type extended characters using the RightWin key (next to AltGr), according to this keyboard settings file. Specifically, the lines that start with GDK_Multi_key are those that we can use here. The Compose key is actually GDK_Multi_key.

Some examples,

  • RightWin + C + = produces €
  • RightWin + = + C produces €
  • RightWin + C + O produces ©
  • RightWin + O + C produces ©
  • RightWin + a + ' produces á
  • RightWin + a + " produces ä
  • RightWin + a + ` produces à
  • RightWin + a + ~ produces ã
  • RightWin + a + * produces å
  • RightWin + a + ^ produces â
  • RightWin + a + > produces â
  • RightWin + a + , produces ą
  • RightWin + e + - produces ē
  • RightWin + S + 1 produces ¹
  • RightWin + S + 2 produces ²
  • RightWin + S + 3 produces ³
Личные инструменты