<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Snigdha Chaudhari</title>
    <description>The latest articles on DEV Community by Snigdha Chaudhari (@snigdha_chaudhari).</description>
    <link>https://dev.to/snigdha_chaudhari</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3948596%2F822c9b54-1ac4-4334-a6d8-f91f28db49b0.png</url>
      <title>DEV Community: Snigdha Chaudhari</title>
      <link>https://dev.to/snigdha_chaudhari</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/snigdha_chaudhari"/>
    <language>en</language>
    <item>
      <title>Learning Linux? Don't Start by Memorising Commands</title>
      <dc:creator>Snigdha Chaudhari</dc:creator>
      <pubDate>Sun, 09 Aug 2026 09:19:53 +0000</pubDate>
      <link>https://dev.to/snigdha_chaudhari/learning-linux-dont-start-by-memorising-commands-4ljg</link>
      <guid>https://dev.to/snigdha_chaudhari/learning-linux-dont-start-by-memorising-commands-4ljg</guid>
      <description>&lt;p&gt;When I first started learning Linux, I thought I needed to remember a lot of commands.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ps&lt;/code&gt;, &lt;code&gt;top&lt;/code&gt;, &lt;code&gt;systemctl&lt;/code&gt;, &lt;code&gt;journalctl&lt;/code&gt;, &lt;code&gt;chmod&lt;/code&gt;, &lt;code&gt;chown&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;find&lt;/code&gt;...&lt;/p&gt;

&lt;p&gt;The list kept growing.&lt;/p&gt;

&lt;p&gt;But knowing what a command does is not always the same as knowing when to use it.&lt;/p&gt;

&lt;p&gt;I could read that &lt;code&gt;journalctl&lt;/code&gt; shows logs, but that didn't automatically tell me why I should check logs when a service fails. I knew &lt;code&gt;chmod&lt;/code&gt; changes permissions, but that made much more sense once I actually saw a script return &lt;code&gt;Permission denied&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;What helped was connecting the commands to the things happening on the system.&lt;/p&gt;

&lt;p&gt;A process is running. A service manages it. Logs help explain what happened. Files and configuration live in different parts of the filesystem. Permissions and ownership decide who can access them.&lt;/p&gt;

&lt;p&gt;Once those pieces started connecting, the commands stopped feeling like random things I had to memorise.&lt;/p&gt;

&lt;p&gt;So if you're learning Linux too, these are the things worth understanding first.&lt;/p&gt;




&lt;h2&gt;
  
  
  First, understand what's happening underneath
&lt;/h2&gt;

&lt;p&gt;You don't need to go extremely deep into Linux internals at the beginning. But understanding a few basic pieces makes everything else easier.&lt;/p&gt;

&lt;p&gt;A simplified view looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Applications
     ↓
Shell
     ↓
Kernel
     ↓
Hardware
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;hardware&lt;/strong&gt; is the physical machine: CPU, memory, storage and network interfaces.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;kernel&lt;/strong&gt; is the core of Linux. It handles things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Processes&lt;/li&gt;
&lt;li&gt;Memory&lt;/li&gt;
&lt;li&gt;File systems&lt;/li&gt;
&lt;li&gt;Communication with hardware&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;strong&gt;shell&lt;/strong&gt; is where you interact with the system using commands.&lt;/p&gt;

&lt;p&gt;When you run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the shell interprets your command and asks the operating system to perform the required action.&lt;/p&gt;

&lt;p&gt;So a simple way to think about it is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You → Shell → Linux
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is already more useful than just memorising what &lt;code&gt;ls&lt;/code&gt; does.&lt;/p&gt;




&lt;h2&gt;
  
  
  A program running is a process
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;process&lt;/strong&gt; is simply a program that is currently running.&lt;/p&gt;

&lt;p&gt;Each process has a unique Process ID, or &lt;strong&gt;PID&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To see running processes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful when you want to answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What's running on this machine?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If the system feels slow, you probably want to know which process is using resources.&lt;/p&gt;

&lt;p&gt;For that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;top
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;top&lt;/code&gt; gives you a live view of processes along with CPU and memory usage.&lt;/p&gt;

