- Linux console
- Contents
- Implementation
- Virtual consoles
- Text mode
- Framebuffer console
- Keyboard shortcuts
- Fonts
- Preview and temporary changes
- Команда which в Linux [с примерами]
- Linux, Примеры команды which
- Использование команды which с несколькими исполняемыми файлами
- Показать все пути с командой which
- Статус вывода команды which
- Arch Linux Terminal Tutorial for Beginners
- Terminal Arch Linux Getting-Started Guide
- 1. Launching Terminal
- creio / Arch-Instruction.md
- Termite
- Contents
- Installation
- Usage
- Configuration
- Colors
- Reload configuration without exiting
- Transparency
- Troubleshooting
- Ctrl+Shift+t
- Remote SSH error
- Terminal issues with SSH
Linux console
The Linux console is a system console internal to the Linux kernel. The Linux console provides a way for the kernel and other processes to send text output to the user, and to receive text input from the user. The user typically enters text with a computer keyboard and reads the output text on a computer monitor. The Linux kernel supports virtual consoles — consoles that are logically separate, but which access the same physical keyboard and display.
This article describes the basics of the Linux console and how to configure the font display. Keyboard configuration is described in the /Keyboard configuration subpage.
Contents
Implementation
This article or section needs expansion.
The console, unlike most services that interact directly with users, is implemented in the kernel. This contrasts with terminal emulation software, such as Xterm, which is implemented in user space as a normal application. The console has always been part of released Linux kernels, but has undergone changes in its history, most notably the transition to using the framebuffer and support for Unicode.
Despite many improvements in the console, its full backward compatibility with legacy hardware means it is limited compared to a graphical terminal emulator.
Virtual consoles
The console is presented to the user as a series of virtual consoles. These give the impression that several independent terminals are running concurrently; each virtual console can be logged in with different users, run its own shell and have its own font settings. The virtual consoles each use a device /dev/ttyX , and you can switch between them by pressing Alt+Fx (where x is equal to the virtual console number, beginning with 1). The device /dev/console is automatically mapped to the active virtual console.
Text mode
This article or section needs expansion.
Since Linux originally began as a kernel for PC hardware, the console was developed using standard IBM CGA/EGA/VGA graphics, which all PCs supported at the time. The graphics operated in VGA text mode, which provides a simple 80×25 character display with 16 colours. This legacy mode is similar to the capabilities of dedicated text terminals, such as the DEC VT100 series. It is still possible to boot in text mode if the system hardware supports it, but almost all modern distributions (including Arch Linux) use the framebuffer console instead.
Framebuffer console
As Linux was ported to other non-PC architectures, a better solution was required, since other architectures do not use VGA-compatible graphics adapters, and may not support text modes at all. The framebuffer console was implemented to provide a standard console across all platforms, and so presents the same VGA-style interface regardless of the underlying graphics hardware. As such, the Linux console is not a terminal emulator, but a terminal in its own right. It uses the terminal type linux , and is largely compatible with VT100.
Keyboard shortcuts
Keyboard Shortcut | Description |
---|---|
Ctrl+Alt+Del | Reboots the system (specified by the symlink /usr/lib/systemd/system/ctrl-alt-del.target ) |
Alt+F1 , F2 , F3 , . | Switch to n-th virtual console |
Alt+ ← | Switch to previous virtual console |
Alt+ → | Switch to next virtual console |
Scroll Lock | When Scroll Lock is activated, input/output is locked |
Ctrl+c | Kills current task |
Ctrl+d | Inserts an EOF |
Ctrl+z | Pauses current Task |
Fonts
This article or section needs expansion.
By default, the virtual console uses the kernel built-in font with a CP437 character set, [1] but this can be easily changed.
The Linux console uses UTF-8 encoding by default, but because the standard VGA-compatible framebuffer is used, a console font is limited to either a standard 256, or 512 glyphs. If the font has more than 256 glyphs, the number of colours is reduced from 16 to 8. In order to assign correct symbol to be displayed to the given Unicode value, a special translation map, often called unimap, is needed. Nowadays most of the console fonts have the unimap built-in; historically, it had to be loaded separately.
The kbd package provides tools to change virtual console font and font mapping. Available fonts are saved in the /usr/share/kbd/consolefonts/ directory, those ending with .psfu or .psfu.gz have a Unicode translation map built-in.
Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of /usr/share/kbd/keymaps/ , see /Keyboard configuration for details.
Preview and temporary changes
shows a table of glyphs or letters of a font.
setfont temporarily change the font if passed a font name (in /usr/share/kbd/consolefonts/ ) such as
Font names are case-sensitive. With no parameter, setfont returns the console to the default font.
So to have a small 8×8 font, with that font installed like seen below, use e.g.:
To have a bigger font, the Terminus font ( terminus-font ) is available in many sizes, such as ter-132n which is large.
Источник
Команда which в Linux [с примерами]
Другими словами, если вам интересно, где именно находится определенная программа, просто используйте which. Команда Linux имеет простой синтаксис:
Давайте посмотрим, как использовать эту простую, но полезную команду.
Linux, Примеры команды which
Допустим, вы хотите знать, где находится исполняемый файл Java, используйте команду:
Вывод может быть таким:
$ which java
/usr/bin/java
Обратите внимание, что работает только с исполняемыми файлами. Таким образом, вы должны использовать which только с аргументом. Например, вы устанавливаете Java с помощью пакета JDK, но не запускаете команду с именем «jdk», вы запускаете «java». Таким образом, вы используете команду which на Java, а не JDK.
Если команда which не находит исполняемый файл в текущем пути, она ничего не возвращает.
Использование команды which с несколькими исполняемыми файлами
Вы можете предоставить более одного аргумента для команды which:
Вывод для нас был такой:
$ which man java python nada
/usr/bin/man
/usr/bin/java
/usr/bin/python
Вы заметили что-то здесь? Мы дали ему четыре аргумента, но результат отображается только для трех из них. Это потому, что «nada» не исполняемый файл. Там нет вывода для which.
Показать все пути с командой which
Команда which в Linux имеет только одну опцию -a. По умолчанию эта команда печатает только один путь для своих аргументов.
Если программа имеет исполняемый файл в двух местах, например, в /usr/bin/program и в /usr/local/bin/program, вы можете отобразить оба пути с помощью опции -a.
Статус вывода команды which
Если вы используете команду which в скрипте bash, вам может потребоваться узнать ее состояние завершения.
Команда which имеет следующий статус выхода:
- 0 – все аргументы найдены и выполняются
- 1 – один или несколько аргументов не существуют или не выполняются
- 2 – если указан неверный параметр
Это все, что вам нужно знать о команде which в Linux. Если у вас есть вопросы или предложения, дайте нам знать в комментариях ниже.
Если вы нашли ошибку, пожалуйста, выделите фрагмент текста и нажмите Ctrl+Enter.
Источник
Arch Linux Terminal Tutorial for Beginners
Terminal Arch Linux Getting-Started Guide
You are Welcome! The Tutorial Presents You a Step-by-Step Manjaro GNU/Linux Terminal Tutorial for Beginners.
And with this Arch Linux Command Line Tutorial for Beginners You Can Get Easily Initiated to Make the First, Steps on the Linux Shell 🙂
But this is Just a “Quick & Dirty” Introduction to the Command Line Basics by Example for the Bash Shell.
Now I strongly Recommend you to “Take it Easy” but to continue Experimenting with constancy, because as always is only the “Practice Makes the Master“! 😉
Most noteworthy: it’s fundamental you “Get Your Hands Dirty” following along this guide and Execute the Commands as they are harmless for your System.
Especially Relevant: at the same Time I should like you take some FUN by my creative writing to Uncover the Magical Powers of the Shell in making the “Arid Silicon Blossom Poetically“. :))
Finally, the Commands here included are valid for the Default Linux Bash Shell and also for the Bourne, C, TC and Korn Shells…
1. Launching Terminal
Open Terminal Window
(Press “Enter” to Execute Commands)
Most noteworthy: the Main Linux Shell Commands are simple Abbreviations of the Corresponding World.
Источник
creio / Arch-Instruction.md
Arch Linux ‒ это один из немногих дистрибутивов Linux, использующих модель роллинг-релизов. Это означает, что в нем доступны самые последние версии пакетов. Это одновременно является его как преимуществом так и недостатком. Пересесть на него меня заставила необходимость: мое компьютерное железо (процессор ryzen 5 2600 и видеоадаптер rx 590) оказались не совместимы с версией Linux Kernel младше 4.20.
На самом деле все не так плохо, но неприятные инциденты имеют место хотя и очень редко.
Качаем образ и записываем его с помощью команды:
Где sdX – имя нашего USB устройства. Перегружаемся после удачного завершения операции.
В Windows для создания загрузочной флешки можно использовать Rufus. При этом образ лучше записывать в dd режиме.
При загрузке системы нажимаем F2 или Del (зависит от производителя материнской платы). Во вкладке BIOS в приоритете загрузки делаем первым наше USB-устройство. Нажимаем F10 и сохраняем настройки.
При подключении от кабеля ничего настраивать не надо. Настройка wifi требует ввода пары команд:
Следует отметить, что не все usb wifi адаптеры гараниторованно поддерживаются. Например, у меня не захотел работать dexp wfa 301, а вот с tp-link все ок.
Для начала посмотрим все доступные устройства:
Создадим новый раздел:
В меню fdisk вводим n для создания нового раздела, порядковый номер раздела, потом начальное и конечные смещения. При задании конечного смещения можно отрицательное значение, например, -10G , так мы оставим свободными 10 Гб в конце диска. Для записи изменений на жесткий диск вводим w и выходим — q .
Теперь нужно разметить раздел по LVM. Касательно LVM: единственное удобство в нем для меня – это возможность динамически менять размер разделов. Самая частая проблема, которая у меня была раньше – это то, что я не угадывал размер для корня. Когда в нем кончалось место, я с установочной флешки через gparted пытался отщепнуть от виндового раздела кусок (а у меня разделы всегда шли так: recovery, efi, reserved, windows, root, home), из этого куска создавал временный раздел, копировал в него файлы с хомяка, удалял хомяка, изменял размер корневого, опять создавал хомяка и из временного раздела копировал в него файлы, потом удалял временный раздел, расширял виндовый, правил /etc/fstab … А с LVM я могу просто выполнить пару команд: ужать хомяка, расширить корневой, причем, на лету. Но эксперты могут возразить: «Хомяк на отдельном разделе не нужен!» — Да, если хочешь потерять все данные при переустановке.
Источник
Termite
Termite is a minimal VTE-based terminal emulator. It is a modal application, similar to Vim, with an insert mode and selection mode where keybindings have different functions.
The configuration file allows changing colors and setting options. Termite supports transparency along with both the 256 color and true color (16 million colors) palettes. It has a similar look and feel to urxvt.
Contents
Installation
Usage
Termite starts in insert mode by default. Text may be selected using the mouse, or by using selection-mode keys. In insert mode, Ctrl+Shift+c is used to copy selected text to the X clipboard, Ctrl+Shift+v to paste. Ctrl+Tab starts scrollback completion, and Ctrl+Shift+Up / Ctrl+Shift+Down scroll the screen up or down.
Ctrl+Shift+Space enters selection-mode, similar to vim’s normal-mode. Many commands are borrowed from Vim, for example v for visual mode, Shift+v for visual line mode, Ctrl+v for visual block mode, y to copy («yank») selected text, / and ? for searching, w , b , ^ , $ for movement, and Escape to go back to insert mode.
Configuration
Termite looks for configuration files in $XDG_CONFIG_HOME/termite/config ,
/.config/termite/config , $XDG_CONFIG_DIRS/termite/config and /etc/xdg/termite.cfg . The configuration file is used to change options such as font, colors, window hints, etc. The configuration file syntax is inspired by XDG Desktop Entry Specification .desktop files (inspired by Microsoft Windows .ini files), with three sections: options, colors, and hints.
To start customizing termite copy the base example file to your home dir first:
Fonts are specified in the format font= under the options section. is specified according to fontconfig, not Xft. Use fc-list to see which fonts are available on the system (see also Font configuration#Font paths).
Colors
Colors consist of either a 24-bit hex value (e.g. #4a32b1 ), or an rgba vector (e.g. rgba(16, 32, 64, 0.5) ). Valid properties for colors are foreground , foreground_bold , foreground_dim , background , cursor , cursor_foreground , and colorN (where N is an integer from zero through 254; used to assign a 24-bit color value to terminal colorN).
An amazing collection of termite color schemes can be found here: https://github.com/khamer/base16-termite/tree/master/themes
Reload configuration without exiting
You can reload Termite’s config file without exiting by pressing Ctrl+Shift+r from within Termite.
Alternatively, you can send a USR1 signal to all Termite instances:
Transparency
As of version 9, Termite supports true transparency via color definitions that specify an alpha channel value [2]. This requires a compositor to be running, such as picom or xcompmgr . Most compositors do not require special configuration for Termite to use transparency.
Troubleshooting
Ctrl+Shift+t
If opening a new tab through Ctrl+Shift+t fails with no directory uri set , source /etc/profile.d/vte.sh . See GNOME/Tips and tricks#New terminals adopt current directory.
If it continues to fail, ensure your hostname is valid. See hostname(7) .
Remote SSH error
When Termite is using remote SSH connection sometimes the error occurs: Error opening terminal: xterm-termite. or Open terminal failed: missing or unsuitable terminal: xterm-termite.
This error can occur when trying to edit file with vim or nano. To fix this issue you should execute this command on the remote system:
Alternatively, follow the instructions on Termite’s GitHub. This will allow you to use all of Termite’s features when using SSH, whereas the above may not. [3]
Terminal issues with SSH
When Termite is used for SSH connections to a remote system which does not have its Terminfo, various issues (such as non-working backspace and weird cursor behaviour) could happen. The solution is to send your Terminfo to the remote host.
Источник