<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Command Line on oorkan</title>
    <link>https://www.oorkan.dev/blog/categories/command-line/</link>
    <description>Recent content in Command Line on oorkan</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 10 Mar 2026 01:15:00 +0400</lastBuildDate>
    <atom:link href="https://www.oorkan.dev/blog/categories/command-line/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Bash histverify: Edit History Commands Before They Run</title>
      <link>https://www.oorkan.dev/blog/bash-histverify-edit-history-commands-before-they-run/</link>
      <pubDate>Tue, 10 Mar 2026 01:15:00 +0400</pubDate>
      <guid>https://www.oorkan.dev/blog/bash-histverify-edit-history-commands-before-they-run/</guid>
      <description>&lt;p&gt;Linux&amp;rsquo;s &lt;code&gt;history&lt;/code&gt; command helps you quickly find and reexecute commands you&amp;rsquo;ve run before.&#xA;Running a command from &lt;code&gt;history&lt;/code&gt; is as simple as typing &lt;code&gt;!&amp;lt;the_command_id&amp;gt;&lt;/code&gt; and hitting Enter. You can find the command ID to the left of each command.&#xA;For example, &lt;code&gt;!1998&lt;/code&gt; runs the command number 1998 in the history file.&lt;/p&gt;&#xA;&lt;p&gt;⚠️ &lt;code&gt;!&amp;lt;the_command_id&amp;gt;&lt;/code&gt; executes the given command &lt;strong&gt;immediately&lt;/strong&gt;. Rerunning some commands (e.g., &lt;code&gt;rm&lt;/code&gt;, &lt;code&gt;git reset&lt;/code&gt;) this way can lead to unintended consequences.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Making Screenshots in Linux Using Terminal - Part 2</title>
      <link>https://www.oorkan.dev/blog/linux/making-screenshots-in-linux-using-terminal-part-2/</link>
      <pubDate>Wed, 06 Jan 2021 22:00:00 +0400</pubDate>
      <guid>https://www.oorkan.dev/blog/linux/making-screenshots-in-linux-using-terminal-part-2/</guid>
      <description>&lt;p&gt;In the &lt;a href=&#34;https://www.oorkan.dev/blog/linux/making-screenshots-in-linux-using-terminal-part-1/&#34;&gt;previous part&lt;/a&gt;, we saw how to make screenshots in the terminal by using the &lt;code&gt;xwd&lt;/code&gt; command. In this part, we&amp;rsquo;ll meet the &lt;code&gt;import&lt;/code&gt; command.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://www.oorkan.dev/blog/linux/making-screenshots-in-linux-using-terminal-part-1/&#34;&gt;Part 1 here. 🔗&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt; &lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Using the &lt;code&gt;import&lt;/code&gt; command&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;import&lt;/code&gt; command is part of &lt;code&gt;imagemagick&lt;/code&gt; package. To install it, under Debian and Debian-based operating systems &lt;a href=&#34;https://distrowatch.com/search.php?basedon=Debian&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;🔗&lt;/a&gt; you can run:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;🚀 ~ sudo apt install imagemagick&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;As for &lt;code&gt;xwd&lt;/code&gt;, &lt;code&gt;import&lt;/code&gt; also relies on the &lt;a href=&#34;https://linux.die.net/man/7/x&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;X Window System&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Make Your Life Easier With Z Script</title>
      <link>https://www.oorkan.dev/blog/make-your-life-easier-with-z-script/</link>
      <pubDate>Sat, 26 Sep 2020 00:16:00 +0400</pubDate>
      <guid>https://www.oorkan.dev/blog/make-your-life-easier-with-z-script/</guid>
      <description>&lt;p&gt;When working in terminal, we often need to jump through different directories. Keeping the track of directories we&amp;rsquo;ve changed to can be a tough task. One option can be using the &lt;code&gt;history&lt;/code&gt; command in Linux:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;history&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; grep cd&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;This is not an ideal solution because if the list is very long and we don&amp;rsquo;t remember the exact name of the directory we used before, then there we have problems. On the other hand, copy-pasting directory names from a list generated by the &lt;code&gt;history&lt;/code&gt; command can be time-consuming.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Making Screenshots in Linux Using Terminal - Part 1</title>
      <link>https://www.oorkan.dev/blog/linux/making-screenshots-in-linux-using-terminal-part-1/</link>
      <pubDate>Thu, 17 Sep 2020 05:35:00 +0400</pubDate>
      <guid>https://www.oorkan.dev/blog/linux/making-screenshots-in-linux-using-terminal-part-1/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://www.oorkan.dev/blog/linux/making-screenshots-in-linux-using-terminal-part-2/&#34;&gt;Part 2 here. 🔗&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Using the &lt;code&gt;xwd&lt;/code&gt; command&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;If our Linux OS is using the &lt;a href=&#34;https://linux.die.net/man/7/x&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;X Window System&lt;/a&gt;, we can use the &lt;code&gt;xwd&lt;/code&gt; (X window dump) command there to make screenshots. This command is part of a package called &lt;code&gt;x11-apps&lt;/code&gt;. Under Debian-based operating systems &lt;a href=&#34;https://distrowatch.com/search.php?basedon=Debian&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;🔗&lt;/a&gt;, like Ubuntu, we can run &lt;code&gt;sudo apt install x11-apps&lt;/code&gt; to install it.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;🚀 ~ xwd -out screenshot.xwd&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;The command above will provide us a pointer to select the window we want to make a screenshot of. The problem here is that when we have another window in the foreground, that window will be captured as well, as shown in the illustration.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Format &#39;docker ps&#39; Command Output Nicely</title>
      <link>https://www.oorkan.dev/blog/format-docker-ps-command-output-nicely/</link>
      <pubDate>Wed, 27 May 2020 08:51:38 +0400</pubDate>
      <guid>https://www.oorkan.dev/blog/format-docker-ps-command-output-nicely/</guid>
      <description>&lt;p&gt;Run the following command in your terminal:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;VERTICAL&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;\nID\t{{.ID}}\nImage\t{{.Image}}\nCommand\t{{.Command}}\nCreated\t{{.RunningFor}}\nStatus\t{{.Status}}\nPorts\t{{.Ports}}\nNames\t{{.Names}}\n&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;After this, you&amp;rsquo;ll be able to format your &lt;code&gt;docker ps&lt;/code&gt; command output vertically by doing:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;docker ps --format&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$VERTICAL&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;The shell script is available in my repo here: &lt;a href=&#34;https://github.com/oorkan/docker_ps_vertical&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;github.com/oorkan/docker_ps_vertical&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Many thanks to &lt;strong&gt;Arthur Ulfeldt&lt;/strong&gt; and this course from Linkedin:&#xA;&lt;a href=&#34;https://www.linkedin.com/learning/learning-docker-2&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Learning Docker by Arthur Ulfeldt&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reboot or Shutdown From Terminal in Linux</title>
      <link>https://www.oorkan.dev/blog/how-to-reboot-or-shutdown-from-terminal-in-linux/</link>
      <pubDate>Thu, 30 Apr 2020 04:27:00 +0400</pubDate>
      <guid>https://www.oorkan.dev/blog/how-to-reboot-or-shutdown-from-terminal-in-linux/</guid>
      <description>&lt;p&gt;In all examples, we need to be &lt;code&gt;root&lt;/code&gt; or use the command with &lt;code&gt;sudo&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt; &lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Reboot&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;reboot&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;poweroff --reboot&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; In some systems, the &lt;code&gt;reboot&lt;/code&gt; flag may not be available to use with &lt;code&gt;poweroff&lt;/code&gt; command.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;reboot&lt;/code&gt; command can also be used with &lt;code&gt;-f&lt;/code&gt; flag which stands for &lt;code&gt;force&lt;/code&gt; option.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;reboot -f&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;&lt;strong&gt;Important!&lt;/strong&gt; When using the &lt;code&gt;-f&lt;/code&gt; flag in &lt;code&gt;reboot&lt;/code&gt; command, the machine will reboot immediately without properly closing the system. &lt;strong&gt;Be careful with it&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linux Terminals I Use</title>
      <link>https://www.oorkan.dev/blog/linux-terminals-i-use/</link>
      <pubDate>Sun, 19 Apr 2020 20:49:56 +0400</pubDate>
      <guid>https://www.oorkan.dev/blog/linux-terminals-i-use/</guid>
      <description>&lt;p&gt;Guake Terminal -&amp;gt; &lt;a href=&#34;http://guake.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;guake.org&lt;/a&gt;&lt;/p&gt;&#xA;&lt;a href=&#34;http://guake.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;img src=&#34;https://res.cloudinary.com/oorkan/image/upload/v1587322266/blog/img/topics/linux/guake_logo_lqmadp.png&#34; alt=&#34;Guake Terminal Logo&#34;&gt;&lt;/a&gt;&#xA;&lt;p&gt;Terminology -&amp;gt; &lt;a href=&#34;https://www.enlightenment.org/about-terminology.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;enlightenment.org/about-terminology.md&lt;/a&gt;&lt;/p&gt;&#xA;&lt;a href=&#34;https://www.enlightenment.org/about-terminology.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;img src=&#34;https://res.cloudinary.com/oorkan/image/upload/v1587322382/blog/img/topics/linux/terminology_logo_pmzrsf.png&#34; alt=&#34;Terminology Terminal Logo&#34;&gt;&lt;/a&gt;</description>
    </item>
    <item>
      <title>How to display calendar in Linux terminal</title>
      <link>https://www.oorkan.dev/blog/how-to-display-calendar-in-linux-terminal/</link>
      <pubDate>Wed, 08 Apr 2020 07:58:05 +0400</pubDate>
      <guid>https://www.oorkan.dev/blog/how-to-display-calendar-in-linux-terminal/</guid>
      <description>&lt;p&gt;Simply run the command &lt;code&gt;cal&lt;/code&gt; in the terminal.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://res.cloudinary.com/oorkan/image/upload/v1587322819/blog/img/topics/linux/cal_sdgbis.jpg&#34; alt=&#34;cal&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;In most distros we can also run the command &lt;code&gt;calendar&lt;/code&gt; which will display a list of memorial dates.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://res.cloudinary.com/oorkan/image/upload/v1587322870/blog/img/topics/linux/calendar_dlu7ep.jpg&#34; alt=&#34;calendar&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt; &lt;/p&gt;&#xA;&lt;p&gt;Thanks &lt;a href=&#34;https://twitter.com/davidwalshblog&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;@davidwalshblog&lt;/a&gt; for bringing this to my attention.&lt;/p&gt;&#xA;&lt;a href=&#34;https://twitter.com/davidwalshblog&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;img src=&#34;https://res.cloudinary.com/oorkan/image/upload/v1587322963/blog/img/topics/linux/davidwalshblog_oafgot.jpg&#34; alt=&#34;@davidwalshblog&#34;&gt;&lt;/a&gt;</description>
    </item>
    <item>
      <title>Emojifying Your Linux Terminal</title>
      <link>https://www.oorkan.dev/blog/emojifying-your-linux-terminal/</link>
      <pubDate>Sat, 17 Aug 2019 03:34:43 +0400</pubDate>
      <guid>https://www.oorkan.dev/blog/emojifying-your-linux-terminal/</guid>
      <description>&lt;p&gt;All of us wish to express their individualism. Customizing the tools we use is one of the ways to do it. This article will show how we can make our Linux terminal more interesting and user-friendly by tweaking it a little with some nice emoji.&lt;/p&gt;&#xA;&lt;p&gt;In this experiment, I personally use Debian 10 (Buster) with Chromium web browser, and a terminal called Xfce Terminal, all are running on a virtual machine. The process should be very similar in other Linux distros as well.&#xA;We’ll also need some site which contains cool emojis. I very like &lt;a href=&#34;https://emojipedia.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Emojipedia&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
