{"id":5057,"date":"2024-04-28T01:15:00","date_gmt":"2024-04-28T05:15:00","guid":{"rendered":"https:\/\/www.both.org\/?p=5057"},"modified":"2024-04-24T13:15:35","modified_gmt":"2024-04-24T17:15:35","slug":"seven-linux-commands-just-for-fun","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=5057","title":{"rendered":"Seven Linux commands just for fun"},"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=\"5057\" 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>The Linux command line can be the home of power users and sysadmins. However, Linux is more than just a lot of hard work. Linux was developed by fun-loving people who created an array of fun and even comical commands. Try playing around with these yourself when you want a smile.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"steam-locomotive-sl\">Steam locomotive (sl)<\/h2>\n\n\n\n<p>For no reason whatsoever, you can cause a steam locomotive to zip across your terminal using the <code>sl<\/code> command. Install Steam Locomotive with your package manager. For example, on Fedora:<\/p>\n\n\n\n<p><code>$ <strong>sudo dnf install sl<\/strong><\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/opensource.com\/sites\/default\/files\/uploads\/locomotive_0.png\" alt=\"A steam locomotive engine drawing made from symbols and characters\" title=\"Steam locomotive\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"real-uses\">Real uses<\/h3>\n\n\n\n<p>As far as I know, the <code>sl<\/code> command is truly just for fun. Do you have an interesting use for <code>sl<\/code>? <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"fireplace-aafire\">Fireplace (aafire)<\/h2>\n\n\n\n<p>Warm your heart and your terminal with <code>aafire<\/code> command, which causes a fireplace animation to play. You can install aafire with your package manager. On Debian, Mint, Elementary, and similar:<\/p>\n\n\n\n<p><code>$ <strong>sudo apt install libaa-bin<\/strong><\/code><\/p>\n\n\n\n<p>On Fedora, CentOS, and others:<\/p>\n\n\n\n<p><code>$ <strong>sudo dnf install aalib<\/strong><\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/opensource.com\/sites\/default\/files\/uploads\/fireside.png\" alt=\"A black and white image of a fire made from text symbols and characters\" title=\"fireside\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"real-uses-1\">Real uses<\/h3>\n\n\n\n<p>This image is a subtle way to communicate to your team or boss that everything&#8217;s about to go up in smoke.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"yes\">Yes<\/h2>\n\n\n\n<p>You can use the <code>yes<\/code> command to print out a string of text until it is forcibly stopped with <strong>Ctrl+C<\/strong>. For example, I am a Buffalo Bills fan, so I chose to print out an endless series of Buffalo Bills with the <code>yes<\/code> command:<\/p>\n\n\n\n<p><code>$ yes Buffalo Bills<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/opensource.com\/sites\/default\/files\/uploads\/bills.png\" alt=\"A screenshot showing repeated lines of Buffalo Bills left edge slightly cut off\" style=\"width:492px;height:auto\" title=\"Yes command\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"real-uses-2\">Real uses<\/h3>\n\n\n\n<p>You can use this command to pipe confirmation to scripts so that when a script pauses to ask for confirmation, it automatically receives <code>yes<\/code>. For example, imagine there&#8217;s a script you run that often stops to ask you for confirmation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ foo\nAre you sure you want to do this? Y\/n  Y\nAre you really sure? y\/N  Y\nBut are you really? y\/N<\/code><\/pre>\n\n\n\n<p>You can auto-accept such messages by passing <code>yes<\/code> to the command:<\/p>\n\n\n\n<p><code>$ <strong>yes | foo<\/strong><\/code><\/p>\n\n\n\n<p>Alternatively, you can auto-deny messages using yes as well:<\/p>\n\n\n\n<p><code>$ <strong>yes no | foo<\/strong><\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"fortune\">Fortune<\/h2>\n\n\n\n<p>Installing Fortune can tell your fortune on the command line. Fortune prints a random and possibly meaningful message.<\/p>\n\n\n\n<p>Install Fortune with your package manager:<\/p>\n\n\n\n<p><code>$ <strong>sudo apt install fortune<\/strong><\/code><\/p>\n\n\n\n<p>On Fedora:<\/p>\n\n\n\n<p><code>$ <strong>sudo dnf install fortune-mod<\/strong><\/code><\/p>\n\n\n\n<p>The <code>fortune<\/code> command has many datasets it can draw from. For instance, you can get famous quotes from literature or the science-fiction TV show <em>Firefly<\/em>, or choose from jokes, tips about Linux, and much more. Search your repository for &#8220;fortune&#8221; to see what options your distribution provides.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <strong>fortune<\/strong>\nJohnson's law:\n  Systems resemble the organizations that create them.<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"real-uses-3\">Real uses<\/h3>\n\n\n\n<p>You can use Fortune to generate a pseudo-random number. There&#8217;s not enough entropy to make it cryptographically secure, but when you need an unexpected number, you can count characters or words:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <strong>fortune | wc --chars<\/strong>\n38\n$ <strong>fortune | wc --words<\/strong>\n8\n$ <strong>fortune | wc --chars<\/strong>\n169<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"lolcat\">Lolcat<\/h2>\n\n\n\n<p>Lolcat is a program that concatenates files, or standard input, to standard output (like the generic cat) and adds rainbow coloring to it. You can pipe the output of other commands to <code>lolcat,<\/code> which provides a rainbow hue to the result.<\/p>\n\n\n\n<p>Here&#8217;s the result of<strong> <code>lolcat -h<\/code><\/strong> for its help output:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/opensource.com\/sites\/default\/files\/uploads\/lolcat_rainbow.png\" alt=\"onscreen text colored in a rainbow gradient\" title=\"lolcat\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"figlet-and-banner\">Figlet and banner<\/h2>\n\n\n\n<p>The <code>figlet<\/code> and <code>banner<\/code> commands let you create simple ASCII text banners. Here&#8217;s a text banner for a CentOS system:<\/p>\n\n\n\n<p><code>$ <strong>figlet centos.com<\/strong><\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/opensource.com\/sites\/default\/files\/uploads\/figlet_centos.png\" alt=\"Text banner reading &quot;centoscom&quot; composed from symbols and characters\" title=\"figlet text banner\"\/><\/figure>\n\n\n\n<p>Pipe <code>figlet<\/code> to <code>lolcat<\/code> for a colorful banner:<\/p>\n\n\n\n<p><code>$ <strong>figlet centos.com | lolcat<\/strong><\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/opensource.com\/sites\/default\/files\/uploads\/lolcat_figlet_centos.png\" alt=\"A text banner reading &quot;centoscom&quot; made rainbow colored with lolcat\" title=\"Figlet with lolcat effects\"\/><\/figure>\n\n\n\n<p><code>$ <strong>banner Hello World<\/strong><\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/opensource.com\/sites\/default\/files\/uploads\/hello_world_0.png\" alt=\"A banner reading &quot;Hello World&quot; spelled out with pound symbols\" title=\"Hello World banner\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"real-use\">Real use<\/h3>\n\n\n\n<p>Both <code>figlet<\/code> and <code>banner<\/code> are easy ways to remind users what system they&#8217;re logging on to, which can be helpful when you work with dozens of servers, as many sysadmins, web designers, and cloud developers do.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"espeak\">Espeak<\/h2>\n\n\n\n<p>You can add speech capabilities to your command line funnies by installing <code>espeak<\/code>.<\/p>\n\n\n\n<p>Once <code>espeak<\/code> is installed, turn up the volume on your computer and have some fun listening to your machine talk to you. Espeak is a software speech synthesizer, and there are a few different voice libraries available.<\/p>\n\n\n\n<p><code>$ <strong>espeak \"Linux is the best operating system.\"<\/strong><\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"fun-commands\">Fun commands<\/h2>\n\n\n\n<p>Be sure to consult the man pages of all these commands to explore all the possibilities and iterations. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux was developed by fun-loving people who created an array of fun and even comical commands. Try playing around with these yourself when you want a smile.<\/p>\n","protected":false},"author":32,"featured_media":5073,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[100,69,5],"tags":[380],"class_list":["post-5057","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-command-line","category-fun","category-linux","tag-fun-linux-commands"],"modified_by":"David Both","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/5057","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\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5057"}],"version-history":[{"count":4,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/5057\/revisions"}],"predecessor-version":[{"id":5074,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/5057\/revisions\/5074"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/5073"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}