Text Mode
Introduction
Today it may seem strange, but the computer started in text mode only, and many of use are still using it like that. Contrary to popular belief, a text mode computer is completely usable. The purpose of this page is precisely to give a certain number of pointers as to what software to use for common tasks. If you want to work in several windows at the same time, that is also possible - see below.Text mode is the best way to reclaim any old hardware too feeble to run graphic mode. It can be an old 386, or a simple raspberry.
I work on unices, so this page basically assumes that. However, I switch between Linux, FreeBSD and NetBSD; to the best of my knowledge what is written here is valid on at least those 3 (unless otherwise specified) and hence most likely on most unices (certainly OpenBSD, DragonFly, etc).
Text editing
A lot of our time on the computer is spent writing, and there is a reason it is called text mode. After all, the best editor is the one that suits your need, whatever they might be. So no editor war here. Text editors ultimately fall into one of three categories: emacs, vi or wordstar (clone), in alphabetic order :-)- emacs basically does everything AND the proverbial kitchen sink. It may or may not be on the system.
- vi is the default editor on unix system, which is why it is my favorite. Once you know how to use it, you can go on any system: there will always be a vi available. If you don't like the stock one, you can always compile this C file, and you'll have a very decent one. That said, when available I go for vim, which is vi improved, and well, it lives up to its name.
- wordstar _THE_ wordstar clone is JOE. There is also something called WordTsar which I only mention for the aweful pun because afaik it runs on linux, NetBSD and windows but not FreeBSD. It's also very alpha software.
Text processing
By text processing, I mean changing the result of the text editing into something else.You will hear about troff and a2ps or ps2pdf, but these days the easiest is definitely pandoc which does dozens of formats, including markdown, doc, html or pdf. (For some reason, the package on FreeBSD is called hs-pandoc. Don't ask). You'll probably need a pdf engine with that, on linux I use weasyprint, on BSD groff. However on BSD the result is much better looking if you convert your markdown to html and then the html to pdf. Simple script..
Messaging
Another area which exploded with the computer before migrating to the phone is of course communication.- email: Let's start at the beginning: email. I use a combination of exim/fetchmail and alpine as a local editor.
mutt is the default on many linux systems, but I've been using pine (as it was before <insert long story here>), and so there.
- deltachat has a python text-mode client. which works quite well, even if many functionalities are missing.
- signal: the client is intuitively named gurk (!) (or gurk-rc on FreeBSD see above for package-names (duh!)))
- telegram: deltachat has a bridge for telegram, so you can use that, or you can use nchat which works really well
- whatsapp: I don't do whatsapp, but nchat does signal, telegram and whatsapp. However, that's on linux only. On the *BSD, it only does telegram
- fediverse: plenty there: tut, toot, Mastui, mstdn, but tut is the king.
Browsing
- lynx, links(2),Elinks, w3m, hv3 are the usual suspects for html. Netrik has very few dependencies an compiles anywhere.
- offpunk is your go-to for gemini, but it also does the web and a lot more (gopher, etc)
Sound
- gst123 will happily play anything supported by the gstreamer library, ie flac, mp3, even mp4.
- ffmpeg: THE swiss army knife for anything sound or video. will transform pretty much any AV format into any other.
- cliamp is a command-line clone of Winamp. It does everything: online radio, YouTube, your hard disk. Really a one-stop shop for music in the terminal.
Misc
- Multitasking is perfectly possible in text mode. The easiest way is just to use <alt>-<FctKey> and you open a new session. But there are many other ways, see below.
- screen has been around for a while and is one of my favorite. It allows you to detach the shell you're working in from the session.
Most people today working on their own computers might not se the point, but I worked for years on big machines to which I connected
(usually via a phone line), and the ability to quit a session and then resume it later was priceless. Imagine you launch a job that takes 3 days...
I still use it today to launch background process like http server, etc.
Hint: put a title (-S <title>), it will be much easier to re-attach to the session you're looking for. - termux does basically the same thing and more. Much more recent, many more options.
- mc: mc is a clone of the norton commander of dos days. It gives the famous 2-panel interface and makes your life way easier in terms of moving files around or HD cleaning. Another good candidate is nnn.
- RegExp: I strongly suggest you learn regular expressions.
The reason is very simple: it's a common language of all unix utilities. You can for example use them in vi for extremely elaborate search and replace, etc.
not to mention grep (Get REgular exPressions) which will allow you to extract the info you need from huge logs - Scripts: scripting is what makes unix so powerful.
The philosophy of unix is: one small program that does one thing.
But where it becomes interesting is that you can then combine those programs together, sending the output of one as the input of the other, and the result is just what you needed.
By way of example, I have dozens of robots that examine webpages and post for me on mastodon the result of their research.
The skeleton of the script is always the same:Example: it looks for todays' latest news on airline news page and sent them to me as a private message.- download the page
- extract interesting stuff
- format it
- post on mastodon
#!/bin/bash # look for story content and grab link after that # only grab latest ########################### get today's date ##################################################### ye=$(date +"%Y") mo=$(date +"%m") da=$(date +"%d") ########################### grab page, extract relevant lines and dump to file ##################### curl "https://skift.com/airlines/" > skift.htm cat skift.htm | grep "https://skift.com/$ye/$mo/$da/" | grep -v "placeholder" | cut -d '"' -f2 > skift.url ########################### read new file, extract title, format and post title+ url on mastodon ### while read line ; do title=`echo $line | cut -d'/' -f7 | sed 's/-/ /g'`; msg=`echo "@FrankauLux Skift news: $title $line #airline #skynews"`; madonctl --visibility direct toot $msg done < skift.url ########################### Clean ################################################################ rm skift.htm rm skift.url ########################### Done ###############################################That is of course trivial (*), but it gives you an idea of the power of the command line once it is combined in a script.
21 lines of code, of which 8 are comments! If you put that script for automatic execution in cron, you have the news coming to you every morning (for example) - no more scrolling...(*)It may look complicated to you, but I'm just combining 5 unix utilities: date, curl, cat, grep and sed. cut is a built-in function of the shell. madonctl is an external program that allows you to post on mastodon.
The secret is the | which means take the output of the first command and feed it as the input of the second one.
So line 2 is: take the page, extract the pages with an URL with today's date then from the few lines left remove those with the word "placeholder" then cut the second part in quotes and send the result to a file named skift.url.
I hope this brief list showed you you can perfectly work on machine with no graphical interface. Countless people still do it today, be it because they are working on remote machines with suboptimal connection conditions, or just because they decided to keep using that old machine until it dies :-)
see also:
[Top]