&lt;p&gt;To find a specific process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux | &lt;span class="nb"&gt;grep &lt;/span&gt;nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if you already know the PID and want more details:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps &lt;span class="nt"&gt;-p&lt;/span&gt; &amp;lt;PID&amp;gt; &lt;span class="nt"&gt;-o&lt;/span&gt; pid,ppid,command
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can help you see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The process ID&lt;/li&gt;
&lt;li&gt;Its parent process&lt;/li&gt;
&lt;li&gt;The command used to start it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a process needs to be stopped:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;kill&lt;/span&gt; &amp;lt;PID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if it refuses to stop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;kill&lt;/span&gt; &lt;span class="nt"&gt;-9&lt;/span&gt; &amp;lt;PID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But force-stopping a process should not be the first thing you do. First understand what the process is and why it's running.&lt;/p&gt;




&lt;h2&gt;
  
  
  A service is not quite the same thing as a process
&lt;/h2&gt;

&lt;p&gt;This was one of the concepts that helped things connect.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;process&lt;/strong&gt; is something currently running.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;service&lt;/strong&gt; is a program that the operating system manages.&lt;/p&gt;

&lt;p&gt;For example, Nginx runs as one or more processes, but you usually manage it as a service.&lt;/p&gt;

&lt;p&gt;On Linux systems using &lt;code&gt;systemd&lt;/code&gt;, that means you can check its status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable it to start automatically after a reboot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And check whether it is enabled:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl is-enabled nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The difference between these two is worth remembering:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;start  → start the service now
enable → start the service automatically during boot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So if a web server isn't working, &lt;code&gt;systemctl status nginx&lt;/code&gt; is often a much better starting point than randomly trying commands.&lt;/p&gt;




&lt;h2&gt;
  
  
  If something breaks, check what happened
&lt;/h2&gt;

&lt;p&gt;This is where logs come in.&lt;/p&gt;

&lt;p&gt;A service might fail because of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A bad configuration&lt;/li&gt;
&lt;li&gt;Missing files&lt;/li&gt;
&lt;li&gt;Port conflicts&lt;/li&gt;
&lt;li&gt;Permission issues&lt;/li&gt;
&lt;li&gt;Dependency problems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of guessing, check the logs.&lt;/p&gt;

&lt;p&gt;For a service managed by &lt;code&gt;systemd&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To see the latest entries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; nginx &lt;span class="nt"&gt;-n&lt;/span&gt; 50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To watch logs live:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; nginx &lt;span class="nt"&gt;-f&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or to check recent activity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; nginx &lt;span class="nt"&gt;--since&lt;/span&gt; &lt;span class="s2"&gt;"10 min ago"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For normal log files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important thing isn't memorising all the &lt;code&gt;journalctl&lt;/code&gt; options.&lt;/p&gt;

&lt;p&gt;It's remembering:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Service has a problem? Check its status. Then check its logs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That simple flow already covers a lot of basic troubleshooting.&lt;/p&gt;




&lt;h2&gt;
  
  
  Know where to look
&lt;/h2&gt;

&lt;p&gt;Linux has a standard filesystem structure, and knowing a few important locations can save you a lot of time.&lt;/p&gt;

&lt;p&gt;Everything starts from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some directories you'll run into often are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/home      → User home directories
/root      → Root user's home directory
/etc       → System and application configuration
/var/log   → Logs
/tmp       → Temporary files
/bin       → Essential commands
/usr/bin   → Common system commands and utilities
/opt       → Optional or third-party software
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't need to memorise the entire filesystem hierarchy.&lt;/p&gt;

&lt;p&gt;But knowing that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;configuration is often in &lt;code&gt;/etc&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;logs are often in &lt;code&gt;/var/log&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;user files are usually under &lt;code&gt;/home&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;gives you a much better starting point when investigating something.&lt;/p&gt;

&lt;p&gt;To see where you currently are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To move around:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /var/log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To move back one directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To list files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more details:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And to include hidden files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Disk full? Don't guess—find out what's using it
&lt;/h2&gt;

&lt;p&gt;A server running out of disk space is a common problem.&lt;/p&gt;

&lt;p&gt;First, check the available disk space:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you need to see how much space files or directories are using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if you suspect logs are growing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; /var/log/&lt;span class="k"&gt;*&lt;/span&gt; 2&amp;gt;/dev/null | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; | &lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This checks the sizes of entries inside &lt;code&gt;/var/log&lt;/code&gt;, sorts them, and shows the largest ones.&lt;/p&gt;

