<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by janymuong on Medium]]></title>
        <description><![CDATA[Stories by janymuong on Medium]]></description>
        <link>https://medium.com/@janymuong?source=rss-af9685bfd9c0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*E45SaT_4I9xI0cqOZVTKvg.png</url>
            <title>Stories by janymuong on Medium</title>
            <link>https://medium.com/@janymuong?source=rss-af9685bfd9c0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 23:00:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@janymuong/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Command-Line is Unfiltered: Cutting Through GUI Noise]]></title>
            <link>https://medium.com/@janymuong/command-line-is-unfiltered-cutting-through-gui-noise-f3c775092832?source=rss-af9685bfd9c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3c775092832</guid>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[gnu-linux]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[unix]]></category>
            <category><![CDATA[command-line]]></category>
            <dc:creator><![CDATA[janymuong]]></dc:creator>
            <pubDate>Wed, 24 Jul 2024 04:24:59 GMT</pubDate>
            <atom:updated>2025-10-29T11:37:45.311Z</atom:updated>
            <content:encoded><![CDATA[<h3>Exposing the ‘GUI Illusion’</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*67LixZpc-XSZjZIwXqac5A.png" /></figure><p>Cfor context:</p><p>In this write-up, I am going to take you through the command-line, and what you can do with it. I hope you pick something from this — something that can be practically useful to yourself or has some relevance in a way!</p><h3>A Few Words about What I Want this Post to Be:</h3><p>This material is probably just a bunch of random shell commands with explanation texts in it. However, I want it to be more than that. I hope to make it as educational as much as I can make it to be that. Now, normally, I would’ve come up with this write-up out of my obsession with command-line and command-line interfaces (CLIs). And I can affirm part of it was largely influenced by my obsession with the command-line and CLIs.</p><h4>The Purpose of It:</h4><p>First off, I want this to be a place for education: e.g. I want you, the reader, to see for yourself how you can leverage this material to grow yourself in terms of how you can use shells to exploit the potential of operating systems/kernels, starting from very simple shell tasks all the way to more complex scripts that can make your work easier. And I want you to like shells, haha :)</p><p>Second, let’s face it: the command line has some functionality that wouldn’t be uncovered with the raw power and typical working of the sleek graphical user interfaces (GUIs) and visually appealing applications we have today. Coming from a place of having used GUIs and which are thought to be convenient (this is true for almost everyone who use electronics) the command line is not an archaic relic of computing history because of GUIs. Moreover, fluency on the command line is a skill that improves your flexibility and productivity as an engineer in both obvious and subtle ways. This text is not lengthy, but if you can use and recall all the items here, you know a lot. If you’re relatively new to the command-line, I have made effort to explain most if the items in here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*ZsuFCxgJ6LzW6YZBuQiHqQ.jpeg" /><figcaption>I coming out of my shell to tell you stuff about ‘shells’ :)</figcaption></figure><h4>WHAT a <strong>Shell</strong> IS:</h4><p>The <a href="https://en.wikipedia.org/wiki/Command-line_interface">command-line</a> is a text-based interface used to interact with computers. It’s the place where every keystroke counts, and where you might even feel a bit like Elliot Alderson from “Mr. Robot” — with continued use. I am using this example because this show is the one show that got me interested with CLIs to begin with, and from first impression intimidation. And you should watch <a href="https://www.google.com/search?q=mr+robot&amp;sca_esv=9aab8662baee94c4&amp;sca_upv=1&amp;sxsrf=ADLYWIKZ9PruznqUsYr6n2y1UlE0cg1W8Q%3A1721788097642&amp;ei=wWagZqPyJryIxc8PrYSQeA&amp;oq=Mr+rob&amp;gs_lp=Egxnd3Mtd2l6LXNlcnAiBk1yIHJvYioCCAEyBBAjGCcyChAjGIAEGCcYigUyDRAuGIAEGLEDGEMYigUyBRAAGIAEMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABDIFEAAYgAQyBRAAGIAESOUqUOwMWKwZcAF4AJABAJgBugOgAd8TqgEHMi0zLjIuMrgBAcgBAPgBAZgCB6ACwxDCAgoQABiwAxjWBBhHwgILEAAYgAQYkQIYigXCAg4QABiABBixAxiDARiKBcICCxAuGIAEGLEDGIMBwgIUEC4YgAQYsQMY0QMYgwEYxwEYigXCAgoQABiABBhDGIoFwgIIEAAYgAQYsQPCAhEQLhiABBixAxjRAxiDARjHAcICCBAuGIAEGLEDwgIKEC4YgAQYsQMYCsICDhAuGIAEGLEDGNEDGMcBwgIIEC4YgAQY1ALCAgUQLhiABMICChAuGIAEGEMYigWYAwCIBgGQBgiSBwkxLjAuMi4yLjKgB7Ru&amp;sclient=gws-wiz-serp">Mr. Robot</a> by the way :)</p><p>Okay that was a tangent not meant to be part of this. The shell is essentially the command line’s interpreter. Think of it as a program that accepts the text you type type into a computer terminal (meaningful texts make commands) and makes sure they get carried out. Example of common shells include <strong>Bash (Bourne Again Shell), Zsh (Z Shell), and Fish (Friendly Interactive Shell, PowerShell</strong> etc. [see this: what <a href="https://cs.lmu.edu/%7Eray/notes/bash/">shells</a> are for reference]</p><p>Commands in the shell have a specific syntax and can be combined in powerful ways. For example:</p><pre>ls -l</pre><p>This command lists out (regular, links and directory) files in the current directory in long format. It’s like asking, “Who’s in the directory, and what are they up to?”</p><p>In many ways, the command line interface (CLI) can be seen as a more direct form of communication between humans and computers. Unlike graphical user interfaces (GUIs), which often abstract away the complexities of computer operations, the CLI provides a more fine-tuned and precise way to issue commands and receive feedback. This concept ties into a broader discussion about human-computer interaction:</p><blockquote>“Because humans have ‘input’ in the form of the senses, and ‘output’ in the form of speech and actions, it has become an AI creed that a convincing mimicry of human input-output behavior amounts to actually achieving true human qualities in computers.” — Ari Schulman</blockquote><p>I cannot stress enough how I want to use this statement because I think it underscores the importance of input-output behavior in both human and computer interactions. The command line slightly epitomizes this concept, providing a clear and efficient method for users to input commands and receive outputs, thus achieving a high level of control and precision in computing tasks.</p><h3>Finding Files: <em>find</em> Command vs. File Explorer Search</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*LIt8VjNTgcXxSF5hxO1SIg.png" /></figure><p>I am using this to highlight how lightweight a simple command line lookup is — in terms of resource usage and hogging your machine less; compared to using GUIs like file explorers for file systems. Because let’s face it, if you have used the ‘search’ feature on windows before you may have heard your fan moving at one point (I hope this is enough information to provide context on how heavy that simple task is when using GUIs)</p><p>The <em>find</em> command in Unix is similar to the search function in File Explorer on Windows in that both are used to locate files and directories based on various criteria. However, there are key differences in their efficiency and flexibility.</p><p>The <a href="https://www.geeksforgeeks.org/find-command-in-linux-with-examples/"><em>find</em></a> command in Unix is a powerful tool for locating files and directories based on a wide range of criteria, such as name, size, type, etc. For example:</p><pre>find . -type f -name &#39;*.sh&#39;</pre><p>This command searches for all text files within the current directory. It’s like saying, “show me all the text files that have the extension ‘<strong><em>.sh</em></strong>’”</p><p>In contrast, the search function in Windows File Explorer allows users to find files through a graphical interface. Users can type in their search terms and use filters to narrow down the results. While both methods serve the same purpose, their efficiency and flexibility can vary.</p><h4>Efficiency and Flexibility</h4><p><strong>The Unix <em>find</em> Command:</strong></p><p>The <strong><em>find</em></strong> command is highly efficient and flexible for several reasons:</p><ul><li>Precision: users can specify detailed criteria and combine multiple options for highly targeted searches.</li><li>Automation: search operations can be scripted and scheduled, allowing for automated file management tasks.</li><li>Performance: The <strong><em>find</em></strong> command can be faster for certain operations, especially when used with additional tools like ‘<strong><em>xargs</em></strong>’ or combined with other commands through pipes (explained later on).</li></ul><p><strong>Windows File Explorer Search:</strong></p><p>The search function in Windows File Explorer offers the following advantages:</p><ul><li>User-Friendly Interface: intuitive and accessible, making it easy for users without technical expertise to perform searches.</li><li>Integrated Experience: results are displayed within the familiar File Explorer environment, allowing for quick actions like opening, copying, or moving files.</li></ul><h4>The Analogy, and Efficiency Comparison:</h4><p>The <strong><em>find</em></strong> command in Unix can be likened to a seasoned librarian who knows exactly where every book (file) is located and can quickly retrieve them based on precise criteria. The librarian (find command) can also organize and automate tasks, ensuring the library (file system) remains in perfect order.</p><p>On the other hand, the search function in Windows File Explorer is like a helpful library assistant with a map of the library. The assistant (<strong>File Explorer)</strong> is great for guiding visitors who may not know exactly what they are looking for, offering a user-friendly way to explore the library.</p><p>In terms of efficiency, the <strong><em>find</em></strong> command is generally more powerful for users who need to perform complex searches and automate file management tasks. It offers greater control and precision, making it the preferred tool.</p><h4>PICTURE This:</h4><p>I wrote the text above to show the efficiency of <strong>CLIs</strong>. A quick snippet of advantages/disadvantages below.</p><p><strong>Advantages of CLIs</strong></p><ul><li>speed: you can perform complex tasks with just a few keystrokes.</li><li>automation Capabilities: scripting allows you to automate repetitive tasks.</li><li>resource usage: use fewer resources than GUIs, making them ideal for remote or low-power systems.</li></ul><p><strong>Advantages of GUIs</strong></p><ul><li>user-friendliness: GUIs are more intuitive for most users.</li><li>accessibility: are often more accessible for those with disabilities.</li><li>visual representation: GUIs provide a visual context that can be helpful for complex tasks.</li></ul><h3>Command-line Basics</h3><h4>Managing Files and Directories</h4><p>Commands like <strong><em>cp</em></strong>, <strong><em>mv</em></strong>, <strong><em>rm</em></strong>, and <strong><em>mkdir</em></strong> are the bread and butter of file management. They let you <strong>copy</strong>, <strong>move</strong>, <strong>delete</strong>, and <strong>create(</strong> directories) respectively.</p><pre>mkdir goop</pre><p>This command creates a new directory named ‘<strong>goop</strong>’; like creating/preserving some space in your room to put some stuff in.</p><h4>Permissions Management</h4><p>Managing users and permissions is crucial in <strong>Unix</strong> systems. Commands like <strong><em>chmod</em></strong>, <strong><em>chown</em></strong>, and <strong><em>usermod</em></strong> give you control over who can do what.</p><pre>chmod +x script.sh</pre><p>This command sets the permissions (execute permission in this case) for file: <strong><em>script.sh</em></strong>, so you can run it like this: <strong><em>./script.sh</em></strong></p><h4>Compilation and Build Tools</h4><p>You can simply compile a program in command-line like this, and run its binary.</p><pre>gcc -o hello hello.c &amp;&amp; ./hello</pre><p>This command compiles the <strong>C</strong> program <strong><em>hello</em>.c</strong> into an executable named <strong><em>hello</em></strong>.</p><h3><strong>more</strong> — le(t)ss Talk about Unix in Depth</h3><p>Okay I am going to admit this word play with the heading was a failed attempt to make a joke out of <a href="https://askubuntu.com/questions/1191862/what-is-the-difference-between-more-and-less-commands">more</a> and <a href="https://askubuntu.com/questions/1191862/what-is-the-difference-between-more-and-less-commands">less</a>. Yeah, realized I might as well use <strong><em>sudo</em></strong> for it to play out the way I want, or for the joke to be funny.</p><p>And please do <strong><em>man more</em></strong>, and <strong><em>man less</em></strong> for yourself — in a terminal :)</p><p>I am going to give you just a few more pages of text below for uses of the command-line, and that will be all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v8JAK9CiwP2QfVq6j8KdWw.png" /></figure><p>Here’s a quick primer on how pipes and filters work:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-M8J2copIxDdD51kk5G8LQ.png" /></figure><h3>Pipes</h3><p>The novel idea of Pipes is that you can use the output of a command as the input of another for further processing.</p><p>Example:</p><pre>cat logfile.txt | grep &quot;ERROR&quot; | sort | uniq -c</pre><p>This command sequence(pipe):</p><ul><li>reads the content of <strong>logfile.txt</strong>.</li><li>filters lines containing “<strong><em>ERROR</em></strong>”.</li><li>sorts the filtered lines.</li><li>counts the unique occurrences of each line.</li></ul><h3>Filters</h3><p>Filters are commands that process input and produce refined output. Common filters include <strong><em>grep</em></strong>, <strong><em>sort</em></strong>, <strong><em>uniq</em></strong>, <strong><em>awk</em></strong>, and <strong><em>sed</em></strong>.</p><p>Example:</p><pre>ps aux | grep &#39;python&#39; | awk &#39;{print $2}&#39;</pre><p>This command sequence(filter):</p><ul><li>lists all running processes (<strong><em>ps aux</em></strong> or <strong><em>ps –ef)</em></strong>.</li><li>filters for processes containing the word ‘python’</li><li>extracts the second field (the process ID) from each matching line.</li></ul><h4>A Real-World Scenario:</h4><p>You’re a Django developer, and you need to find and kill all processes related to a misbehaving Django application. Instead of clicking through multiple GUI windows, you can execute a single command:</p><pre>ps -ef | grep runserver | awk &#39;{print $2}&#39; | xargs kill -9</pre><p>This one-liner:</p><ul><li>lists all running processes.</li><li>filters for lines containing ‘runserver ‘.</li><li>extracts the process IDs.</li><li>passes the process IDs to the <em>kill</em> command to terminate them — with a <strong><em>SIGKILL</em></strong>(-9). <strong><em>man 7 signal</em></strong> for this.</li></ul><h4>The Beauty of Pipes and Filters</h4><p>Pipes and filters allow you to build complex bundled tasks from simple commands, making the CLI a flexible and powerful tool for a wide range of tasks. While GUIs offer user-friendly interfaces, they often lack the finer control that the command line provides through piping and filtering.</p><h3>The power of CTRL + R: searching command history w/ the reverse search function</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_mx3vUYkfiMfKloZ2oBPzw.png" /></figure><p>The <strong><em>Ctrl+R</em></strong> shortcut is a powerful feature in<strong> Unix-like</strong> command-line environments that enhances productivity and efficiency. I cannot reiterate enough how efficiency is significantly paramount in CLIs. One of the hidden gems of CLI is <em>Ctrl+R</em>, a feature that exemplifies the command line’s power and elegance. This shortcut allows users to perform reverse incremental searches through their command history — a feature that highlights the command line’s superior efficiency compared to graphical user interfaces (GUIs).</p><h3>What is Ctrl+R?</h3><p><strong>Ctrl+R</strong> is what happens when you press ctrl and R keys on your keyboard. It invokes the reverse search function in the <strong><em>Bash shell</em></strong>, allowing users to quickly find previously executed commands. This feature is especially useful for recalling complex or frequently used commands without retyping them.</p><h4>How It Works:</h4><ol><li>Start the Search: press Ctrl+R in a terminal. The prompt will change to:</li></ol><pre>(reverse-i-search)</pre><p>2. Start Typing: type in a part of the command you want to recall. As you type, the terminal will show the most recent match from your command history.</p><p>3. Refine the Search: continue typing to refine your search. Each additional character will narrow down the results.</p><p>4. Execute or Edit: once you find the desired command, you can press <strong><em>Enter</em></strong> to execute it, or press Ctrl+R again to find the next match. You can also press the right arrow key to edit the command before running it.</p><p>Example</p><p>You previously ran the command <strong><em>wc -l *.txt | sort -n</em></strong> (to count the number of lines in all the .txt files in a directory, and use a pipe to sort the output in ascending order). If you want to rerun this command but can’t remember the exact syntax, simply press <strong><em>Ctrl+R</em></strong> and start typing <strong><em>wc</em></strong>. The terminal will show:</p><pre>(reverse-i-search) `wc&#39;: wc -l *.txt | sort -n</pre><p>You can then press <strong><em>Enter</em></strong> to execute it again or edit it as needed.</p><h4>Why It Matters:</h4><p>The Ctrl+R functionality underscores the command line’s efficiency. GUIs might require navigating through lots of menus or remembering exact file paths. Ctrl+R provides a fast, straightforward way to reuse commands. This capability highlights a key advantage of the CLI over GUIs: the ability to rapidly access previous commands, significantly boosting productivity.</p><h3>Scripting and Automation</h3><p>Shell scripting is essentially bundling together shell commands, and combining other features into the mix. You can automate tasks with simple scripts. Here’s a small example:</p><pre>#!/bin/env bash<br>echo &quot;Hello, $(whoami)! Today is $(date).&quot;</pre><p>This script greets you with your username and the current date — automating the commands that gets you the username, and date. It’s like having your computer say, “good morning, commander of terminals.” Jokes aside — scripts are meant for constructive things. This was just one of my terrible examples.</p><h3>Fan Out and Fan In</h3><p>When dealing with large-scale data processing or parallel tasks, Unix command line tools offer powerful mechanisms to “fan out and fan in.”</p><p>A good example of this is distributing tasks to multiple workers for parallel execution. <strong>Fan out</strong>: situation where a single process spawns multiple child processes. This can occur when a job or command needs to perform multiple tasks in parallel. Each task runs as a separate child process, allowing the parent process to manage and coordinate these tasks. Famous example: <a href="https://en.wikipedia.org/wiki/Cron">cron</a> (info on Wikipedia)</p><h4>Our Own Example: Fanning out</h4><pre>ls *.txt | xargs -n 1 -P 4 gzip</pre><p>Fan Out — Here, the <strong><em>gzip</em></strong> command is applied to each text file in parallel, up to 4 processes at a time.</p><p>Example: <strong>Fan In</strong> — Aggregating the results from parallel tasks.</p><pre>ls *.gz | xargs du -ch</pre><p>This command collects the sizes of the compressed files and provides a total, summarizing the results.</p><h3>Future of the Command Line, Final Thoughts</h3><p>The command line continues to evolve with enhancements from auto-completion, improved scripting capabilities, regular expressions and integration with modern development tools to even making and deploying infrastructure and cloud resources using markup language like <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-formats.html"><strong>YAML</strong></a>. Also, innovations in shell environments, such as PowerShell on Windows blur the lines between traditional Unix and other operating systems. Let me use this — from Windows — before I get in trouble for bias.</p><p>Now, this is not a write-up to spread some useless obsession, or spreading a trivial gospel or a UNIX religion. I wanted someone out there to get exposure to shells if they wished to but never got the motivation to start. And as you dive deeper into the command line, remember to have fun with it. Embrace the quirks that come with trying things out. After all, in the words of a famous Unix joke, “To err is human, but to really foul things up, you need root access.” I hope you loved all this; I had fun prepping it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3c775092832" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>