Tag Info

Hot answers tagged

362

A terminal is at the end of an electric wire, a shell is the home of a turtle, tty is a strange abbreviation and a console is a kind of cabinet. Well, etymologically speaking, anyway. In unix terminology, the short answer is that terminal = tty = text input/output environment console = physical terminal shell = command line interpreter Console, ...


73

A terminal or a console is a piece of hardware, using which a user can interact with a host. Basically a keyboard coupled with a text screen. Nowadays nearly all terminals and consoles represent "virtual" ones. The file that represents a terminal is, traditionally, called a tty file. If you look under the "/dev" directory of a UNIX system, you'll find a lot ...


43

When a GUI terminal emulator prints out a string, it has to convert the string to font codepoints, send the codepoints to a font renderer, get back a bitmap and blit that bitmap to the display via the X server. The font renderer has to retrieve the glyphs and run them (did you know that Truetype/Opentype fonts are programs running inside a virtual machine ...


32

From the documentation: /dev/tty Current TTY device /dev/console System console /dev/tty0 Current virtual console In the good old days /dev/console was System Administrator console. And TTYs were users' serial devices attached to a server. Now /dev/console and /dev/tty0 represent current display and usually are the same. You can override ...


29

It is the kernel. Keep in mind the keyboard is hardware and everything that happens there passes through the kernel; in the case of VT switching, it handles the event completely itself and does not pass anything on to userspace (however, I believe there is an ioctl related means by which userspace programs can be notified of a switch occurring involving ...


25

/dev/console is a virtual set of devices which can be set as a parameter at boot time. It might be redirected to a serial device or a virtual console and by default points to /dev/tty0. When multiple console= options are passed to the kernel, the console output will go to more than one device. /dev/tty0 is the current virtual console /dev/tty[1-x] is one of ...


16

The ls program uses isatty() to know whether fd 1 is a tty or something else (pipe, file, etc…). From man 3 isatty: int isatty(int fd); DESCRIPTION The isatty() function tests whether fd is an open file descriptor referring to a terminal Updade: Line 1538 in ls.c from coreutils (git revision 43a987e1): if (isatty ...


16

A tty is a native terminal device, the backend is either hardware or kernel emulated. A pty (pseudo terminal device) is a terminal device which is emulated by an other program (example: xterm, screen, or ssh are such programs). A pts is the slave part of a pty. (More info can be found in man pty.) Short résumé: A pty is created by a process through ...


15

There is a standard control sequence to turn off cursor blinking on terminals. printf '\033[?12l' However many terminals do not implement this setting, so read on. There is a more widely implemented standard terminal setting for switching cursor visibility between high visibility, normal visibility and invisibility. Some terminals don't make a difference ...


15

I find screen the most useful program for serial communication since I use it for other things anyway. It's usually just screen /dev/ttyS0 <speed>, although the default settings may be different for your device. It also allows you to pipe anything into the session by entering command mode and doing exec !! <run some program that generates ...


13

Originally you had just dumb terminals - at first actually teletypewriters (similar to an electric typewriter, but with a roll of paper), but later screen+keyboard-combos - which just sent a key-code to the computer and the computer sent back a command that wrote the letter on the terminal (ie. the terminal was without local echo, the computer had to order ...


12

Background The main reason why you need any program like minicom to communicate over a serial port is that the port needs to be set up prior to initiating a connection. If it weren't set up appropriately, the cat and echo would not for you as expected. Notice that once you run a program like minicom, the port is left with a a set of settings that minicom ...


11

This gives you a solid yellow block (nonblinking) as a cursor: echo -n -e '\e[?17;14;224c' For more info check these references: Linuxgazette and EmacsWiki as well as the file /usr/src/linux/Documentation/VGA-softcursor.txt (if present on your system)


10

It's not clear exactly what you want. If you want to use your existing Ethernet port, that won't be an option for many reasons; the most fundamental being that Ethernet requires precise termination and voltage levels, the hardware on the interface (the PHY) is made to deal with that. Ethernet uses strictly +/- 0.85V and 50ohm termination impedance; RS-232 ...


10

Ctrl-Z does in fact stop the current foreground program, but it has nothing to do with the terminal emulator. It is handled by the shell you are currently running. The original shells for Unix didn't have this feature, so you might find that you are missing it on some systems, say a minimal embedded version of Linux booted into single user mode. Ctrl-S ...


10

The purpose of watch is to show the results of a command full-screen and update continuously; if you're redirecting the output into a file and backgrounding it there's really no reason to use watch in the first place. If you want to just run a command over and over again with a delay (watch waits two seconds by default), you can use something like this: ...


10

When you “open a terminal”, you're starting a terminal emulator program, such as xterm, gnome-terminal, lxterm, konsole, … One of the first things the terminal emulator does is to allocate a pseudo terminal (often called a pseudo-tty, or pty for short). The pty is a pair of character device files: the pty master, which is the side that the terminal emulator ...


9

Meanwhile @Alexios have pretty well described all the reasons, I can mention several things, which relatively relieve the pain: use bitmap fonts (Terminal, Terminus — this is really great one), turn anti-aliasing off, or consider at least not using sub-pixel rendering, use KDE's terminal — konsole.


9

On some systems it is Alt+F8 or Alt+F9, on others it is Alt+F7. The Ctrl is not needed to come back from the tty, only to drop to it. The actual F key depends on which tty your X session is running in. As far as I know, the default value is 8 (or 7) so Alt+F8 should do it. If not, just try the other values until you hit the right one. As @mantawork points ...


8

My background is RHEL-derived distributions (mainly Fedora, today), Arch is foreign to me. Back when /etc/inittab and mgetty where used by RHEL, you could edit /etc/inittab and pass the -p option to mgetty. This would set the prompt. Now with the adoption of systemd /etc/inittab is empty. The tty configuration file is now ...


8

If your shell is bash, add clear_console or reset to ~/.bash_logout. If your shell is zsh, add that command to ~/.zlogout. You might want to run this only when the shell is a login shell on a Linux console, e.g. if [[ "`tty`" = /dev/tty[1-9] && $(ps -o comm= -p $PPID) = login ]]; then clear_console fi As the system administrator, you can ...


8

Take a look at minimodem. minimodem - software audio Bell-type or RTTY FSK modem Copyright (C) 2011 Kamal Mostafa <kamal@whence.com> Minimodem is a command-line program which generates (or decodes) audio modem tones at any specified baud rate, emulating an old Bell-type or radio-teletype FSK modem. The tones can be played to (or recorded from) the ...


8

Are you sure the data isn't corrupted by your terminal (or wherever cat is displaying)? cat is unlikely to corrupt your data. Try using od (octal dump) to dump the data coming from the serial port, so you can see exactly what is coming across (without relying on it being printable). Use od -c if you're expecting ASCII data. If you're still seeing ...


8

When w's output goes to a terminal. w queries the terminal driver for the number of columns and adjusts the width accordingly. When output doesn't go to a terminal such as when it goes to a pipe, it reverts to a fixed width of 80 columns. Versions of procps since 3.3.2 allow to override that default with the $COLUMNS environment variable. Some shells like ...


8

The master side replaces the line (the pair of TX/RX wires) that goes to the terminal. The terminal displays the characters that it receives on one of the wires (some of those are control characters and make it do things like move the cursor, change colour...) and sends on another wire the characters corresponding to the keys you type. Terminal emulators ...


7

SHORT explanation: The console is a terminal - i.e a system has got one console and potentially multiple terminals. The console is typically the primary interface for managing a computer, eg while it is still booting up. A terminal is a session which can receive and send input and output for command-line programs. The console is a special case of these. ...


7

(1) gives you an emulation of the terminal. Programs such as Gnome Terminal an Konsole are called "terminal emulator". (2) gives you a real terminal. Alright, it's still an emulation of a terminal, but it's "more real" than (1), because the emulation is done by the kernel itself. (3) is actually the same as (2). When you don't have X you will see tty0, ...


7

There is a very limited security advantage in having requiretty on a server. If some non-root code is exploited (a PHP script, for example), the requiretty option means that the exploit code won't be able to directly upgrade its privileges by running sudo. There may be another way for the attacker to gain root, and of course the attacker will still be able ...


7

When you press a key or key combination in a terminal, it is transmitted to the application running in the terminal as a sequence of one or more characters. For example, when you press a, the application receives a. When you press Enter, the application receives the character CR (a.k.a. ^M (pronounced “control-emm”), a.k.a. character number 13, a.k.a. \r or ...


7

Bash seems to send the SIGHUP only if it self received a SIGHUP, which for example occurs when a virtual terminal is closed or when the SSH connection is interrupted. From the documentation: The shell exits by default upon receipt of a SIGHUP. Before exiting, an interactive shell resends the SIGHUP to all jobs, running or stopped. Stopped jobs are ...



Only top voted, non community-wiki answers of a minimum length are eligible