&lt;p&gt;Again, the command is easier to remember when you connect it to the question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What's using my disk space?&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Files: create them, read them, change them
&lt;/h2&gt;

&lt;p&gt;Creating a file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;notes.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating a directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;projects
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating nested directories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; project/app/logs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To read a file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;notes.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a large file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;less notes.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To see the first few lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 5 notes.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To see the last few:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 5 notes.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One small thing that is easy to forget:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; notes.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;&amp;gt;&lt;/code&gt; writes to the file by replacing its existing content.&lt;/p&gt;

&lt;p&gt;But:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; notes.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;adds the content to the end.&lt;/p&gt;

&lt;p&gt;A simple reminder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;   = overwrite
&amp;gt;&amp;gt;  = append
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello"&lt;/span&gt; | &lt;span class="nb"&gt;tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; notes.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This writes to the file while also showing the output on the screen.&lt;/p&gt;




&lt;h2&gt;
  
  
  Permissions explain a lot of "Permission denied" errors
&lt;/h2&gt;

&lt;p&gt;Linux permissions are based on three things:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;r → read
w → write
x → execute
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These permissions are applied to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Owner | Group | Others
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can check them using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-rwxr-xr-x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can be read as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Owner   → rwx
Group   → r-x
Others  → r-x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Permissions can be changed using &lt;code&gt;chmod&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To make a script executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To remove write permission:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; &lt;span class="nt"&gt;-w&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also use numeric permissions.&lt;/p&gt;

&lt;p&gt;The values are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;read    = 4
write   = 2
execute = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod &lt;/span&gt;755 script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;means:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;7 → read + write + execute
5 → read + execute
5 → read + execute
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This becomes easier to understand when you actually see the result.&lt;/p&gt;

&lt;p&gt;A script without execute permission:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can return:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Permission denied
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add execute permission:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and it can run again.&lt;/p&gt;

&lt;p&gt;That one error teaches more about &lt;code&gt;chmod&lt;/code&gt; than memorising the command definition ever will.&lt;/p&gt;




&lt;h2&gt;
  
  
  Permissions and ownership are different
&lt;/h2&gt;

&lt;p&gt;This is another important distinction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Permissions&lt;/strong&gt; answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What can people do with this file?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Ownership&lt;/strong&gt; answers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Who does this file belong to?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every Linux file has an owner and a group.&lt;/p&gt;

&lt;p&gt;You can check both using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-rw-rw-r-- 1 ubuntu developers file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Owner → ubuntu
Group → developers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To change the owner:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chown &lt;/span&gt;username file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To change only the group:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chgrp &lt;/span&gt;groupname file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To change both:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chown &lt;/span&gt;username:groupname file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For an entire directory and everything inside it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; username:groupname directory/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-R&lt;/code&gt; means recursive.&lt;/p&gt;

&lt;p&gt;The easiest way to remember these commands is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod → changes permissions
chown → changes owner
chgrp → changes group
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And after making changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always verify.&lt;/p&gt;




&lt;h2&gt;
  
  
  Don't just run commands. Verify what changed.
&lt;/h2&gt;

&lt;p&gt;One thing that kept coming up while practising Linux was this:&lt;/p&gt;

&lt;p&gt;Running a command doesn't mean the job is finished.&lt;/p&gt;

&lt;p&gt;If you start a service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you change permissions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you change ownership:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chown &lt;/span&gt;user:group file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A good habit is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Change something
      ↓
Check the result
      ↓
Test that it works
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That habit is useful far beyond Linux.&lt;/p&gt;




&lt;h2&gt;
  
  
  The commands I would remember first
&lt;/h2&gt;

&lt;p&gt;If I had to reduce everything down to a small set, I wouldn't try to remember commands alphabetically.&lt;/p&gt;

&lt;p&gt;I'd remember them by the questions they help answer.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's running?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux
top
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Is the service healthy?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl status &amp;lt;service&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why did the service fail?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; &amp;lt;service&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What is using disk space?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Where am I and what's here?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;pwd
ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Who owns this file and what permissions does it have?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why can't I run this script?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; script.sh
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Where is this file?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find / &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"filename"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These aren't the only commands worth learning.&lt;/p&gt;

