recentpopularlog in

dusko : commandline   488

« earlier  
Almquist shell - Wikipedia
Almquist shell (also known as A Shell, ash and sh) is a lightweight Unix shell originally written by Kenneth Almquist in the late 1980s. Initially a clone of the System V.4 variant of the Bourne shell, it replaced the original Bourne shell in the BSD versions of Unix released in the early 1990s.

Derivative versions of ash are installed as the default shell (/bin/sh) on FreeBSD, NetBSD, DragonFly BSD, MINIX, and in some Linux distributions. MINIX 3.2 used the original ash version, whose test feature differed from POSIX. That version of the shell was replaced in MINUX 3.3. Android used ash until Android 4.0, at which point it switched to mksh.
sh  shell  commandline  cli  unix  netbsd  dragonflybsd  freebsd  bsd 
4 days ago by dusko
Notes about the control codes present in VT220, VT240, VT3x0, VT420, and later DEC terminals
Notes about the control codes present in VT220, VT240, VT3x0, VT420, and later
DEC terminals. These models all implement supersets of the VT100's features.


By special request, here are the controls for
"Visual Character and Line Attributes" in DEC terminals.

The sequence CSI Ps;Ps;Ps m (or 7-bit ESC [ Ps;Ps;Ps m)
allow visual attributes to be set for some characters.
The VT100 and/or VT102 could perform only a few attributes;
models beginning with the VT300 series could do more.

The values of "Ps" follow:

Ps Attribute Mode
---- ------------------ ------
0 all attributes off all
1 bold all
4 underline all
5 blinking all
7 negative image all
8 invisible VT300+
22 bold off VT300+
24 underline off VT300+
25 blinking off VT300+
27 negative image off VT300+
28 invisible off VT300+

Line attributes were set as follows:

Sequence Attribute Mnemonic Special
-------- --------------------------------- -------- ------------
ESC # 5 single-width, single-height line DECSWL
ESC # 6 double-width, single-height line DECDWL

ESC # 3 double-width, double-height line DECDHL (top half)
ESC # 4 double-width, double-height line DECDHL (bottom half)

Please observe that the VT320 is *not* a color terminal. It has only
a monochrome screen. The VT340 is a color terminal, but does not obey
the ISO-6249/ECMA-48 color controls (it can do ReGIS graphics colors,
as can the VT241).

As far as I know, the only DEC terminal to implement and actually be
able to display ISO-6249/ECMA-48 color controls is the VT525 (which
was actually made for DEC by Boundless).

Of course, many contemporary "VT320-emulator" software products do
implement ISO-6249/ECMA-48 color, as an enhancement. (This has led
to incorrect folklore that a real VT320 was a color terminal.)

These color controls are the 30-37 foreground, 40-47 background
arguments to the SGR control sequence.



Newsgroups: comp.terminals
Message-ID: <>
Lines: 57
Organization: University of Bradford, UK
References: <2pqn0d$>
Date: Tue, 3 May 1994 08:38:27 GMT
Subject: Re: Unknown VT220 Escape Sequences

Thomas Gellekum ( wrote:
: Moin moin,

: The TPU-editor on VMS uses some escape sequences for VT220 that aren't
: explained in the programmers manual. They tend to garble output in my
: VT220 Emulator here. Does anyone know what they are supposed to do?

: CSI 1;2'z
: CSI 0'z

DECELR - DEC Enable Locator Reports

CSI Ps ; Pu ' z

0 locator disabled (default)
1 locator reports enabled
2 one shot

Pu --- specifies coordinate units
0 default to character cells
1 device physical pixels
2 character cells

: CSI 1;3'{

DECSLE - Select Locator Events

CSI P...P ' {

P...P one or more selective parameters:

0 Respond only to explicit host requests
1 Report button down transitions
2 Do not report button down transitions
3 Report button up transitions
4 Do not report button up transitions

: Is there an authoritative list of possible responses to a primary DA
: request? The manual gives just examples, not a complete list.

: Please reply by e-mail, I don't normally read this group. I'll post a
: summary if there's interest.

Opps, reply for news, so you better read this :-)


: Thomas Gellekum,


There are two distinct ways to issue a reset command to a VT220 terminal.

Mnemonic Command Sequence Explanation
-------- ------------------- ------------------ -----------------------------

DECSTR Soft terminal reset Escape [ ! p sets terminal to power-up
default states

RIS Hard terminal reset Escape c replaces all terminal set-up
parameters with NVR values or
power-up default values if
NVR values do not exist.

("VT220 Programmer Pocket Guide" EK-VT220-HR-001, page 33)

terminal  console  commandline  cli  shell  unix  vt100  reference 
4 days ago by dusko
This document was originally written for real text terminals which were like monitors (with keyboards), but could only display text with a command line interface (no pictures). They were widely used to access mainframe computers in the late 1970's and 1980's but use of them declined in the 1990's and they are seldom used anymore. However much of this howto also applies to command-line interfaces on Linux PC's which are in wide use today. It's not about the user programs one might run on the command line, but about setting up, managing, and understanding the interface itself Such as using a monitor as a virtual (text-only) console, using a text-window in a GUI such as xterm, connecting to a remote computer over a network via ssh, telnet, etc., or even using software on another PC to turn it into a serial-port text-terminal. All these 4 methods are known as "text-terminal emulation". But unfortunately, the main emphasis in this howto is real text terminals and the coverage of emulation is inadequate for the first 3 methods of emulation mentioned above. The Keyboard-and-Console-HOWTO filled much this gap but it was written for Linux 2.0 and now needs rewriting (or merging into this Text-Terminal howto). A new author is needed that has time to do all this. For the seldom used real text-terminals, it explains how they work, explains how to install and configure them, and provides some info on how to repair them. This HOWTO also provides a brief overview of modern GUI terminals.
console  terminal  commandline  cli  howto  xterm  unix 
8 days ago by dusko
Further Reading - Blessed 1.15.1 documentation
These are often written in the C language, and directly map the “Control Sequence Inducers” (CSI, literally \x1b[ for most modern terminal types) emitted by most terminal capabilities to an action in a series of case switch statements.
terminal  xterm  commandline  cli  shell  console  unix  c  programming 
9 days ago by dusko
command line - What protocol/standard is used by terminals? - Unix & Linux Stack Exchange
Properly-written Unix programs don't emit these escape sequences directly. Instead, they use one of the libraries mentioned above, telling it to "move the cursor to position (1,1)" or whatever, and the **library** emits the necessary terminal control codes based on your TERM environment variable setting. This allows the program to work properly no matter what terminal type you run it on.
xterm  terminal  commandline  cli  shell  console  x11  xorg  unix  utf8  unicode  ansi  ascii 
10 days ago by dusko
The TTY demystified
Occasionally, you may come across a UNIX system where the backspace key doesn't work. This happens when the terminal emulator transmits a backspace code (either ASCII 8 or ASCII 127) which doesn't match the erase setting in the TTY device. To remedy the problem, one usually types stty erase ^H (for ASCII 8) or stty erase ^? (for ASCII 127). But please remember that many terminal applications use readline, which puts the line discipline in raw mode. Those applications aren't affected.
terminal  unix  commandline  cli  console  computing  it  history  sysadmin  x11  xorg  xterm 
11 days ago by dusko
Things Every Hacker Once Knew | Lobsters
feoh (Jan 27, 2017)

Now this article I can get behind! While I often find Mr. Raymond’s opinion pieces objectionable and occasionally out and out wrong, but in my view his work really shines when he strives to educate, and this article is a great example.

I wish there were a bit more depth on UUCP, but overall - great article. Thanks for posting it.

. . .

Dutch feoh (Jan 27, 2017)

My sentiments exactly. I stopped visiting his sites a few years ago; the signal to bombast ratio was just too low for me. If it weren’t for postings on aggregators, I’d miss great articles like this.

. . .

Screwtape (Jan 27, 2017)

A TTY-related fact that wasn’t mentioned in the article:

To control text-formatting on an ANSI-compatible terminal (or emulator), you can send it terminal control sequences like \e[1m to enable bold or whatever. Paper-based terminals didn’t have control-sequences like that, but people still figured out ways to do formatting. For example, if you printed a letter, then sent backspace (Ctrl-H, octet 0x08) and printed the same letter again, it would be printed with twice as much ink, making it look “bold”. If you printed a letter, then sent backspace and an underscore, it would look underlined.

The original Unix typesetting software took full advantage of this trick. If you told it to output a document (say, a manpage) to your terminal (as opposed to the expensive typesetting machine in the corner), it would use the BS trick to approximate the intended formatting.

This worked great, up until the invention of video display terminals, where the backspace trick just replaced the original text, instead of adding to it. So people wrote software to translate the backspace-trick into ANSI control codes... software like less(1).
unix  terminal  shell  console  commandline  cli  ascii  ansi  it  computing  history  reference  rs232serialport 
12 days ago by dusko
Things Every Hacker Once Knew | Hacker News
bogomipz on Jan 27, 2017 [-]
>"It becomes immediately obvious why, eg, ^[ becomes escape. Or that the alphabet is just 40h + the ordinal position of the letter (or 60h for lower-case). Or that we shift between upper & lower-case with a single bit."

I am not following, can you explain why ^[ becomes escape. Or that the alphabet is just 40h + the ordinal position? Can you elaborate? I feel like I am missing the elegance you are pointing out.

soneil on Jan 27, 2017 [-]
If you look at each byte as being 2 bits of 'group' and 5 bits of 'character';

00 11011 is Escape
10 11011 is [

So when we do ctrl+[ for escape (eg, in old ansi 'escape sequences', or in more recent discussions about the vim escape key on the 'touchbar' macbooks) - you're asking for the character 11011 ([) out of the control (00) set.

Any time you see \n represented as ^M, it's the same thing - 01101 (M) in the control (00) set is Carriage Return.

Likewise, when you realise that the relationship between upper-case and lower-case is just the same character from sets 10 & 11, it becomes obvious that you can, eg, translate upper case to lower case by just doing a bitwise or against 64 (0100000).

And 40h & 60h .. having a nice round number for the offset mostly just means you can 'read' ascii from binary by only paying attention to the last 5 bits. A is 1 (00001), Z is 26 (11010), leaving us something we can more comfortably manipulate in our heads.

I won't claim any of this is useful. But in the context of understanding why the ascii table looks the way it does, I do find four sets of 32 makes it much simpler in my head. I find it much easier to remember that A=65 (41h) and a=97 (61h) when I'm simply visualizing that A is the 1st character of the uppercase(40h) or lowercase(60h) set.
unix  terminal  shell  console  commandline  cli  ascii  ansi  it  computing  history 
12 days ago by dusko
bash - How to display control characters (^C, ^D, ^[, ...) differently in the shell - Unix & Linux Stack Exchange
When you type control characters in the shell they get displayed using what is called ** "caret notation" **.

Escape for example gets written as ^[ in caret notation.

When you press Ctrl+X, your terminal emulator writes the byte 0x18 to the master side of the pseudo-terminal pair.

What happens next depends on how the tty line discipline (a software module in the kernel that sits in between the master side (under control of the emulator) and the slave side (which applications running in the terminal interact with)) is configured.

A command to configure that tty line discipline is the stty command.

When running a dumb application like cat that is not aware of and doesn't care whether its stdin is a terminal or not, the terminal is in a default canonical mode where the tty line discipline implements a crude line editor.

Some interactive applications that need more than that crude line editor typically change those settings on start-up and restore them on leaving. Modern shells, at their prompt are examples of such applications. They implement their own more advanced line editor.
terminal  xterm  shell  x11  xorg  console  commandline  cli  unix 
13 days ago by dusko
Back to the Future: Using a DEC VT220 from 1983 |
Where is the freakin‘ Esc key!?

That is the one thing that buggs me: As vi user, I heavily depend on the ESC key, but the VT220 doesn’t have one. In VT100 mode, using F11 is quite simple, but you’ll miss out on the enhancements made in the VT220. CTRL-3 is the only way to generate a raw ESC character there. As many other people have done before me, I remapped ESC to jj ( or TAB in vim.
vt100  vi  terminal  console  shell  commandline  cli  xterm  x11  xorg  computing  it  history  unix  vim  traditionalvi 
13 days ago by dusko
How to make Less indicate location in percentage - Stack Overflow
man -P 'less -s -M +Gg' man

This can be effected permanently by putting

export MANPAGER='less -s -M +Gg'

in one of your shell configuration files (above syntax is for Bash and ZSH). Now, for example, man man displays the percentage as you wanted!

You should not put the +Gg in the LESS variable! For example, doing

export LESS='-M +Gg'

will cause problems when reading very large files. For example,

yes | LESS='-M +Gg' less

does not work very well.
unix  commandline  cli  terminal  shell  reference  tips 
21 days ago by dusko
ANSI Escape Codes
ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

Ctrl-Key: ^[
Octal: \033
Unicode: \u001b
Hexadecimal: \x1b
Decimal: 27

Followed by the command, usually delimited by opening square bracket ([) and optionally followed by arguments and the command itself.

Arguments are delimeted by semi colon (;).
ansi  ascii  commandline  cli  shell  terminal  xterm  x11  xorg  reference 
21 days ago by dusko
How to clear the screen after exit vim - Stack Overflow
(From comp.editors, by Juergen Weigert, in reply to a question)

:> Another question is that after exiting vim, the screen is left as it :> was, i.e. the contents of the file I was viewing (editing) was left on :> the screen. The output from my previous like "ls" were lost, :> ie. no longer in the scrolling buffer. I know that there is a way to :> restore the screen after exiting vim or other vi like editors, :> I just don't know how. Helps are appreciated. Thanks. : :I imagine someone else can answer this. I assume though that vim and vi do :the same thing as each other for a given xterm setup.

They not necessarily do the same thing, as this may be a termcap vs. terminfo problem. You should be aware that there are two databases for describing attributes of a particular type of terminal: termcap and terminfo. This can cause differences when the entries differ AND when of the programs in question one uses terminfo and the other uses termcap (also see +terminfo).

In your particular problem, you are looking for the control sequences ^[[?47h and ^[[?47l. These switch between xterms alternate and main screen buffer. As a quick workaround a command sequence like
echo -n "^[[?47h"; vim ... ; echo -n "^[[?47l"
may do what you want.

(My notation ^[ means the ESC character, further down you'll see that the databases use \E instead).
xterm  x11  xorg  vi  traditionalvi  vim  commandline  cli  terminal  tips  reference 
23 days ago by dusko
Why doesn't the screen clear when running vi? - XTerm FAQ
This refers to the __"alternate screen"__ feature, which has been used in its __termcap__ file since 1988. On various systems, this feature may have been removed, although it has always been in the xterm sources.
xterm  x11  xorg  traditionalvi  vi  commandline  cli  terminal  tips  reference 
23 days ago by dusko
Solved - The characters of the exited terminal program are still displayed on the screen. | The FreeBSD Forums
You need to change the terminal type to obtaine that effect. Have a look at the /usr/share/misc/termcap data base, search for xterm, you will find there besides other xterm terminals xterm-r6-clear and xterm-r5-clear. Those have the capability to ""clear the screen" after vi, more/less, etc." There are other xterm terminals claiming the same, but those two are the only ones I had success with.

You can set individually the users TERM environment variable, or change the terminal type in /etc/ttys to one of the above mentioned. Setting as environment variable has immediate effect (when set in the shells config file after a log out, log in). When is set in /etc/ttys a reboot or shutdown now followed by exit is necessary, also make sure no other TERM variable in the users shell configuration is set, otherwise it will supersede the setting in /etc/ttys.
terminal  commandline  cli  vi  traditionalvi  freebsd  unix  tips  reference 
23 days ago by dusko
Terminal codes (ANSI/VT100)
These features require that certain capabilities exist in your termcap/terminfo. While xterm and most of its clones (rxvt, urxvt, etc) will support the instructions, your operating system may not include references to them in its default xterm profile.

*** (FreeBSD, in particular, falls into this category.) ***

If tput smcup appears to do nothing for you, and you don't want to modify your system termcap/terminfo data, and you KNOW that you are using a compatible xterm application, the following may be work for you:

echo -e '\033[?47h' # save screen
echo -e '\033[?47l' # restore screen
terminal  shell  ansi  vt100  commandline  cli  unix  reference  bsd  linux  freebsd 
4 weeks ago by dusko
SDL1.2-SIXEL -- enables you to operate various GUI applications on the terminal
SDL 1.2 with libsixel based video driver.

SDL integration: Gaming, Virtualization, ...etc.
commandline  cli  terminal  images 
5 weeks ago by dusko
HashBackup: Mac, FreeBSD, Linux Server Backup
HashBackup is a Unix command-line backup program to create a local backup, remote offsite backup, or both, in your own storage accounts using:

rsync, ssh, sftp, ftp, ftps, imap (email)
WebDAV, Dropbox, Google Drive, NFS, and other mounted remote storage
Cloud storage services: Amazon S3 & compatibles, Backblaze B2, Google Cloud Storage, and others.
backup  encryption  rsync  unix  ssh  imap  email  commandline  cli  terminal 
5 weeks ago by dusko
glasstree - The poor man's daily snapshots
The poor man's daily snapshot, glastree builds live backup trees, with branches for each day. Users directly browse the past to recover older documents or retrieve lost files. Hard links serve to compress out unchanged files, while modified ones are copied verbatim. A prune utility effects a constant, sliding window.

Satoru Takabayashi has writen a similar program, in Ruby, pdumpfs (

Inspired by Plan9.

Inspired by Plan9, of course.
backup  perl  commandline  cli  terminal  sync  snapshot 
5 weeks ago by dusko
ttyrec: ttyrec is a tty recorder. Recorded data can be played back with the included ttyplay command. ttyrec is just a derivative of script command for recording timing information with microsecond accuracy as well. It can record emacs -nw, vi, lynx, or a
ttyrec is a tty recorder. Recorded data can be played back with the included ttyplay command. ttyrec is just a derivative of script command for recording timing information with microsecond accuracy as well. It can record emacs -nw, vi, lynx, or any programs running on tty.
terminal  commandline  cli  unix  vi  vim 
5 weeks ago by dusko
seq2gif - converts a sequences record file generated by ttyrec into a gif animation
This software converts a sequences record file generated by ttyrec ( into a gif animation directly using portable built-in terminal emulation engine originated from yaft (

yaft ( provides rare terminal emulation features such as SIXEL/DRCS.
terminal  commandline  cli  images  xterm 
5 weeks ago by dusko
Unix Tricks
I have marked with a * those which I think are absolutely essential
Items for each section are sorted by oldest to newest.
unix  terminal  shell  tips  commandline  cli  howto  reference  vi  vim  tool  grep  networking 
5 weeks ago by dusko
transpose a file Using awk, printf
awk '{ for (f = 1; f <= NF; f++) a[NR, f] = $f } NF > nf { nf = NF } END { for (f = 1; f <= nf; f++) for (r = 1; r <= NR; r++) printf a[r, f] (r==NR ? RS : FS) }'
awk  commandline  cli  terminal  shell  script  csv  tsv  plaintext  text  unix 
5 weeks ago by dusko
rdup - a utility inspired by rsync and the Plan9 way of doing backups
rdup is a utility inspired by rsync and the Plan9 way of doing backups. rdup itself does not backup anything; it only prints a list of the names of files that have changed since the last backup. It also handles files that are removed, allowing for correct incremental backups. Auxilary script that implement a backup strategy are included
backup  rsync  sync  commandline  cli  terminal  shell  script  tool  unix 
5 weeks ago by dusko - an experimental community for socializing, digital skill building, and collaboration through the medium of the shell
\ V V / elcome to, an experimental community for socializing,
\_/\_/ digital skill building, and collaboration through the medium of the
GNU/Linux shell.
text  unix  commandline  cli  terminal  shell 
5 weeks ago by dusko
meli MUA
Why use meli?

meli aims for configurability and extensibility with sane defaults. It seeks to be a mail client for both new and power users of the terminal, but built today terminal mail.
email  terminal  commandline  cli  mutt 
5 weeks ago by dusko
manscript converts input written in a structured text format into a troff file suitable for the man(1) program. The text structure is such that it resembles the resulting man format, and is easy to read and write. Furthermore, it tries not to limit the user to the limited subset of the troff language that it supports, but instead allows full use of troff macros and escapes.
cli  terminal  commandline  tool  unix 
7 weeks ago by dusko
« earlier      
per page:    204080120160

Copy this bookmark:

to read