{"id":10813,"date":"2025-06-04T03:00:00","date_gmt":"2025-06-04T07:00:00","guid":{"rendered":"https:\/\/www.both.org\/?p=10813"},"modified":"2025-05-31T16:23:08","modified_gmt":"2025-05-31T20:23:08","slug":"loving-the-command-line-with-the-raspberry-pi","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=10813","title":{"rendered":"Loving the command line with the Raspberry Pi"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"10813\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><\/div>\n<p>I\u2019m going to show my age when I share that my first Unix system was a Sun 3\/50 workstation in our campus computer lab, when I was an undergraduate student in the early 1990s. Originally released in the late 1980s, our campus lab still relied on a small network of these machines for the computer science program. The Sun 3\/50 had a <a href=\"https:\/\/en.m.wikipedia.org\/wiki\/Sun-3\">15.7 MHz M68020 CPU and 4 MB memory<\/a>, which is underpowered by today\u2019s standards, but powerful for the time. While you could run the X Window System on the Sun 3\/50 in \u201cmono\u201d mode, I usually ran my Unix session at the console especially because of the black-on-white monospace-serif displays, which I found easy to read.<\/p>\n\n\n\n<p>Recently, I started a throwback experiment where I run my Raspberry Pi 3 in \u201cconsole\u201d mode, without a graphical user interface. Naturally, my first thought was to run this like a Sun 3\/50 workstation. Here\u2019s how I did it:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"set-the-console-font\">Set the console font<\/h2>\n\n\n\n<p>When you boot Linux without a graphical interface, you\u2019re using it at the \u201cconsole.\u201d That\u2019s not technically a <em>terminal<\/em> which is a separate kind of device that connects to a server over a network, and it\u2019s not a <em>terminal emulator<\/em> which is software that pretends to be (\u201cemulates\u201d) a terminal. Instead, <em>console<\/em> mode means you have access to all of the underlying display hardware on the device.<\/p>\n\n\n\n<p>Linux loads a default font when in console mode. However, this font is quite small and plain. Fortunately, you can load other fonts using the <strong>setfont<\/strong> command and the fonts available in <code>\/usr\/lib\/kbd\/consolefonts<\/code>. If these fonts aren\u2019t to your liking, you can install other console fonts, such as the Terminus font.<\/p>\n\n\n\n<p>The Terminus font is a good font for running commands at the command line, such as when I only need to do <em>system administration<\/em> tasks. But I don\u2019t like it when I\u2019m writing text. Instead, I wanted to use a monospace-serif font like the old Sun systems. I think others liked that font too, because there\u2019s a very similar console font that\u2019s available as <code>sun12x22.psfu.gz<\/code>. You can load it with this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ setfont \/usr\/lib\/kbd\/consolefonts\/sun12x22.psfu.gz<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"set-the-terminal-to-black-on-white\">Set the terminal to black on white<\/h2>\n\n\n\n<p>By default, Linux boots up using white text on a black background, but old Sun computers used a black-on-white display. So my next task was to put the system into this \u201cflipped\u201d color mode.<\/p>\n\n\n\n<p>You can use the <strong>setterm<\/strong> command to set default attributes for the terminal or console. One neat feature is <code>--inversescreen on<\/code> to invert the screen colors: if you\u2019re running with white text on a black background, this changes the screen to use black text on a white background.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ setterm --inversescreen on<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"linux-like-the-sun-350\">Linux like the Sun 3\/50<\/h2>\n\n\n\n<p>With these settings, using my Raspberry Pi at the console really feels like I\u2019m using the Sun 3\/50 from my university days. If you want the full experience, I recommend either using plain <strong>vi<\/strong> as your editor, or use the <code>quiet<\/code> color theme in <strong>vim<\/strong>. Either will give you a black-and-white editor experience similar to the old Sun systems:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><a href=\"https:\/\/www.both.org\/wp-content\/uploads\/2025\/05\/pi-vim.png\" target=\"_blank\" rel=\" noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2025\/05\/pi-vim.png\" alt=\"screenshot of a vim edit session\" class=\"wp-image-10821\"\/><\/a><figcaption class=\"wp-element-caption\">Editing a document in vim with \u201cquiet\u201d color theme<\/figcaption><\/figure>\n\n\n\n<p>However, the modern implementation of <strong>ls<\/strong> can add color to its output. This can be helpful to easily spot directories and other entries, but I find it distracting when I want to emulate the monospace display from the old Sun systems. You can fix this with an alias:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ alias ls='\/bin\/ls --color=never'<\/code><\/pre>\n\n\n\n<p>With this, the <strong>ls<\/strong> command will never add color to its output:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2025\/05\/pi-consolefonts.png\" alt=\"screenshot of ls on Linux\" class=\"wp-image-10815\"\/><figcaption class=\"wp-element-caption\">Viewing ls output without colors<\/figcaption><\/figure>\n\n\n\n<p>Other things still show up in color, which the original Sun systems didn\u2019t support (they were entirely monochrome) but I don\u2019t mind the occasional use of color. For example, when processing a document through <strong>nroff<\/strong>, bold text shows up a black text highlighted in cyan, which works well:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2025\/05\/pi-nroff.png\" alt=\"viewing an nroff document at the command line\" class=\"wp-image-10817\"\/><figcaption class=\"wp-element-caption\">Viewing the first page of an nroff document<\/figcaption><\/figure>\n\n\n\n<p>These colors also appear when you read online \u201cman\u201d pages, like this page for the <strong>setterm<\/strong> command:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2025\/05\/pi-setterm.png\" alt=\"The setterm man page\" class=\"wp-image-10820\"\/><figcaption class=\"wp-element-caption\">The setterm man page<\/figcaption><\/figure>\n\n\n\n<p>..or this page for the <strong>setfont<\/strong> command:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2025\/05\/pi-setfont.png\" alt=\"The setfont man page\" class=\"wp-image-10819\"\/><figcaption class=\"wp-element-caption\">The setfont man page<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Loving the command line<\/h2>\n\n\n\n<p>Using the Raspberry Pi in text mode, using the command line, is a great throwback experiment to remind us how people used Unix from <em>terminals<\/em> in an era before computers had enough power to run a graphical desktop. And for this demonstration, using the Raspberry Pi like a classic Sun workstation is a fantastic trip filled with nostalgia. The black-on-white text, and the monospace-serif font, remind me of the first time I used Unix. It&#8217;s a fun way to <em>get back to the roots<\/em> of Unix while using Linux.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&rsquo;m going to show my age when I share that my first Unix system was a Sun 3\/50<\/p>\n","protected":false},"author":33,"featured_media":3640,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[69,5,487],"tags":[147,91,211],"class_list":["post-10813","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fun","category-linux","category-raspberry-pi","tag-fun","tag-linux","tag-raspberry-pi"],"modified_by":"Jim Hall","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/10813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10813"}],"version-history":[{"count":6,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/10813\/revisions"}],"predecessor-version":[{"id":10842,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/10813\/revisions\/10842"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/3640"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}