&lt;p&gt;They're just a useful starting point because they answer real questions you are likely to ask.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final thought
&lt;/h2&gt;

&lt;p&gt;Linux started making more sense when I stopped treating commands like flashcards.&lt;/p&gt;

&lt;p&gt;The command matters, but the problem behind it matters more.&lt;/p&gt;

&lt;p&gt;Instead of trying to remember:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;journalctl&lt;/code&gt; shows logs&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I now think:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;My service isn't working. What happened? Check the logs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;chmod&lt;/code&gt; changes permissions&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I think:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This script says "Permission denied." Does it have execute permission?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;du&lt;/code&gt; shows disk usage&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I think:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The server is running out of space. What's taking it?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The commands eventually become easier to remember because you're connecting them to situations.&lt;/p&gt;

&lt;p&gt;And I think that's a much better place to start when learning Linux.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>learning</category>
      <category>linux</category>
    </item>
    <item>
      <title>90 Days of DevOps, Day 4-6: Turning Linux Practice Into Real Troubleshooting</title>
      <dc:creator>Snigdha Chaudhari</dc:creator>
      <pubDate>Sat, 01 Aug 2026 05:56:39 +0000</pubDate>
      <link>https://dev.to/snigdha_chaudhari/what-i-found-when-i-actually-looked-at-whats-running-on-my-mac-1mod</link>
      <guid>https://dev.to/snigdha_chaudhari/what-i-found-when-i-actually-looked-at-whats-running-on-my-mac-1mod</guid>
      <description>&lt;p&gt;&lt;em&gt;Part of &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;#90DaysOfDevOps&lt;/a&gt; - a 90-day challenge to build Linux and DevOps fundamentals, one small hands-on task a day. This post covers Day 4 (process &amp;amp; service checks), Day 5 (a troubleshooting drill), and Day 6 (basic file read/write) as one story, because they turned into one.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Day 4's task was simple on paper: run a few basic commands, check what's running, inspect one service. I started with the most basic one there is.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I sorted by memory to see the bigger picture.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;top &lt;span class="nt"&gt;-l&lt;/span&gt; 1 &lt;span class="nt"&gt;-o&lt;/span&gt; mem &lt;span class="nt"&gt;-n&lt;/span&gt; 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fviqnfmdvvqd877bgs7r5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fviqnfmdvvqd877bgs7r5.png" alt=" " width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;727 processes. On a machine where I thought I had ten things open. Most of it was normal background stuff — Chrome runs a separate process per tab, so five "Chrome Helper" entries isn't strange. But two entries stood out: &lt;code&gt;mysqld&lt;/code&gt; at 515MB, and &lt;code&gt;node&lt;/code&gt; at 348MB, both idling, both things I hadn't opened today.&lt;/p&gt;

&lt;p&gt;I checked what the node one actually was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps &lt;span class="nt"&gt;-p&lt;/span&gt; 745 &lt;span class="nt"&gt;-o&lt;/span&gt; pid,ppid,command
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It was OpenClaw — one of the AI automation agent tools I'd installed myself a while back, because I genuinely like building with it. Nothing sinister. But its parent process ID was &lt;code&gt;1&lt;/code&gt;, meaning it hadn't been started by me clicking anything today — it had been started by launchd, the thing that boots every service on a Mac, at login.&lt;/p&gt;

&lt;p&gt;So I checked what else was set up the same way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; ~/Library/LaunchAgents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9j2uugh8lmm6mlgy44ua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9j2uugh8lmm6mlgy44ua.png" alt=" " width="799" height="465"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Five files. Three belonged to Chrome's updater. Two were mine — OpenClaw and Hermes, another agent tool I'd set up. I'd installed both on purpose. What I hadn't clocked was that they were both registered as &lt;strong&gt;LaunchAgents with &lt;code&gt;RunAtLoad: true&lt;/code&gt;&lt;/strong&gt; — meaning launchd fires them up automatically every single time I log in, forever, whether I open them that day or not. And both had &lt;code&gt;KeepAlive: true&lt;/code&gt;, meaning even if I killed the process by hand, launchd would just restart it. I'd never actually stopped either one — I'd just closed the terminal window I originally started them from, and they kept quietly running underneath that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Furcawxk2btgvqo39tuhj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Furcawxk2btgvqo39tuhj.png" alt=" " width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsaibyk8kixrl5tbn1309.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsaibyk8kixrl5tbn1309.png" alt=" " width="800" height="717"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I decided I didn't want them running 24/7 anymore, so I stopped them the right way — through launchd, not with &lt;code&gt;kill&lt;/code&gt; (which would have just triggered a restart) — removed their startup files, and uninstalled the leftover pieces, including a launcher for Hermes still sitting on my PATH pointing at a folder I'd already deleted.&lt;/p&gt;

