Tag Info

Hot answers tagged

469

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


91

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


44

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


40

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


31

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


28

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


22

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


19

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


18

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


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

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


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

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


15

setsid sh -c 'exec command <> /dev/tty2 >&0 2>&1' As long as nothing else is using the other TTY (/dev/tty2 in this example), this should work. This includes a getty process that may be waiting for someone to login; having more than one process reading its input from a TTY will lead to unexpected results. setsid takes care of starting ...


13

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


12

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

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

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

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

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


10

A tty is a regular terminal device (the console on your server, for example). A pts is a psuedo terminal slave (an xterm or an ssh connection). man pts has a verbose description of pseudo terminals.


10

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.


10

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


10

After a lot of reading, this is what I understood. Has ptmx any purpose besides allocating the slave part? Does it provide some kind of "intelligence", or the emulated terminal (xterm for instance) has all the intelligence of behaving like a terminal? /dev/ptmx doesn't allocate the slave part: it allocates the "pseudo terminal master part". /dev/ptmx ...


10

Check out tmux and/or screen. A comparison of the two programs which satisfy essentially the same needs can be found on the tmux FAQ. A very good blog post for getting started with tmux is at Hawk Host: TMUX the terminal multiplexer part 1 and part 2. If you want to know more about tmux's versatility, there's a nice book/e-book that covers a lot of ground ...


9

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


9

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


9

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


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

If UUCP is installed on the system, you may use the command cu, e.g. $ cu -l /dev/ttyS0 -s 9600



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