&lt;p&gt;One thing was still unexplained, though: &lt;code&gt;mysqld&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Day 5: actually finding out why MySQL was running
&lt;/h2&gt;

&lt;p&gt;Day 5's task was a proper troubleshooting drill — pick a service, check its health, read its logs, write it up as a runbook. MySQL was the obvious target.&lt;/p&gt;

&lt;p&gt;Health-wise it was fine — 0.2% CPU, idle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps &lt;span class="nt"&gt;-o&lt;/span&gt; pid,pcpu,pmem,etime,comm &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;pgrep &lt;span class="nt"&gt;-x&lt;/span&gt; mysqld&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I checked what was listening on its port:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsof &lt;span class="nt"&gt;-i&lt;/span&gt; :3306
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Empty. But when I actually tried connecting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nc &lt;span class="nt"&gt;-vz&lt;/span&gt; localhost 3306
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;"Connection succeeded." Contradiction. Turned out &lt;code&gt;lsof&lt;/code&gt; only shows processes &lt;em&gt;you&lt;/em&gt; own unless you run it with sudo, and mysqld runs as a different system user. Empty didn't mean nothing was there — it meant I wasn't allowed to see it yet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;lsof &lt;span class="nt"&gt;-i&lt;/span&gt; :3306
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's when I found the actual issue: it wasn't just listening on my machine, it was listening on &lt;code&gt;*:3306&lt;/code&gt; — every network interface, not just localhost. Same on a second port, 33060. A database on my personal laptop had been reachable from any network I connected to, not just from me.&lt;/p&gt;

&lt;p&gt;I checked when it had even arrived:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pkgutil &lt;span class="nt"&gt;--pkg-info&lt;/span&gt; com.mysql.mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;November 2025. Running at every boot since, and inside it, one database called &lt;code&gt;employee_db&lt;/code&gt; — almost certainly leftover from some SQL course I'd followed along with last winter. Healthy, clean logs, nothing wrong with it — it just had no reason to still be running, and definitely no reason to be network-reachable. Backed up the data folder, then removed it the same way: stopped through launchd, registration removed, software uninstalled.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm4v4bi6g1eoz97zi3wft.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm4v4bi6g1eoz97zi3wft.png" alt=" " width="800" height="439"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpuowrpfr1josg918y2j4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpuowrpfr1josg918y2j4.png" alt=" " width="800" height="435"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Day 6: back to basics
&lt;/h2&gt;

&lt;p&gt;After two days of chasing down services, Day 6 was refreshingly small: create a text file, write into it, read it back. Three ways to put text in a file, and the difference between them turned out to matter a lot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Line 1"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; notes.txt      &lt;span class="c"&gt;# replace the whole file&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Line 2"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; notes.txt     &lt;span class="c"&gt;# add to the end&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Line 3"&lt;/span&gt; | &lt;span class="nb"&gt;tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; notes.txt  &lt;span class="c"&gt;# add to the end AND show it on screen&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2iuhv9n65rr3my5y6cwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2iuhv9n65rr3my5y6cwy.png" alt=" " width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Small lesson, but it's the same instinct as the last two days: read what's already there before deciding whether to overwrite it or add to it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually happened this week
&lt;/h2&gt;

&lt;p&gt;I went in expecting three small tasks. What I actually did was realize two tools I'd installed on purpose had quietly been running non-stop since I set them up, find an unrelated database that had been exposed to the network for eight months, and clean up all three properly instead of just force-quitting and hoping.&lt;/p&gt;

&lt;p&gt;Biggest lesson: &lt;strong&gt;an empty result from a command doesn't always mean "nothing's here."&lt;/strong&gt; &lt;code&gt;lsof&lt;/code&gt; without sudo told me nothing was on port 3306. It was wrong — or more accurately, it just wasn't allowed to tell me. One flag fixed it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Command reference — for future me
&lt;/h2&gt;

&lt;p&gt;The commands below, grouped by what question they answer, with the Linux equivalent next to the macOS one I actually used. macOS uses &lt;strong&gt;launchd&lt;/strong&gt; where Linux uses &lt;strong&gt;systemd&lt;/strong&gt; — different tool, same job: start services, keep them alive, own their logs.&lt;/p&gt;

&lt;h3&gt;
  
  
  "What's running right now?"
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What I want to know&lt;/th&gt;
&lt;th&gt;macOS&lt;/th&gt;
&lt;th&gt;Linux&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;List all processes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ps aux&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ps aux&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Live view, sorted by memory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;top -l 1 -o mem -n 8&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;top -b -n 1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Find a process by name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;pgrep -l &amp;lt;name&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;pgrep -l &amp;lt;name&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Full detail on one PID&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ps -p &amp;lt;pid&amp;gt; -o pid,ppid,command&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;same&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;PPID 1&lt;/strong&gt; means launchd/systemd started it, not a person clicking something. That's the tell for "this is an auto-starting service."&lt;/p&gt;

&lt;h3&gt;
  
  
  "What auto-starts, and how do I see its config?"
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What I want to know&lt;/th&gt;
&lt;th&gt;macOS&lt;/th&gt;
&lt;th&gt;Linux&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Things that start when &lt;em&gt;I&lt;/em&gt; log in&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ls ~/Library/LaunchAgents&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;user systemd units, &lt;code&gt;systemctl --user list-units&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Things that start at boot, system-wide&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ls /Library/LaunchDaemons&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;systemctl list-units --type=service&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Is &lt;em&gt;this&lt;/em&gt; service running, and its config&lt;/td&gt;
&lt;td&gt;`launchctl list \&lt;/td&gt;
&lt;td&gt;grep &lt;code&gt; then read its &lt;/code&gt;.plist`&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;System-owned services (needs sudo)&lt;/td&gt;
&lt;td&gt;`sudo launchctl list \&lt;/td&gt;
&lt;td&gt;grep `&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Key config flags to look for in a &lt;code&gt;.plist&lt;/code&gt; (or a systemd unit): &lt;code&gt;RunAtLoad&lt;/code&gt;/&lt;code&gt;WantedBy&lt;/code&gt; = starts automatically. &lt;code&gt;KeepAlive&lt;/code&gt;/&lt;code&gt;Restart=&lt;/code&gt; = comes back if killed. If both are set, &lt;code&gt;kill&lt;/code&gt; will not work — you have to stop it through the supervisor.&lt;/p&gt;

&lt;h3&gt;
  
  
  "How do I actually stop something for good?"
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;macOS&lt;/th&gt;
&lt;th&gt;Linux&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1. Stop it via the supervisor&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;launchctl bootout gui/$(id -u) &amp;lt;path-to-plist&amp;gt;&lt;/code&gt; (user) or &lt;code&gt;sudo launchctl bootout system &amp;lt;path&amp;gt;&lt;/code&gt; (system-wide)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;systemctl stop &amp;lt;name&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2. Stop it from coming back&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rm &amp;lt;path-to-plist&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;systemctl disable &amp;lt;name&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. Remove the software&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;rm -rf&lt;/code&gt;, &lt;code&gt;npm uninstall -g&lt;/code&gt;, or the app's uninstaller&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;apt remove&lt;/code&gt; / &lt;code&gt;yum remove&lt;/code&gt; etc&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. Verify it's gone&lt;/td&gt;
&lt;td&gt;`launchctl list \&lt;/td&gt;
&lt;td&gt;grep &lt;code&gt; and &lt;/code&gt;pgrep -fl ` — both should be empty&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Never just &lt;code&gt;kill&lt;/code&gt; something with &lt;code&gt;KeepAlive&lt;/code&gt;/&lt;code&gt;Restart&lt;/code&gt; set. Always go through the supervisor first.&lt;/p&gt;

&lt;h3&gt;
  
  
  "Is anything listening on a port, and who?"
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What I want to know&lt;/th&gt;
&lt;th&gt;macOS&lt;/th&gt;
&lt;th&gt;Linux&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;What's listening on a port&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lsof -i :&amp;lt;port&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ss -tulpn&lt;/code&gt; or &lt;code&gt;lsof -i :&amp;lt;port&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;See services owned by &lt;em&gt;other&lt;/em&gt; users too&lt;/td&gt;
&lt;td&gt;add &lt;code&gt;sudo&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;usually no sudo needed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Can I actually reach it&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;nc -vz localhost &amp;lt;port&amp;gt;&lt;/code&gt; or &lt;code&gt;curl -I&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;same&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If a plain &lt;code&gt;lsof&lt;/code&gt;/&lt;code&gt;ss&lt;/code&gt; shows nothing but you know something's there — re-run with &lt;code&gt;sudo&lt;/code&gt;. Empty output can mean "wrong permissions," not "nothing's here."&lt;/p&gt;

&lt;p&gt;Also check &lt;strong&gt;what it's bound to&lt;/strong&gt;: &lt;code&gt;localhost&lt;/code&gt; / &lt;code&gt;127.0.0.1&lt;/code&gt; = only reachable from this machine. &lt;code&gt;*&lt;/code&gt; or &lt;code&gt;::&lt;/code&gt; = reachable from the whole network. The second one is usually a mistake on a laptop.&lt;/p&gt;

&lt;h3&gt;
  
  
  "Where are its logs?"
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What I want to know&lt;/th&gt;
&lt;th&gt;macOS&lt;/th&gt;
&lt;th&gt;Linux&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;System-wide unified log&lt;/td&gt;
&lt;td&gt;&lt;code&gt;log show --last 5m --predicate 'process == "&amp;lt;name&amp;gt;"'&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;journalctl -u &amp;lt;name&amp;gt; -n 50&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A specific log file&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tail -n 50 &amp;lt;path&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tail -n 50 &amp;lt;path&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Not every service uses the system log — some (like MySQL) write their own log file. Check the service's own directory or its config for where it actually logs.&lt;/p&gt;

&lt;h3&gt;
  
  
  "Is the machine healthy?"
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What I want to know&lt;/th&gt;
&lt;th&gt;macOS&lt;/th&gt;
&lt;th&gt;Linux&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Disk space free&lt;/td&gt;
&lt;td&gt;&lt;code&gt;df -h /&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;df -h&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What's using the disk&lt;/td&gt;
&lt;td&gt;&lt;code&gt;du -sh &amp;lt;folder&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;same&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;vm_stat&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;free -h&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Load average&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;iostat&lt;/code&gt; (bottom right) or &lt;code&gt;uptime&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;uptime&lt;/code&gt;, &lt;code&gt;vmstat&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Reading and writing files — the Day 6 basics
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What I want&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Create an empty file&lt;/td&gt;
&lt;td&gt;&lt;code&gt;touch file.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;does nothing if it already exists&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Write, replacing the file&lt;/td&gt;
&lt;td&gt;&lt;code&gt;echo "text" &amp;gt; file.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;wipes anything already in the file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Write, adding to the end&lt;/td&gt;
&lt;td&gt;&lt;code&gt;echo "text" &amp;gt;&amp;gt; file.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;safe, doesn't touch what's there&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Write and see it at once&lt;/td&gt;
&lt;td&gt;`echo "text" \&lt;/td&gt;
&lt;td&gt;tee -a file.txt`&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Read the whole file&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cat file.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Read just the top&lt;/td&gt;
&lt;td&gt;&lt;code&gt;head -n &amp;lt;N&amp;gt; file.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Read just the end&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;tail -n &amp;lt;N&amp;gt; file.txt&lt;/code&gt;, or &lt;code&gt;tail -f&lt;/code&gt; to watch it live&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;-f&lt;/code&gt; is what you use to watch a log grow&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  The one habit worth keeping from all three days
&lt;/h3&gt;

&lt;p&gt;Snapshot before you touch anything. Interpret before you act. If something needs to stop, stop it through whatever's supervising it, never with a bare &lt;code&gt;kill&lt;/code&gt;. And treat "no output" as a question, not an answer — check if you're even allowed to see the whole picture before you trust it.&lt;/p&gt;

</description>
      <category>90daysofdevops</category>
      <category>devopskajosh</category>
      <category>trainwithshubham</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
