<?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: Sheikh Hassaan Bin Nadeem</title>
    <description>The latest articles on DEV Community by Sheikh Hassaan Bin Nadeem (@sheikhhassaanbinnadeem).</description>
    <link>https://dev.to/sheikhhassaanbinnadeem</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3022926%2Fc28fa0ae-c8c5-478c-99c5-b52f3b8df216.jpg</url>
      <title>DEV Community: Sheikh Hassaan Bin Nadeem</title>
      <link>https://dev.to/sheikhhassaanbinnadeem</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sheikhhassaanbinnadeem"/>
    <language>en</language>
    <item>
      <title>How to Take Remote Backups Using rsync Over SSH (Day 12 of 30)</title>
      <dc:creator>Sheikh Hassaan Bin Nadeem</dc:creator>
      <pubDate>Mon, 05 May 2025 22:25:38 +0000</pubDate>
      <link>https://dev.to/sheikhhassaanbinnadeem/how-to-take-remote-backups-using-rsync-over-ssh-day-12-of-30-5c02</link>
      <guid>https://dev.to/sheikhhassaanbinnadeem/how-to-take-remote-backups-using-rsync-over-ssh-day-12-of-30-5c02</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Why Organizations Still Use rsync&lt;/li&gt;
&lt;li&gt;Understanding rsync and SSH&lt;/li&gt;
&lt;li&gt;Step-by-Step Guide to Remote Backups&lt;/li&gt;
&lt;li&gt;Real-World Use Case&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;Backups are essential for any system administrator. While many organizations invest in commercial backup solutions like Veritas NetBackup, Veeam, or Windows NT Backup, there's a simpler, open-source tool that's been trusted for years: &lt;strong&gt;rsync&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In this article, we'll explore how to use &lt;code&gt;rsync&lt;/code&gt; over SSH to perform remote backups efficiently and securely.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Why Organizations Still Use rsync
&lt;/h2&gt;

&lt;p&gt;Despite the availability of commercial tools, many organizations prefer &lt;code&gt;rsync&lt;/code&gt; because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simplicity&lt;/strong&gt;: Easy to set up and use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficiency&lt;/strong&gt;: Transfers only changed files, saving bandwidth and time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt;: Works seamlessly over SSH for encrypted transfers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility&lt;/strong&gt;: Suitable for various backup scenarios, from small directories to entire systems.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Understanding rsync and SSH
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;rsync&lt;/code&gt; is a command-line utility that synchronizes files and directories between two locations. When combined with SSH, it allows secure data transfer over networks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic Syntax&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="o"&gt;[&lt;/span&gt;options] &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;source&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;user@remote_host:destination]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Common Options&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-a&lt;/code&gt;: Archive mode (preserves permissions, timestamps, symbolic links, etc.)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-v&lt;/code&gt;: Verbose output&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-z&lt;/code&gt;: Compress data during transfer&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-e ssh&lt;/code&gt;: Use SSH for data transfer&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Step-by-Step Guide to Remote Backups
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Ensure rsync is Installed&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On most Linux systems, &lt;code&gt;rsync&lt;/code&gt; is pre-installed. To check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If not installed, you can install it using your package manager:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For Red hat/CentOS:
&lt;/li&gt;
&lt;/ul&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;yum &lt;span class="nb"&gt;install &lt;/span&gt;rsync
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For Debian/Ubuntu:
&lt;/li&gt;
&lt;/ul&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;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;rsync
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Perform the Backup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To back up a directory from a remote server to your local machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-avz&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; ssh user@remote_host:/path/to/remote/directory /path/to/local/destination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-avz&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; ssh user@192.168.1.100:/var/www/html /home/user/backup/html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connect to &lt;code&gt;remote_host&lt;/code&gt; as &lt;code&gt;user&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Synchronize the &lt;code&gt;/var/www/html&lt;/code&gt; directory from the remote server to &lt;code&gt;/home/user/backup/html&lt;/code&gt; on the local machine.&lt;/li&gt;
&lt;li&gt;Preserve file permissions, timestamps, and compress data during transfer.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. Real-World Use Case
&lt;/h2&gt;

&lt;p&gt;Imagine you're managing a web server hosted on AWS, and you want to back up the website files to your local machine daily.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Set Up SSH Access&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ensure you can SSH into the remote server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh user@192.168.1.100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Create a Backup Script&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a script named &lt;code&gt;backup.sh&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;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
rsync &lt;span class="nt"&gt;-avz&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; ssh user@192.168.1.100:/var/www/html /home/user/backup/html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make the 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 backup.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Schedule the Backup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;cron&lt;/code&gt; to schedule the backup daily at 2 AM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;0 2 &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; /path/to/backup.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This setup ensures that your website files are backed up daily without manual intervention.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Summary
&lt;/h2&gt;

&lt;p&gt;While commercial backup solutions offer advanced features, &lt;code&gt;rsync&lt;/code&gt; remains a reliable and efficient tool for many organizations. Its simplicity, combined with the security of SSH, makes it an excellent choice for remote backups.&lt;/p&gt;

&lt;p&gt;By following the steps outlined above, you can set up automated, secure backups for your systems, ensuring data integrity and peace of mind.&lt;/p&gt;

&lt;p&gt;Connect with me on LinkedIn: &lt;a href="https://linkedin.com/comm/mynetwork/discovery-see-all?usecase=PEOPLE_FOLLOWS&amp;amp;followMember=sheikhhassaanbinnadeem" rel="noopener noreferrer"&gt;https://linkedin.com/comm/mynetwork/discovery-see-all?usecase=PEOPLE_FOLLOWS&amp;amp;followMember=sheikhhassaanbinnadeem&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>redhat</category>
      <category>devops</category>
      <category>cloudwhistler</category>
    </item>
    <item>
      <title>Access Control Lists in Linux for Granular Permissions (Day 11 of 30)</title>
      <dc:creator>Sheikh Hassaan Bin Nadeem</dc:creator>
      <pubDate>Sun, 04 May 2025 22:35:01 +0000</pubDate>
      <link>https://dev.to/sheikhhassaanbinnadeem/access-control-lists-in-linux-for-granular-permissions-day-11-of-30-1b79</link>
      <guid>https://dev.to/sheikhhassaanbinnadeem/access-control-lists-in-linux-for-granular-permissions-day-11-of-30-1b79</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
Introduction
&lt;/li&gt;
&lt;li&gt;
Why Traditional Permissions Fall Short
&lt;/li&gt;
&lt;li&gt;
What Are ACLs and When to Use Them
&lt;/li&gt;
&lt;li&gt;
Basic ACL Commands: getfacl and setfacl
&lt;/li&gt;
&lt;li&gt;
Real-World Examples
&lt;/li&gt;
&lt;li&gt;
Removing and Managing ACLs
&lt;/li&gt;
&lt;li&gt;
Best Practices
&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;In Linux, we usually use &lt;code&gt;chmod&lt;/code&gt; and &lt;code&gt;chown&lt;/code&gt; to manage file permissions. That works well when you just need to give access to one user and one group. But what if you need to give access to multiple users or different groups on the same file?&lt;/p&gt;

&lt;p&gt;That's where &lt;strong&gt;ACLs (Access Control Lists)&lt;/strong&gt; come in. They allow you to control file access in a much more detailed way.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Why Traditional Permissions Fall Short
&lt;/h2&gt;

&lt;p&gt;Standard permissions only allow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One owner (user)&lt;/li&gt;
&lt;li&gt;One group&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s say you want to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Give &lt;strong&gt;read-only access&lt;/strong&gt; to one user&lt;/li&gt;
&lt;li&gt;Allow &lt;strong&gt;full access&lt;/strong&gt; to another user&lt;/li&gt;
&lt;li&gt;And &lt;strong&gt;block a group&lt;/strong&gt; from accessing the file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can’t do this with just &lt;code&gt;chmod&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;ACLs solve this problem easily.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. What Are ACLs and When to Use Them
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ACL&lt;/strong&gt; stands for &lt;strong&gt;Access Control List&lt;/strong&gt;. It gives you the ability to assign file permissions to &lt;strong&gt;multiple users or groups&lt;/strong&gt; not just the owner and one group.&lt;/p&gt;

&lt;p&gt;When should you use ACLs?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When files need to be shared between many users&lt;/li&gt;
&lt;li&gt;When group permissions are not enough&lt;/li&gt;
&lt;li&gt;In team or project folders with different roles&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Basic ACL Commands: &lt;code&gt;getfacl&lt;/code&gt; and &lt;code&gt;setfacl&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Here are the two main commands:&lt;/p&gt;

&lt;h3&gt;
  
  
  Check current ACLs
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Give read permission to a user
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;setfacl &lt;span class="nt"&gt;-m&lt;/span&gt; u:john:r-- filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Give write access to a group
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;setfacl &lt;span class="nt"&gt;-m&lt;/span&gt; g:developers:rw- filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Set default ACLs on a directory (for new files)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;setfacl &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; u:john:r-- /project-folder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means every new file in &lt;code&gt;/project-folder&lt;/code&gt; will automatically give &lt;code&gt;john&lt;/code&gt; read access.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Real-World Examples
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Example 1: Give read access to &lt;code&gt;alice&lt;/code&gt; on a log file
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;setfacl &lt;span class="nt"&gt;-m&lt;/span&gt; u:alice:r-- /var/log/custom.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example 2: Block write access for group &lt;code&gt;interns&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;setfacl &lt;span class="nt"&gt;-m&lt;/span&gt; g:interns:r-- /project/data.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example 3: Make sure all new files in a folder are readable by user &lt;code&gt;sam&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;setfacl &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; u:sam:r-- /reports
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6. Removing and Managing ACLs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Remove specific ACL entry
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;setfacl &lt;span class="nt"&gt;-x&lt;/span&gt; u:john filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Remove all ACLs and go back to normal permissions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;setfacl &lt;span class="nt"&gt;-b&lt;/span&gt; filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful if you want to reset everything.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use ACLs only when standard permissions are not enough&lt;/li&gt;
&lt;li&gt;Keep it simple, don’t overuse ACLs&lt;/li&gt;
&lt;li&gt;Document special permissions so your team knows who has access&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;getfacl&lt;/code&gt; regularly to check what’s set&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  8. Summary
&lt;/h2&gt;

&lt;p&gt;ACLs help you give very specific permissions to different users or groups. They're great when you need more control than &lt;code&gt;chmod&lt;/code&gt; or &lt;code&gt;chown&lt;/code&gt; can offer.&lt;/p&gt;

&lt;p&gt;If you’re working in teams or managing shared files, knowing ACLs is a very useful skill.&lt;/p&gt;

&lt;p&gt;Try them out and remember, Linux gives you the tools. It’s up to you to use them wisely.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>networking</category>
      <category>devops</category>
      <category>cloudwhistler</category>
    </item>
    <item>
      <title>Understanding /etc/passwd – Linux User Account Properties (Day 10 of 30)</title>
      <dc:creator>Sheikh Hassaan Bin Nadeem</dc:creator>
      <pubDate>Wed, 30 Apr 2025 21:03:02 +0000</pubDate>
      <link>https://dev.to/sheikhhassaanbinnadeem/understanding-etcpasswd-linux-user-account-properties-day-10-of-30-2blk</link>
      <guid>https://dev.to/sheikhhassaanbinnadeem/understanding-etcpasswd-linux-user-account-properties-day-10-of-30-2blk</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
Introduction
&lt;/li&gt;
&lt;li&gt;
Why Understanding User Account Properties Matters
&lt;/li&gt;
&lt;li&gt;
The &lt;code&gt;/etc/passwd&lt;/code&gt; File – A Goldmine of User Info
&lt;/li&gt;
&lt;li&gt;
Breaking Down Key Fields
&lt;/li&gt;
&lt;li&gt;
How to View and Interpret User Info
&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;Every time you log in, run a command, or access a file on a Linux system, you're doing it &lt;em&gt;as a user&lt;/em&gt;. But have you ever stopped to ask: &lt;em&gt;what exactly defines a user?&lt;/em&gt; How does Linux know what you’re allowed to do?&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;user account properties&lt;/strong&gt; come into play. Hidden in plain sight, they’re the DNA of user identity in Linux and knowing them is essential not just for RHCSA exams but also for real-world DevOps, cloud, and sysadmin roles.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Why Understanding User Account Properties Matters
&lt;/h2&gt;

&lt;p&gt;Many beginners (and even intermediate users) overlook these properties because they appear technical or cryptic. But here’s the truth:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Misunderstanding UID or GID can lead to permission issues&lt;/strong&gt; that break deployments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Failing to grasp default shells or home directories&lt;/strong&gt; can create confusion in automation scripts or multi-user environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Businesses care about access control, auditing, and traceability.&lt;/strong&gt; If you can’t explain what a user ID represents or how it maps to a file ownership, you’re not production-ready.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So this isn’t just about passing an exam. It’s about making smarter, more secure decisions in the real world.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. The &lt;code&gt;/etc/passwd&lt;/code&gt; File – A Goldmine of User Info
&lt;/h2&gt;

&lt;p&gt;Linux stores core user account information in a plain text file called &lt;code&gt;/etc/passwd&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To view 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;cat&lt;/span&gt; /etc/passwd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each line in this file represents a single user and 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;hassan:x:1001:1001:Hassan Bin Nadeem:/home/hassan:/bin/bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s break this down in the next section.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Breaking Down Key Fields
&lt;/h2&gt;

&lt;p&gt;Each line in &lt;code&gt;/etc/passwd&lt;/code&gt; has &lt;strong&gt;7 colon-separated fields&lt;/strong&gt;, and understanding them makes the whole system clearer:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field Number&lt;/th&gt;
&lt;th&gt;Field Name&lt;/th&gt;
&lt;th&gt;Example Value&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Username&lt;/td&gt;
&lt;td&gt;&lt;code&gt;hassan&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Login name of the user.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Password (Placeholder)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;x&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Indicates that the actual password is stored in &lt;code&gt;/etc/shadow&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;User ID (UID)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;1001&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unique ID assigned to the user. System users typically have UIDs below 1000.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Group ID (GID)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;1001&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Primary group the user belongs to.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;User Info / Comment&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Hassan Bin Nadeem&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sometimes used to describe the full name or purpose of the account.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Home Directory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/home/hassan&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Default working directory after login.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;Login Shell&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/bin/bash&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The shell that launches upon login.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Harder Way:&lt;/strong&gt; You can manually memorize all these field positions...&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Smarter Way:&lt;/strong&gt; Just understand the logic. Once you grasp what Linux needs to know about a user, the fields naturally make sense.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. How to View and Interpret User Info
&lt;/h2&gt;

&lt;p&gt;Let’s look at how you can check user details using commands that are easy to remember:&lt;/p&gt;

&lt;h3&gt;
  
  
  View All Usernames
&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;grep&lt;/span&gt; &lt;span class="s1"&gt;'/home'&lt;/span&gt; /etc/passwd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This filters out real users (not system accounts) by matching entries that have home directories.&lt;/p&gt;

&lt;h3&gt;
  
  
  View UID and GID for a User
&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;id &lt;/span&gt;hassan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows the user ID, group ID, and all groups the user belongs to.&lt;/p&gt;

&lt;h3&gt;
  
  
  See Default Shell for a User
&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;grep &lt;/span&gt;hassan /etc/passwd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This prints the full line, and you can easily read the shell at the end.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Summary
&lt;/h2&gt;

&lt;p&gt;By exploring the &lt;code&gt;/etc/passwd&lt;/code&gt; file, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identify how Linux defines a user
&lt;/li&gt;
&lt;li&gt;Understand permissions through UID and GID
&lt;/li&gt;
&lt;li&gt;Troubleshoot login or shell issues
&lt;/li&gt;
&lt;li&gt;Build more secure and stable systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Practice reading user entries as a habit. Once you’re fluent, interpreting user account data becomes effortless and insightful, like reading a name tag on a very organized team.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>cloud</category>
      <category>devops</category>
      <category>cloudwhistler</category>
    </item>
    <item>
      <title>Understanding Linux File Permissions - The Smarter Way (Day 9 of 30)</title>
      <dc:creator>Sheikh Hassaan Bin Nadeem</dc:creator>
      <pubDate>Mon, 28 Apr 2025 21:47:16 +0000</pubDate>
      <link>https://dev.to/sheikhhassaanbinnadeem/understanding-linux-file-permissions-the-smarter-way-day-9-of-30-1p82</link>
      <guid>https://dev.to/sheikhhassaanbinnadeem/understanding-linux-file-permissions-the-smarter-way-day-9-of-30-1p82</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
Introduction
&lt;/li&gt;
&lt;li&gt;
Understanding File Permissions in Linux
&lt;/li&gt;
&lt;li&gt;
The Symbolic Method (The Harder Way)
&lt;/li&gt;
&lt;li&gt;
The Numeric Method (The Smarter Way)
&lt;/li&gt;
&lt;li&gt;
Real-World Examples to Practice
&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;Permissions are at the heart of Linux security and daily operations. Understanding how to manage them quickly and correctly is vital whether you’re administering servers, developing apps, or just maintaining your system.&lt;/p&gt;

&lt;p&gt;We'll explore both ways of managing permissions; the symbolic way and the numeric way but with a clear recommendation on which method to stick with for faster, smarter workflow.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Understanding File Permissions in Linux
&lt;/h2&gt;

&lt;p&gt;Every file and directory in Linux has associated permissions that determine who can read, write, or execute them. These permissions are divided among three categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;User&lt;/strong&gt; (owner)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Group&lt;/strong&gt; (users in the file’s group)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Others&lt;/strong&gt; (everyone else)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The basic permissions are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;r&lt;/code&gt; (read)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;w&lt;/code&gt; (write)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;x&lt;/code&gt; (execute)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mastering permission management allows you to control access and secure your systems effectively.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. The Symbolic Method (The Harder Way)
&lt;/h2&gt;

&lt;p&gt;In the &lt;strong&gt;symbolic method&lt;/strong&gt;, you use letters to represent users and actions. It's very descriptive but can be slightly more tedious, especially under pressure.&lt;/p&gt;

&lt;p&gt;Here’s the basic structure:&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="o"&gt;[&lt;/span&gt;user][operator][permission] filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Users:&lt;/strong&gt; &lt;code&gt;u&lt;/code&gt; (user), &lt;code&gt;g&lt;/code&gt; (group), &lt;code&gt;o&lt;/code&gt; (others), &lt;code&gt;a&lt;/code&gt; (all)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operators:&lt;/strong&gt; &lt;code&gt;+&lt;/code&gt; (add), &lt;code&gt;-&lt;/code&gt; (remove), &lt;code&gt;=&lt;/code&gt; (set exact permissions)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&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;u+x file.txt   &lt;span class="c"&gt;# Add execute permission for user&lt;/span&gt;
&lt;span class="nb"&gt;chmod &lt;/span&gt;go-w file.txt  &lt;span class="c"&gt;# Remove write permission for group and others&lt;/span&gt;
&lt;span class="nb"&gt;chmod &lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;r file.txt   &lt;span class="c"&gt;# Set read-only for everyone&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While useful, this method requires you to think a little more, especially in more complex scenarios.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. The Numeric Method (The Smarter Way)
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;numeric method&lt;/strong&gt; uses numbers to represent permissions. It’s faster, easier, and highly recommended for real-world use.&lt;/p&gt;

&lt;p&gt;Each permission is assigned a value:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;r&lt;/code&gt; = 4&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;w&lt;/code&gt; = 2&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;x&lt;/code&gt; = 1&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You add up the numbers for each category (User, Group, Others).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Calculation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read (4) + Write (2) + Execute (1) = &lt;strong&gt;7&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Read (4) + Execute (1) = &lt;strong&gt;5&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Read (4) = &lt;strong&gt;4&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example Command:&lt;/strong&gt;&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;754 file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Meaning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User: 7 (read+write+execute)&lt;/li&gt;
&lt;li&gt;Group: 5 (read+execute)&lt;/li&gt;
&lt;li&gt;Others: 4 (read)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quick reference table:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Permission&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;---&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;--x&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-w-&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-wx&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;r--&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;r-x&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rw-&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rwx&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Once you get the hang of this, you'll change permissions confidently and quickly without second-guessing!&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Real-World Examples to Practice
&lt;/h2&gt;

&lt;p&gt;✅ Make a script executable by everyone:&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;✅ Secure a private SSH key:&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;600 id_rsa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Make a public file readable but not writable or 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;644 public.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Grant full access to a user but only read access to others:&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;744 filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Make a directory accessible to everyone:&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 /var/www/html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These examples are directly applicable whether you’re working on &lt;strong&gt;Red Hat Enterprise Linux (RHEL 9)&lt;/strong&gt; or similar distributions.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Both symbolic and numeric methods&lt;/strong&gt; exist for changing permissions.&lt;/li&gt;
&lt;li&gt;Focus primarily on the &lt;strong&gt;numeric method&lt;/strong&gt; for speed and simplicity.&lt;/li&gt;
&lt;li&gt;Keep the symbolic method at the back of your mind for when it's needed.&lt;/li&gt;
&lt;li&gt;Always set permissions thoughtfully to maintain security!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Getting comfortable with Linux permissions is a superpower, it saves you time, protects your systems, and builds your confidence on the terminal.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>cloud</category>
      <category>cloudwhistler</category>
    </item>
    <item>
      <title>Control Firewall, OpenSSH &amp; Other System Services with systemctl (Day 8 of 30)</title>
      <dc:creator>Sheikh Hassaan Bin Nadeem</dc:creator>
      <pubDate>Sun, 27 Apr 2025 15:42:24 +0000</pubDate>
      <link>https://dev.to/sheikhhassaanbinnadeem/control-firewall-openssh-other-system-services-with-systemctl-day-8-of-30-1hej</link>
      <guid>https://dev.to/sheikhhassaanbinnadeem/control-firewall-openssh-other-system-services-with-systemctl-day-8-of-30-1hej</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
Introduction
&lt;/li&gt;
&lt;li&gt;
Understanding systemctl

&lt;ul&gt;
&lt;li&gt;
Basic operations (start, stop, status, enable, disable, restart, reload)
&lt;/li&gt;
&lt;li&gt;
Advanced operations (mask, unmask)
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
Practical Examples

&lt;ul&gt;
&lt;li&gt;
Examples using common services like sshd, firewalld, httpd
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
Summary
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;Managing system services is a core responsibility for any Linux sysadmin or power user. On RHEL 9, which uses &lt;strong&gt;systemd&lt;/strong&gt; as its init system, the &lt;code&gt;systemctl&lt;/code&gt; command is your gateway to starting, stopping, and configuring services (daemons). Learning a few essential &lt;code&gt;systemctl&lt;/code&gt; commands will let you control services easily—whether you're running a web server, SSH daemon, or the firewall. In this article, we’ll cover the basics of &lt;code&gt;systemctl&lt;/code&gt; for RHEL 9 (most of it works the same on other modern distros). By the end, you’ll know how to start/stop services, enable them at boot, check their status, and even disable them if needed. Let’s dive in and get you feeling confident managing your system’s services!&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Understanding systemctl
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;systemctl&lt;/code&gt; is the main command-line tool to interact with &lt;strong&gt;systemd&lt;/strong&gt; (the service manager on RHEL 9). It can start or stop services immediately, query their status, and configure whether they run at boot. Here are the basic &lt;code&gt;systemctl&lt;/code&gt; operations you’ll use every day:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;systemctl start &amp;lt;service&amp;gt;&lt;/code&gt; — &lt;em&gt;Start&lt;/em&gt; the specified service right now. For example, &lt;code&gt;systemctl start sshd&lt;/code&gt; will launch the SSH server.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;systemctl stop &amp;lt;service&amp;gt;&lt;/code&gt; — &lt;em&gt;Stop&lt;/em&gt; a running service immediately. For example, &lt;code&gt;systemctl stop httpd&lt;/code&gt; stops the Apache web server.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;systemctl status &amp;lt;service&amp;gt;&lt;/code&gt; — &lt;em&gt;Check the status&lt;/em&gt; of a service. This shows if it's active (running), its process ID, and recent log entries.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;systemctl restart &amp;lt;service&amp;gt;&lt;/code&gt; — &lt;em&gt;Restart&lt;/em&gt; a service (stop, then start). Use this after changing a service’s configuration.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;systemctl reload &amp;lt;service&amp;gt;&lt;/code&gt; — &lt;em&gt;Reload&lt;/em&gt; a service’s configuration without fully stopping it. Only works if the service supports reloading (e.g. it reloads settings without disconnecting clients).
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;systemctl enable &amp;lt;service&amp;gt;&lt;/code&gt; — Configure the service to &lt;strong&gt;start automatically at boot&lt;/strong&gt;. After enabling, the service will run every time the system starts (unless masked or disabled).
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;systemctl disable &amp;lt;service&amp;gt;&lt;/code&gt; — Stop a service from starting automatically at boot. This does not stop a running service immediately, but it prevents future automatic starts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These commands cover the most common service management tasks. You can also combine them in scripts or use &lt;code&gt;systemctl status &amp;lt;service&amp;gt;&lt;/code&gt; followed by &lt;code&gt;--no-pager&lt;/code&gt; to get a full output.&lt;/p&gt;

&lt;h4&gt;
  
  
  Advanced operations: mask and unmask
&lt;/h4&gt;

&lt;p&gt;Two more advanced &lt;code&gt;systemctl&lt;/code&gt; commands are &lt;strong&gt;mask&lt;/strong&gt; and &lt;strong&gt;unmask&lt;/strong&gt;. Masking a service ensures it cannot be started (even manually or by dependencies). For example, &lt;code&gt;systemctl mask &amp;lt;service&amp;gt;&lt;/code&gt; links the service unit to &lt;code&gt;/dev/null&lt;/code&gt;, making it effectively disabled. This is useful for critical services you want to prevent from ever running (e.g. &lt;code&gt;systemctl mask sshd&lt;/code&gt; if you never want SSH on). To undo this, use &lt;code&gt;systemctl unmask &amp;lt;service&amp;gt;&lt;/code&gt;, which restores the service so you can start or enable it again. Use these with care, as masking prevents any start of that service.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Practical Examples
&lt;/h2&gt;

&lt;p&gt;In RHEL 9, common services you’ll manage include &lt;strong&gt;sshd&lt;/strong&gt; (the OpenSSH server), &lt;strong&gt;firewalld&lt;/strong&gt; (the firewall daemon), and &lt;strong&gt;httpd&lt;/strong&gt; (Apache). Here’s how &lt;code&gt;systemctl&lt;/code&gt; works with these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;sshd (OpenSSH Server)&lt;/strong&gt;: The SSH service is usually called &lt;code&gt;sshd&lt;/code&gt; on RHEL.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check status: &lt;code&gt;systemctl status sshd&lt;/code&gt; will show if the SSH server is running.
&lt;/li&gt;
&lt;li&gt;Start SSH: &lt;code&gt;systemctl start sshd&lt;/code&gt;. Now you can connect via SSH.
&lt;/li&gt;
&lt;li&gt;Enable at boot: &lt;code&gt;systemctl enable sshd&lt;/code&gt; ensures SSH starts automatically after a reboot.
&lt;/li&gt;
&lt;li&gt;After editing &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt;, apply changes with &lt;code&gt;systemctl restart sshd&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;firewalld (Firewall daemon)&lt;/strong&gt;: This is RHEL’s default firewall service.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check status: &lt;code&gt;systemctl status firewalld&lt;/code&gt; shows if it’s active.
&lt;/li&gt;
&lt;li&gt;Start firewall: &lt;code&gt;systemctl start firewalld&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;Enable at boot: &lt;code&gt;systemctl enable firewalld&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;Reload rules: After changing zones or rules, use &lt;code&gt;systemctl reload firewalld&lt;/code&gt; to apply them without dropping connections.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;httpd (Apache Web Server)&lt;/strong&gt;: If you host a website, &lt;code&gt;httpd&lt;/code&gt; is the Apache service.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start web server: &lt;code&gt;systemctl start httpd&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;Enable at boot: &lt;code&gt;systemctl enable httpd&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;Check status: &lt;code&gt;systemctl status httpd&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;Restart after config change: &lt;code&gt;systemctl restart httpd&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;As you can see, the commands are consistent across services: just replace &lt;code&gt;&amp;lt;service&amp;gt;&lt;/code&gt; with the name (e.g. &lt;code&gt;sshd&lt;/code&gt;, &lt;code&gt;firewalld&lt;/code&gt;, &lt;code&gt;httpd&lt;/code&gt;). This makes managing services straightforward.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Summary
&lt;/h2&gt;

&lt;p&gt;Controlling services on RHEL 9 is straightforward with &lt;code&gt;systemctl&lt;/code&gt;. In this article, we covered how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start, stop, and restart&lt;/strong&gt; services with &lt;code&gt;systemctl start/stop/restart &amp;lt;service&amp;gt;&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check status&lt;/strong&gt; of a service with &lt;code&gt;systemctl status &amp;lt;service&amp;gt;&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enable or disable&lt;/strong&gt; services at boot using &lt;code&gt;systemctl enable/disable &amp;lt;service&amp;gt;&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reload&lt;/strong&gt; a service’s configuration (if supported) with &lt;code&gt;systemctl reload &amp;lt;service&amp;gt;&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mask and unmask&lt;/strong&gt; services (&lt;code&gt;systemctl mask/unmask &amp;lt;service&amp;gt;&lt;/code&gt;) for advanced use.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These commands form a complete toolkit for everyday service management on RHEL 9. Practice using them with services like &lt;code&gt;sshd&lt;/code&gt;, &lt;code&gt;firewalld&lt;/code&gt;, and &lt;code&gt;httpd&lt;/code&gt;, and you’ll soon feel fully in control of your system’s daemons. Happy administering!&lt;/p&gt;




</description>
      <category>linux</category>
      <category>devops</category>
      <category>cloud</category>
      <category>cloudwhistler</category>
    </item>
    <item>
      <title>Monitoring Logged-In Users in Linux (Day 7 of 30)</title>
      <dc:creator>Sheikh Hassaan Bin Nadeem</dc:creator>
      <pubDate>Wed, 16 Apr 2025 17:57:17 +0000</pubDate>
      <link>https://dev.to/sheikhhassaanbinnadeem/monitoring-logged-in-users-in-linux-day-7-of-30-2clj</link>
      <guid>https://dev.to/sheikhhassaanbinnadeem/monitoring-logged-in-users-in-linux-day-7-of-30-2clj</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
Introduction
&lt;/li&gt;
&lt;li&gt;
Why Monitoring Logged-In Users Matters
&lt;/li&gt;
&lt;li&gt;
Essential Commands to Monitor Logged-In Users

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;who&lt;/code&gt; – Simple Overview of Logged-In Users
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;w&lt;/code&gt; – What Users Are Doing
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;users&lt;/code&gt; – Quick List of Usernames
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;id&lt;/code&gt; – See Current User Info
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;last&lt;/code&gt; – See Login History
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;One of the key responsibilities of a Linux system admin or power user is to &lt;strong&gt;understand who is on the system&lt;/strong&gt; at any given time and what they’re doing. Whether you’re troubleshooting, securing your server, or just curious, knowing how to monitor logged-in users is a basic yet powerful skill.&lt;/p&gt;

&lt;p&gt;In this article, we’ll go through &lt;strong&gt;essential Linux commands&lt;/strong&gt; to help you &lt;strong&gt;track, monitor, and understand user sessions&lt;/strong&gt; on your system all using tools that come pre-installed on &lt;strong&gt;RHEL 9&lt;/strong&gt; (so no extra setup needed).&lt;/p&gt;

&lt;p&gt;Let’s dive in.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Why Monitoring Logged In Users Matters
&lt;/h2&gt;

&lt;p&gt;In multi-user systems especially in production environments it's important to know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Who’s currently logged in
&lt;/li&gt;
&lt;li&gt;What sessions are active
&lt;/li&gt;
&lt;li&gt;What actions are being taken
&lt;/li&gt;
&lt;li&gt;Who logged in recently (and when)
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This kind of insight can help you catch unauthorized access, detect idle sessions, troubleshoot performance issues, or just better understand system usage.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Essential Commands to Monitor Logged In Users
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;who&lt;/code&gt; - Simple Overview of Logged-In Users
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it does:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Displays currently logged-in users, along with terminal, login time, and IP (if remote).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&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.amazonaws.com%2Fuploads%2Farticles%2Fa79iev5bxvifex5epues.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.amazonaws.com%2Fuploads%2Farticles%2Fa79iev5bxvifex5epues.png" alt="who command in linux" width="800" height="41"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it’s useful:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Great for a quick snapshot of who’s on the system and from where.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;w&lt;/code&gt; - What Users Are Doing
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it does:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Displays detailed information about logged-in users and &lt;strong&gt;what they are currently doing&lt;/strong&gt; including uptime, load average, and active processes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&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.amazonaws.com%2Fuploads%2Farticles%2F93kd664ob8empum8n7x4.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.amazonaws.com%2Fuploads%2Farticles%2F93kd664ob8empum8n7x4.png" alt="w command in linux" width="800" height="78"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it’s useful:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Gives a real-time, detailed view, especially useful for spotting long-running or idle processes.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;users&lt;/code&gt; - Quick List of Usernames
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it does:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Prints only the &lt;strong&gt;usernames&lt;/strong&gt; of currently logged-in users in a single line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&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.amazonaws.com%2Fuploads%2Farticles%2Fqo0lboot10ob3qp3deet.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.amazonaws.com%2Fuploads%2Farticles%2Fqo0lboot10ob3qp3deet.png" alt="users command in linux" width="800" height="40"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it’s useful:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Perfect for quick checks or simple scripts where you only need usernames.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;id&lt;/code&gt; - See Current User Info
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it does:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Shows the current user’s UID, GID, and group memberships.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&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.amazonaws.com%2Fuploads%2Farticles%2Fsq6np8mce6hgcfa7xzau.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.amazonaws.com%2Fuploads%2Farticles%2Fsq6np8mce6hgcfa7xzau.png" alt="id command in Linux" width="800" height="74"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it’s useful:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Helps you understand &lt;strong&gt;user permissions&lt;/strong&gt;, especially useful when troubleshooting access issues or running permission-based scripts.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;last&lt;/code&gt; - See Login History
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it does:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Displays a &lt;strong&gt;history of logins&lt;/strong&gt;, including login time, duration, and source IP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&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.amazonaws.com%2Fuploads%2Farticles%2F6f6xb3igoh6123vqrsnp.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.amazonaws.com%2Fuploads%2Farticles%2F6f6xb3igoh6123vqrsnp.png" alt="last command in Linux" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it’s useful:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Great for &lt;strong&gt;auditing&lt;/strong&gt; login activity and detecting unusual patterns or times.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Summary
&lt;/h2&gt;

&lt;p&gt;Monitoring users is not just about curiosity, it’s about &lt;strong&gt;control, security, and clarity&lt;/strong&gt;. These five simple but powerful commands help you keep an eye on your system without installing anything extra:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;who&lt;/code&gt;: See who's logged in
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;w&lt;/code&gt;: Find out what they’re doing
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;users&lt;/code&gt;: Quick list of usernames
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;id&lt;/code&gt;: Understand user IDs and groups
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;last&lt;/code&gt;: Review login history&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're working on RHEL 9 (Red Hat Linux) or any other Linux system, these tools will give you the visibility you need to stay in charge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let me know in the comments if you want to know more about any specific command!&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Only 6 Commands You Need to Find Anything in Linux (Day 6 of 30)</title>
      <dc:creator>Sheikh Hassaan Bin Nadeem</dc:creator>
      <pubDate>Sat, 12 Apr 2025 17:58:15 +0000</pubDate>
      <link>https://dev.to/sheikhhassaanbinnadeem/the-only-6-commands-you-need-to-find-anything-in-linux-day-6-of-30-5el1</link>
      <guid>https://dev.to/sheikhhassaanbinnadeem/the-only-6-commands-you-need-to-find-anything-in-linux-day-6-of-30-5el1</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
Introduction
&lt;/li&gt;
&lt;li&gt;
The 6 Must-Know Commands

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;find&lt;/code&gt;  Find Anything, Anywhere
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;grep&lt;/code&gt; – Search Within Files
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;locate&lt;/code&gt; – The Lightning Fast Finder
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;which&lt;/code&gt; – Find the Location of Binaries
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;whereis&lt;/code&gt; – Get Binary, Source &amp;amp; Man Page Paths
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;type&lt;/code&gt; – Check How a Command Will Run
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
Summary
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;Searching is one of the most common things you'll do on a Linux system. Whether you're trying to locate files, understand where a binary lives, or check how a command is interpreted — Linux has a command for that.&lt;/p&gt;

&lt;p&gt;In this article, we’ll go over &lt;strong&gt;six essential commands&lt;/strong&gt; that help you find anything on your system, from files and directories to binaries and documentation. Once you're comfortable with these, you'll rarely feel lost in the Linux filesystem again.&lt;/p&gt;

&lt;h2&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.amazonaws.com%2Fuploads%2Farticles%2F72qg8n30qdu8ysa15npa.jpg" alt="Chart to Find on Linux" width="800" height="435"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  2. The 6 Must-Know Commands
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;find&lt;/code&gt; – Find Anything, Anywhere
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The most powerful file search tool in Linux. It walks through directories and finds files based on name, size, type, permissions, modification date, and more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Find all &lt;code&gt;.log&lt;/code&gt; files inside &lt;code&gt;/var/log&lt;/code&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.amazonaws.com%2Fuploads%2Farticles%2F5bx2us4wqjmv21xg88zd.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.amazonaws.com%2Fuploads%2Farticles%2F5bx2us4wqjmv21xg88zd.png" alt="find command" width="800" height="111"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
When dealing with large systems or deep directory structures, &lt;code&gt;find&lt;/code&gt; gives you total control over what to search for and where.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Combine with &lt;code&gt;exec&lt;/code&gt; or &lt;code&gt;xargs&lt;/code&gt; to perform actions on the results:&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.amazonaws.com%2Fuploads%2Farticles%2Ft7n5g7bq15pw6gim2zpt.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.amazonaws.com%2Fuploads%2Farticles%2Ft7n5g7bq15pw6gim2zpt.png" alt="find with exec command" width="800" height="82"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;grep&lt;/code&gt; – Search Within Files
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Searches file contents line by line. Great for looking inside files and filtering output.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Find all lines in &lt;code&gt;access.log&lt;/code&gt; that contain “404”:&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.amazonaws.com%2Fuploads%2Farticles%2F58iwsk1xkcou6uscn8q3.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.amazonaws.com%2Fuploads%2Farticles%2F58iwsk1xkcou6uscn8q3.png" alt="grep command" width="800" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;grep&lt;/code&gt; is perfect when you know &lt;em&gt;what&lt;/em&gt; you're looking for but not &lt;em&gt;where&lt;/em&gt; it is inside a file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Use with &lt;code&gt;-r&lt;/code&gt; to recursively search directories:&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.amazonaws.com%2Fuploads%2Farticles%2Ftiabf8sub7ps3y4l4gmu.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.amazonaws.com%2Fuploads%2Farticles%2Ftiabf8sub7ps3y4l4gmu.png" alt="grep -r command" width="800" height="86"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;locate&lt;/code&gt; – The Lightning Fast Finder
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Searches a pre-built database of filenames. Way faster than &lt;code&gt;find&lt;/code&gt;, but may not show the latest files unless the database is updated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Quickly find all files named &lt;code&gt;nginx.conf&lt;/code&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.amazonaws.com%2Fuploads%2Farticles%2Ftpj17h9pj1lr18wa4gmc.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.amazonaws.com%2Fuploads%2Farticles%2Ftpj17h9pj1lr18wa4gmc.png" alt="locate command in linux" width="800" height="76"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Ideal for quick lookups when you're not sure where a file is, but don’t want to wait for &lt;code&gt;find&lt;/code&gt; to crawl the filesystem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Run &lt;code&gt;sudo updatedb&lt;/code&gt; if it doesn’t find something you just created.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;which&lt;/code&gt; – Find the Location of Binaries
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Tells you the full path of a command that will be executed when you type it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Find where &lt;code&gt;python&lt;/code&gt; is installed:&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.amazonaws.com%2Fuploads%2Farticles%2F35r37o5zqq15vijq113d.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.amazonaws.com%2Fuploads%2Farticles%2F35r37o5zqq15vijq113d.png" alt="which command in linux" width="800" height="75"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
When you have multiple versions installed (like Python 2 vs Python 3), this helps avoid confusion.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;whereis&lt;/code&gt; – Get Binary, Source &amp;amp; Man Page Paths
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Gives more comprehensive information than &lt;code&gt;which&lt;/code&gt; including binary, source, and manual page locations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
See where all parts of &lt;code&gt;bash&lt;/code&gt; are stored:&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.amazonaws.com%2Fuploads%2Farticles%2Fn7ikrz1vwjd658huuho0.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.amazonaws.com%2Fuploads%2Farticles%2Fn7ikrz1vwjd658huuho0.png" alt="whereis command in linux" width="800" height="74"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Useful for developers, sysadmins, or learners who want to explore beyond just the executable.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;type&lt;/code&gt; – Check How a Command Will Run
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Tells you if something is a built-in shell command, alias, function, or external binary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Check what &lt;code&gt;ls&lt;/code&gt; really is:&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.amazonaws.com%2Fuploads%2Farticles%2F7ebifc60ssjdjjvl3xkf.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.amazonaws.com%2Fuploads%2Farticles%2F7ebifc60ssjdjjvl3xkf.png" alt="type command in linux" width="800" height="75"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Critical for debugging shell behaviors and avoiding conflicts between aliases, functions, and binaries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Run &lt;code&gt;type -a &amp;lt;command&amp;gt;&lt;/code&gt; to see all definitions in order of priority:&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.amazonaws.com%2Fuploads%2Farticles%2Frbml5j0x1hwzd8slllu8.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.amazonaws.com%2Fuploads%2Farticles%2Frbml5j0x1hwzd8slllu8.png" alt="type -a command in linux" width="800" height="79"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Summary
&lt;/h2&gt;

&lt;p&gt;Finding things in Linux doesn’t have to be complicated, you just need the right tools. In this article, we covered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;find&lt;/code&gt; for powerful and flexible file search
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;grep&lt;/code&gt; for searching within files
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;locate&lt;/code&gt; for super-fast lookups
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;which&lt;/code&gt;, &lt;code&gt;whereis&lt;/code&gt;, and &lt;code&gt;type&lt;/code&gt; to understand command locations and behavior
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These six commands together create a complete toolkit for navigating and understanding your Linux system like a pro. Once you’ve mastered them, you’ll waste less time searching and more time doing.&lt;/p&gt;




</description>
      <category>linux</category>
      <category>devops</category>
      <category>cloud</category>
      <category>cloudwhistler</category>
    </item>
    <item>
      <title>The Magic of Aliases in Bash (Day 5 of 30)</title>
      <dc:creator>Sheikh Hassaan Bin Nadeem</dc:creator>
      <pubDate>Thu, 10 Apr 2025 21:57:45 +0000</pubDate>
      <link>https://dev.to/sheikhhassaanbinnadeem/the-magic-of-aliases-in-bash-day-5-of-30-2cpe</link>
      <guid>https://dev.to/sheikhhassaanbinnadeem/the-magic-of-aliases-in-bash-day-5-of-30-2cpe</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
Introduction
&lt;/li&gt;
&lt;li&gt;
What Are Bash Aliases?
&lt;/li&gt;
&lt;li&gt;
Creating Temporary Aliases
&lt;/li&gt;
&lt;li&gt;
Making Aliases Permanent
&lt;/li&gt;
&lt;li&gt;
Real-World Examples (The Good Stuff)
&lt;/li&gt;
&lt;li&gt;
Bonus: Use Bash Functions as Aliases on Steroids
&lt;/li&gt;
&lt;li&gt;
Summary
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;Ever feel like you're typing the same Linux command again and again... and again?&lt;/p&gt;

&lt;p&gt;That’s exactly where I found myself, typing &lt;code&gt;git status&lt;/code&gt;, &lt;code&gt;ls -la&lt;/code&gt;, &lt;code&gt;cd ../..&lt;/code&gt;, and even rewriting long &lt;code&gt;sudo&lt;/code&gt; commands when I forgot to prefix them.&lt;/p&gt;

&lt;p&gt;Then I discovered the magic of &lt;strong&gt;bash aliases&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;These tiny shortcuts are absolute game-changers. Not only do they save time, but they also help avoid common mistakes (like accidentally deleting files with &lt;code&gt;rm *&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Let’s explore what they are, how to use them, and why they’re a must-have in every CLI workflow.&lt;/p&gt;

&lt;h2&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.amazonaws.com%2Fuploads%2Farticles%2F5a838hufihp84j9zftax.jpg" alt="Chart for alias in Bash" width="800" height="579"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  2. What Are Bash Aliases?
&lt;/h2&gt;

&lt;p&gt;Aliases are basically nicknames for commands. You type something short and Bash knows you actually meant something longer.&lt;/p&gt;

&lt;p&gt;It’s like having a keyboard macro for your terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&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;alias &lt;/span&gt;&lt;span class="nv"&gt;ll&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'ls -la'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, whenever you type &lt;code&gt;ll&lt;/code&gt;, it will run &lt;code&gt;ls -la&lt;/code&gt;. Beautifully simple.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Creating Temporary Aliases
&lt;/h2&gt;

&lt;p&gt;Let’s start small. These aliases work during the current terminal session (they vanish after you close 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;alias &lt;/span&gt;&lt;span class="nv"&gt;gs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'git status'&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;cls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'clear'&lt;/span&gt;
&lt;span class="nb"&gt;alias&lt;/span&gt; ..&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'cd ..'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Try typing those directly into your terminal and give them a spin. You’ll feel 10x faster immediately.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Making Aliases Permanent
&lt;/h2&gt;

&lt;p&gt;You don’t want to set these every single time you open a new terminal, right? Let’s make them stick.&lt;/p&gt;

&lt;p&gt;Here’s how:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your &lt;code&gt;.bashrc&lt;/code&gt; (or &lt;code&gt;.zshrc&lt;/code&gt; if you use zsh):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vim ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Scroll down and add your aliases:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;gs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'git status'&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;ga&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'git add .'&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;gc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'git commit -m'&lt;/span&gt;
&lt;span class="nb"&gt;alias rm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'rm -i'&lt;/span&gt;  &lt;span class="c"&gt;# prompts before deleting&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;update&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'sudo apt update &amp;amp;&amp;amp; sudo apt upgrade'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Save and exit Vim (don’t forget &lt;code&gt;:wq&lt;/code&gt;) then reload your shell:
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;/div&gt;



&lt;p&gt;Done. Your shortcuts are now permanent.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Real-World Examples (The Good Stuff)
&lt;/h2&gt;

&lt;p&gt;Here’s a few of my favorite aliases I now use daily:&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;alias &lt;/span&gt;&lt;span class="nv"&gt;gs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'git status'&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;ga&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'git add .'&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;gc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'git commit -m'&lt;/span&gt;

&lt;span class="nb"&gt;alias&lt;/span&gt; ..&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'cd ..'&lt;/span&gt;
&lt;span class="nb"&gt;alias&lt;/span&gt; ...&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'cd ../..'&lt;/span&gt;

&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;cls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'clear'&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;pls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'sudo !!'&lt;/span&gt;  &lt;span class="c"&gt;# repeat last command with sudo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And yes, that last one has saved me from so many "permission denied" frustrations.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Bonus: Use Bash Functions as Aliases on Steroids
&lt;/h2&gt;

&lt;p&gt;Sometimes a simple alias isn't enough. You want logic. Enter &lt;strong&gt;bash functions&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkcd&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkcd my-new-folder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And it will create the folder and move you into it. One command. Two jobs. Clean.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Summary
&lt;/h2&gt;

&lt;p&gt;Bash aliases are more than a trick, they’re a productivity superpower. They:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cut your typing time in half&lt;/li&gt;
&lt;li&gt;Reduce silly mistakes (like &lt;code&gt;rm&lt;/code&gt; accidents)&lt;/li&gt;
&lt;li&gt;Make you look and feel like a CLI ninja&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start small, build your own alias list, and before you know it, your terminal will feel like it was built just for you.&lt;/p&gt;

&lt;p&gt;Tomorrow, I’ll be exploring something that often goes under the radar, how to use &lt;code&gt;find&lt;/code&gt; and &lt;code&gt;grep&lt;/code&gt; like a boss. But until then, go make your terminal feel like home.&lt;/p&gt;

&lt;p&gt;Happy Linux-ing!&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>cloud</category>
      <category>cloudwhistler</category>
    </item>
    <item>
      <title>The Most Common Vim Mistakes You’re Probably Making (Day 4 of 30)</title>
      <dc:creator>Sheikh Hassaan Bin Nadeem</dc:creator>
      <pubDate>Wed, 09 Apr 2025 20:28:01 +0000</pubDate>
      <link>https://dev.to/sheikhhassaanbinnadeem/the-most-common-vim-mistakes-youre-probably-making-day-4-of-30-p0e</link>
      <guid>https://dev.to/sheikhhassaanbinnadeem/the-most-common-vim-mistakes-youre-probably-making-day-4-of-30-p0e</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
Introduction
&lt;/li&gt;
&lt;li&gt;
Staying in Insert Mode Too Long
&lt;/li&gt;
&lt;li&gt;
Using Arrow Keys Instead of hjkl
&lt;/li&gt;
&lt;li&gt;
Not Learning Navigation Commands
&lt;/li&gt;
&lt;li&gt;
Ignoring Visual Mode (and still using the mouse)
&lt;/li&gt;
&lt;li&gt;
Never Customizing .vimrc
&lt;/li&gt;
&lt;li&gt;
Forgetting How to Quit (yes, still)
&lt;/li&gt;
&lt;li&gt;
Thinking You Know Vim After the First Week
&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;When I first started using Vim, I felt like I was trying to fly a spaceship just to edit a line of text. And even after “learning” it, I realized I was doing so many things the &lt;em&gt;wrong way&lt;/em&gt; — or at least, the &lt;em&gt;hard way&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This post is a list of the most common Vim mistakes I made (and sometimes still make), along with the better, smarter ways to use Vim. If you’re new to Vim or just winging it through the terminal, chances are you’ll find yourself nodding at a few of these.&lt;/p&gt;

&lt;p&gt;Let’s get into it.&lt;/p&gt;

&lt;h2&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.amazonaws.com%2Fuploads%2Farticles%2F9gxeuorf85y3e8p6y6el.jpg" alt="Vim Mistakes Chart" width="800" height="455"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  2. Staying in Insert Mode Too Long
&lt;/h2&gt;

&lt;p&gt;Most of us treat Insert mode like our default playground. Type &lt;code&gt;i&lt;/code&gt;, write code or text like we’re in Notepad, then hit &lt;code&gt;Esc&lt;/code&gt; when we’re done.&lt;/p&gt;

&lt;p&gt;But in Vim, Insert mode is &lt;em&gt;not&lt;/em&gt; the main show. Normal mode is where the power lies. Moving around, editing, replacing, deleting all happen faster and more efficiently in Normal mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mistake:&lt;/strong&gt; Staying in Insert mode to move the cursor and make changes.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Fix:&lt;/strong&gt; Drop into Insert mode only when you actually need to type something. Return to Normal mode quickly to navigate and manipulate.&lt;/p&gt;


&lt;h2&gt;
  
  
  3. Using Arrow Keys Instead of hjkl
&lt;/h2&gt;

&lt;p&gt;Arrow keys work in Vim, but they're slow and break your flow. Your hands leave the home row. It ruins the whole point of Vim's design.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mistake:&lt;/strong&gt; Using arrow keys to move around.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Fix:&lt;/strong&gt; Start using &lt;code&gt;h&lt;/code&gt; (left), &lt;code&gt;j&lt;/code&gt; (down), &lt;code&gt;k&lt;/code&gt; (up), and &lt;code&gt;l&lt;/code&gt; (right). It takes time, but once your muscle memory adapts, you won’t want to go back.&lt;/p&gt;

&lt;p&gt;If it helps, try disabling arrow keys temporarily in your &lt;code&gt;.vimrc&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;&lt;span class="c"&gt;" Disable arrow keys&lt;/span&gt;
autocmd&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nb"&gt;VimEnter&lt;/span&gt; * &lt;span class="nb"&gt;noremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;Up&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;Nop&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
autocmd&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nb"&gt;VimEnter&lt;/span&gt; * &lt;span class="nb"&gt;noremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;Down&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;Nop&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
autocmd&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nb"&gt;VimEnter&lt;/span&gt; * &lt;span class="nb"&gt;noremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;Left&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;Nop&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
autocmd&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nb"&gt;VimEnter&lt;/span&gt; * &lt;span class="nb"&gt;noremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;Right&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;Nop&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  4. Not Learning Navigation Commands
&lt;/h2&gt;

&lt;p&gt;Scrolling line by line? Holding &lt;code&gt;j&lt;/code&gt; until you reach the end of the file? We’ve all done it. But Vim gives us power tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;w&lt;/code&gt; → Move forward by a word&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;b&lt;/code&gt; → Move backward by a word&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;0&lt;/code&gt; → Move to beginning of the line&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;^&lt;/code&gt; → First non-blank character&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$&lt;/code&gt; → End of the line&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;gg&lt;/code&gt; → Top of the file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;G&lt;/code&gt; → Bottom of the file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Mistake:&lt;/strong&gt; Navigating like you're in a basic editor.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Fix:&lt;/strong&gt; Master Vim's navigation keys. They save you &lt;em&gt;tons&lt;/em&gt; of time.&lt;/p&gt;


&lt;h2&gt;
  
  
  5. Ignoring Visual Mode (and still using the mouse)
&lt;/h2&gt;

&lt;p&gt;Selecting text using a mouse in Vim? That's a sign you're missing one of Vim's coolest modes: Visual mode.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Press &lt;code&gt;v&lt;/code&gt; to enter Visual mode (character selection)&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;V&lt;/code&gt; for line selection&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl+v&lt;/code&gt; for block/column mode&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once in Visual mode, you can move using &lt;code&gt;hjkl&lt;/code&gt; and apply actions like delete (&lt;code&gt;d&lt;/code&gt;), yank (&lt;code&gt;y&lt;/code&gt;), or change (&lt;code&gt;c&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mistake:&lt;/strong&gt; Using the mouse or skipping Visual mode.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Fix:&lt;/strong&gt; Practice visual selection and commands. You’ll edit faster, and without lifting your hands.&lt;/p&gt;


&lt;h2&gt;
  
  
  6. Never Customizing &lt;code&gt;.vimrc&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Out-of-the-box Vim is... bare. If you're not tweaking your &lt;code&gt;.vimrc&lt;/code&gt;, you're missing out on major improvements:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="k"&gt;number&lt;/span&gt;              " Show &lt;span class="nb"&gt;line&lt;/span&gt; numbers
&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="nb"&gt;relativenumber&lt;/span&gt;      " Show relative &lt;span class="nb"&gt;line&lt;/span&gt; numbers
&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="nb"&gt;autoindent&lt;/span&gt;          " Keep indentation &lt;span class="k"&gt;on&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;lines&lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="nb"&gt;tabstop&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;           " Set &lt;span class="k"&gt;tab&lt;/span&gt; width
&lt;span class="nb"&gt;syntax&lt;/span&gt; &lt;span class="k"&gt;on&lt;/span&gt;               " Enable &lt;span class="nb"&gt;syntax&lt;/span&gt; highlighting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Mistake:&lt;/strong&gt; Using Vim as-is forever.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Fix:&lt;/strong&gt; Learn how to configure your &lt;code&gt;.vimrc&lt;/code&gt; file. Start small, tweak often.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 &lt;strong&gt;What is &lt;code&gt;.vimrc&lt;/code&gt;?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;.vimrc&lt;/code&gt; is a configuration file that lives in your home directory &lt;code&gt;~/.vimrc&lt;/code&gt;). It's used to personalize Vim based on your preferences — you can set options like line numbers, indentation, syntax highlighting, remap keys, and so much more.&lt;br&gt;
&lt;strong&gt;Here's how to create or open it:&lt;/strong&gt;&lt;/p&gt;


&lt;pre class="highlight shell"&gt;&lt;code&gt;vim ~/.vimrc
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Example content:&lt;/strong&gt;&lt;/p&gt;


&lt;pre class="highlight viml"&gt;&lt;code&gt;&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="k"&gt;number&lt;/span&gt;
&lt;span class="nb"&gt;syntax&lt;/span&gt; &lt;span class="k"&gt;on&lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="nb"&gt;tabstop&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="nb"&gt;shiftwidth&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="nb"&gt;expandtab&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Once saved, these settings will load every time you open Vim.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  7. Forgetting How to Quit (yes, still)
&lt;/h2&gt;

&lt;p&gt;This one never dies. Even after months of Vim, sometimes I still catch myself typing &lt;code&gt;:wq!&lt;/code&gt; when I just needed &lt;code&gt;:q&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mistake:&lt;/strong&gt; Panicking when trying to exit Vim.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Fix:&lt;/strong&gt; Get comfortable with the essentials:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;:w&lt;/code&gt; → Save&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;:q&lt;/code&gt; → Quit&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;:wq&lt;/code&gt; → Save and quit&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;:q!&lt;/code&gt; → Quit without saving&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And yes, &lt;code&gt;ZZ&lt;/code&gt; still works too.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Thinking You Know Vim After the First Week
&lt;/h2&gt;

&lt;p&gt;Vim is deep. Like rabbit-hole deep.&lt;/p&gt;

&lt;p&gt;Just because you’ve memorized &lt;code&gt;:wq&lt;/code&gt;, &lt;code&gt;i&lt;/code&gt;, and a few navigation keys doesn’t mean you’re done. Vim has macros, registers, plugins, buffers, folds, and so much more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mistake:&lt;/strong&gt; Settling too early.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Fix:&lt;/strong&gt; Keep exploring. Read the Vim help (&lt;code&gt;:help&lt;/code&gt;). Watch other people use it. Keep refining your flow.&lt;/p&gt;

&lt;p&gt;Your goal? Make editing &lt;em&gt;feel&lt;/em&gt; like typing. Seamless. Thoughtless. Fast.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Summary
&lt;/h2&gt;

&lt;p&gt;Vim isn’t hard — it’s just different. And it’s easy to make mistakes when you treat it like a regular editor.&lt;/p&gt;

&lt;p&gt;These were the things I did wrong. You might be doing some of them too. And that’s okay. You’re learning. And that's how we all progress.&lt;/p&gt;

&lt;p&gt;If you’ve got a Vim mistake you used to make (or still do), share it in the comments. Let’s grow together; one keystroke at a time.&lt;/p&gt;




</description>
      <category>linux</category>
      <category>devops</category>
      <category>cloud</category>
      <category>cloudwhistler</category>
    </item>
    <item>
      <title>Understanding Users in Linux: Who’s Using the System? (Day 3 of 30)</title>
      <dc:creator>Sheikh Hassaan Bin Nadeem</dc:creator>
      <pubDate>Tue, 08 Apr 2025 20:43:27 +0000</pubDate>
      <link>https://dev.to/sheikhhassaanbinnadeem/understanding-users-in-linux-whos-using-the-system-2d2a</link>
      <guid>https://dev.to/sheikhhassaanbinnadeem/understanding-users-in-linux-whos-using-the-system-2d2a</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
What is a User?
&lt;/li&gt;
&lt;li&gt;
Types of Users in Linux
&lt;/li&gt;
&lt;li&gt;
How Linux Identifies Users (UIDs)
&lt;/li&gt;
&lt;li&gt;
Where Is User Information Stored?
&lt;/li&gt;
&lt;li&gt;
Essential User Management Commands
&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ol&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.amazonaws.com%2Fuploads%2Farticles%2F0zton0o608z0fpth638p.jpg" 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.amazonaws.com%2Fuploads%2Farticles%2F0zton0o608z0fpth638p.jpg" alt="Linux Users Management Mind Map" width="800" height="582"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What is a User?
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;user&lt;/strong&gt; is simply someone who logs into a Linux system. Each user has an account; a unique identity, that determines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What they can do
&lt;/li&gt;
&lt;li&gt;What files they own
&lt;/li&gt;
&lt;li&gt;What resources they can access
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You could think of it like this: if Linux was a house, users are the people with keys, each with different access levels.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Types of Users in Linux
&lt;/h2&gt;

&lt;h3&gt;
  
  
  a. System Users
&lt;/h3&gt;

&lt;p&gt;These accounts are created &lt;strong&gt;automatically&lt;/strong&gt; when Linux is installed. They're mostly used by the system and background services, not real people.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;root&lt;/code&gt; – the superuser (has unlimited control)
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;apache&lt;/code&gt; – used by web servers
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mysql&lt;/code&gt; – used by the database engine
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  b. Normal Users
&lt;/h3&gt;

&lt;p&gt;These are the actual &lt;strong&gt;human users&lt;/strong&gt; who log in to do work. They can be added, edited, or deleted by an administrator (or the &lt;code&gt;root&lt;/code&gt; user).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
If you create a user called &lt;code&gt;Hassaan&lt;/code&gt;, Linux sets up an account for &lt;code&gt;Hassaan&lt;/code&gt;, gives them a home directory, and assigns them basic privileges.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. How Linux Identifies Users (UIDs)
&lt;/h2&gt;

&lt;p&gt;Behind the scenes, Linux assigns a &lt;strong&gt;UID (User ID)&lt;/strong&gt; to every account. This UID is what the system actually uses to track users, not the usernames.&lt;/p&gt;

&lt;h3&gt;
  
  
  UID Ranges:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;0 – 999&lt;/code&gt; → &lt;strong&gt;System Users&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;1000 – 60000&lt;/code&gt; → &lt;strong&gt;Normal Users&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Where Is User Information Stored?
&lt;/h2&gt;

&lt;p&gt;Linux keeps user data in special configuration files:&lt;/p&gt;

&lt;h3&gt;
  
  
  - &lt;code&gt;/etc/passwd&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Stores general info like usernames, UIDs, home directories, and default shells.&lt;/p&gt;

&lt;h3&gt;
  
  
  - &lt;code&gt;/etc/shadow&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Stores password-related info (in a secure, encrypted format). Only root can read this file.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Essential User Management Commands
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ➕ Create a New User
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;useradd &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔑 Set or Change Password
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;passwd &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🧾 Check User Account Info
&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;grep&lt;/span&gt; &amp;lt;username&amp;gt; /etc/passwd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔐 Check Password Info
&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;grep&lt;/span&gt; &amp;lt;username&amp;gt; /etc/shadow
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔁 Switch to Another User
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;su &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ❌ Delete a User Account
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep user data:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;userdel &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Delete user and their home directory:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;userdel &lt;span class="nt"&gt;-r&lt;/span&gt; &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6. Summary
&lt;/h2&gt;

&lt;p&gt;Today’s Linux journey focused on user management, from creating users to checking their information and managing their accounts. Here’s a quick recap:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;System users vs normal users&lt;/li&gt;
&lt;li&gt;Linux uses UIDs to identify users (not just usernames)&lt;/li&gt;
&lt;li&gt;You can easily create, modify, and delete users via the terminal&lt;/li&gt;
&lt;li&gt;User data is stored in /etc/passwd and /etc/shadow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tomorrow, we’ll take it a step further and dive into groups and permissions, how users interact with files and what access they have.&lt;/p&gt;

&lt;p&gt;Until then, try running a few of these commands on your own system to explore how users are managed. You might discover some interesting things!&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>cloud</category>
      <category>cloudwhistler</category>
    </item>
    <item>
      <title>Mastering File Operations in Linux: The Power of cp, mv, mkdir, and More (Day 2 of 30)</title>
      <dc:creator>Sheikh Hassaan Bin Nadeem</dc:creator>
      <pubDate>Mon, 07 Apr 2025 23:19:31 +0000</pubDate>
      <link>https://dev.to/sheikhhassaanbinnadeem/mastering-file-operations-in-linux-the-power-of-cp-mv-mkdir-and-more-day-2-of-30-3g24</link>
      <guid>https://dev.to/sheikhhassaanbinnadeem/mastering-file-operations-in-linux-the-power-of-cp-mv-mkdir-and-more-day-2-of-30-3g24</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
Introduction
&lt;/li&gt;
&lt;li&gt;
The Power of Simple Commands

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cp&lt;/code&gt; – Copy Files and Folders
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mv&lt;/code&gt; – Move or Rename with Control
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mkdir&lt;/code&gt; – Create Directories Like a Pro
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rm&lt;/code&gt; – Remove with Caution
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;touch&lt;/code&gt; – Quickly Create Empty Files
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
Summary
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;When working with Linux, the real magic often begins with basic file operations. Whether you’re organizing configuration files, preparing codebases, or setting up automated scripts — commands like &lt;code&gt;cp&lt;/code&gt;, &lt;code&gt;mv&lt;/code&gt;, &lt;code&gt;mkdir&lt;/code&gt;, and others are your everyday tools. Think of them as your file management toolkit — fast, reliable, and always available right inside your terminal.&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.amazonaws.com%2Fuploads%2Farticles%2Fw8t3c3hwlckuckvkpvu8.jpg" 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.amazonaws.com%2Fuploads%2Farticles%2Fw8t3c3hwlckuckvkpvu8.jpg" alt="Linux Commands Mind Map" width="800" height="358"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The Power of Simple Commands
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;cp&lt;/code&gt; – Copy Files and Folders
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The &lt;code&gt;cp&lt;/code&gt; command lets you copy files or directories from one place to another.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Copy a file from your current directory to a backup folder:&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.amazonaws.com%2Fuploads%2Farticles%2F7ojexlm0pul8f1j9i2vx.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.amazonaws.com%2Fuploads%2Farticles%2F7ojexlm0pul8f1j9i2vx.png" alt="Linux cp command" width="800" height="110"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Backups often start here. You may not use &lt;code&gt;cp&lt;/code&gt; for large-scale backup solutions (like &lt;code&gt;rsync&lt;/code&gt; or &lt;code&gt;tar&lt;/code&gt;), but for small manual backups or quick duplication, it's perfect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Use &lt;code&gt;-r&lt;/code&gt; for recursive copy (directories), and &lt;code&gt;-v&lt;/code&gt; for verbose output.&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.amazonaws.com%2Fuploads%2Farticles%2Fvyaplli0yokftggwrqhe.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.amazonaws.com%2Fuploads%2Farticles%2Fvyaplli0yokftggwrqhe.png" alt="Linux cp -r command" width="800" height="92"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;mv&lt;/code&gt; – Move or Rename with Control
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Moves files/directories from one location to another. It also acts as the "rename" command in Linux.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Rename a file:&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.amazonaws.com%2Fuploads%2Farticles%2Fzsf9xqkgpineo6y1oaq3.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.amazonaws.com%2Fuploads%2Farticles%2Fzsf9xqkgpineo6y1oaq3.png" alt="Linux mv command" width="800" height="95"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Move a file to another folder:&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.amazonaws.com%2Fuploads%2Farticles%2Fwknoir41ev5e3i9gjwm2.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.amazonaws.com%2Fuploads%2Farticles%2Fwknoir41ev5e3i9gjwm2.png" alt="Linux mv command to move" width="800" height="95"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
When organizing files or managing logs, &lt;code&gt;mv&lt;/code&gt; helps clean things up or archive old files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
If you're renaming a lot of files, combine &lt;code&gt;mv&lt;/code&gt; with shell scripting or &lt;code&gt;find&lt;/code&gt; for batch renaming.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;mkdir&lt;/code&gt; – Create Directories Like a Pro
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Used to create one or more directories.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Create a folder structure in one go:&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.amazonaws.com%2Fuploads%2Farticles%2F5oo2o7u4rxdt4r4pokhp.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.amazonaws.com%2Fuploads%2Farticles%2F5oo2o7u4rxdt4r4pokhp.png" alt="Linux mkdir command" width="800" height="95"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Directory planning is key for maintainability. &lt;code&gt;mkdir&lt;/code&gt; helps you quickly set up organized environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Use &lt;code&gt;-p&lt;/code&gt; to create parent directories automatically — it saves time and prevents errors.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;rm&lt;/code&gt; – Remove with Caution
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Deletes files or directories.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Remove a file:&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.amazonaws.com%2Fuploads%2Farticles%2F3w8251ca1m6uk26hyfcy.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.amazonaws.com%2Fuploads%2Farticles%2F3w8251ca1m6uk26hyfcy.png" alt="Linux rm Command" width="800" height="92"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Remove a directory and everything inside it:&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.amazonaws.com%2Fuploads%2Farticles%2F0xwf2cgqe95hpvt65j1p.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.amazonaws.com%2Fuploads%2Farticles%2F0xwf2cgqe95hpvt65j1p.png" alt="Linux rm -rf command" width="800" height="79"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Clean up is part of system maintenance. But misuse can be risky — especially when used with &lt;code&gt;-rf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
On modern Linux systems like Red Hat 9, &lt;code&gt;rm -rf /&lt;/code&gt; is blocked by default for safety — but you should never try it anyway.&lt;br&gt;&lt;br&gt;
If you force it using &lt;code&gt;--no-preserve-root&lt;/code&gt;, it will attempt to delete your entire system.&lt;/p&gt;

&lt;p&gt;Instead, set an alias to add a confirmation prompt:&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.amazonaws.com%2Fuploads%2Farticles%2Fhf86mng9ag0jxuxmb77w.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.amazonaws.com%2Fuploads%2Farticles%2Fhf86mng9ag0jxuxmb77w.png" alt="Linux rm -rf in RHEL 9" width="800" height="88"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;touch&lt;/code&gt; – Quickly Create Empty Files
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Creates new, empty files or updates timestamps on existing ones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Create a new log file or placeholder:&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.amazonaws.com%2Fuploads%2Farticles%2Fho050sh1lhnqzepgj1ve.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.amazonaws.com%2Fuploads%2Farticles%2Fho050sh1lhnqzepgj1ve.png" alt="Linux touch command" width="800" height="80"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Used in scripting, testing, and placeholder creation. It’s lightweight but powerful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Combine with &lt;code&gt;mkdir&lt;/code&gt; to create folder/file structures for new projects:&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.amazonaws.com%2Fuploads%2Farticles%2Fbez1qgnok0f2qeup1vs7.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.amazonaws.com%2Fuploads%2Farticles%2Fbez1qgnok0f2qeup1vs7.png" alt="Linux mkdir command" width="800" height="106"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Summary
&lt;/h2&gt;

&lt;p&gt;The basic commands in Linux like &lt;code&gt;cp&lt;/code&gt;, &lt;code&gt;mv&lt;/code&gt;, &lt;code&gt;mkdir&lt;/code&gt;, &lt;code&gt;rm&lt;/code&gt;, and &lt;code&gt;touch&lt;/code&gt; are more than just simple tools — they’re fundamental to daily workflows. Once you get comfortable with them, you’ll navigate your system with ease, automate smartly, and build the habits of a Linux power user.&lt;/p&gt;

&lt;p&gt;As we progress in this 30-day journey, mastering these basics will give you the confidence to handle more advanced scripting, backups, and DevOps tasks with clarity.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>cloud</category>
      <category>cloudwhistler</category>
    </item>
    <item>
      <title>Linux Filesystem: Understanding the Core Structure (Day 1 of 30)</title>
      <dc:creator>Sheikh Hassaan Bin Nadeem</dc:creator>
      <pubDate>Sun, 06 Apr 2025 21:46:40 +0000</pubDate>
      <link>https://dev.to/sheikhhassaanbinnadeem/linux-filesystem-understanding-the-core-structure-day-1-of-30-2m0j</link>
      <guid>https://dev.to/sheikhhassaanbinnadeem/linux-filesystem-understanding-the-core-structure-day-1-of-30-2m0j</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Understanding the Root &lt;code&gt;/&lt;/code&gt; Directory&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/home&lt;/code&gt; – User Data Lives Here&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/root&lt;/code&gt; – Superuser’s Space&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/bin&lt;/code&gt; and &lt;code&gt;/sbin&lt;/code&gt; – Essential Binaries&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/etc&lt;/code&gt; – Configurations&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/usr&lt;/code&gt; – Shared User Resources&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/opt&lt;/code&gt; – Optional Software&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/tmp&lt;/code&gt; – Temporary Storage&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/proc&lt;/code&gt; – Process Info&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/var&lt;/code&gt; – Logs and Runtime Data&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/dev&lt;/code&gt; – Device Interfaces&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;The Linux filesystem forms the backbone of how data, applications, and services are organized on any Linux-based system. Whether you're working as a system admin, cloud engineer, or DevOps practitioner, knowing where everything lives is a critical first step in becoming comfortable with Linux.&lt;/p&gt;

&lt;h2&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.amazonaws.com%2Fuploads%2Farticles%2Fk52od3y65pyd07rof9ll.jpg" alt="File System Hierarchy" width="800" height="650"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  2. Linux Filesystem Breakdown
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;/&lt;/code&gt; – Root Directory
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The root (&lt;code&gt;/&lt;/code&gt;) is the top-level directory in the Linux hierarchy. Everything begins here &amp;amp; every other directory branches from this point.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
All filesystems are mounted under this directory. It’s your starting point when navigating the system via the command line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Understanding that everything flows from &lt;code&gt;/&lt;/code&gt; helps you avoid confusion when navigating or scripting in Linux.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Avoid writing files directly in &lt;code&gt;/&lt;/code&gt;. It's reserved for system-level folders, not user data.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;/home&lt;/code&gt; – User Home
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Contains personal directories for each user (e.g., &lt;code&gt;/home/ali&lt;/code&gt;). This is where user files, settings, and custom configurations are stored.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A developer or system user keeps all project files, downloads, and personal shell settings here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Keeps user data isolated from system files, reducing the risk of accidental system changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Set up disk quotas or backups per &lt;code&gt;/home/username&lt;/code&gt; to manage user storage effectively.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;/root&lt;/code&gt; – Superuser’s Space
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This is the root user’s personal directory, separate from other users for security reasons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
System administrators use this when logged in as root to perform high-privilege tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Segregates critical administrative tasks from regular user operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Avoid using the root account directly unless absolutely necessary. Use &lt;code&gt;sudo&lt;/code&gt; instead.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;/bin&lt;/code&gt; and &lt;code&gt;/sbin&lt;/code&gt; – Essential Binaries
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/bin&lt;/code&gt;: Basic commands available to all users (e.g., &lt;code&gt;cp&lt;/code&gt;, &lt;code&gt;mv&lt;/code&gt;, &lt;code&gt;ls&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/sbin&lt;/code&gt;: System-level commands for admins (e.g., &lt;code&gt;shutdown&lt;/code&gt;, &lt;code&gt;mount&lt;/code&gt;, &lt;code&gt;ip&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Commands stored here are used during both normal operations and system recovery.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
These are available even if other directories like &lt;code&gt;/usr&lt;/code&gt; are not mounted during boot.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Use &lt;code&gt;which&lt;/code&gt; or &lt;code&gt;whereis&lt;/code&gt; to locate command binaries and verify where they’re stored.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;/etc&lt;/code&gt; – Configurations
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Holds all system-wide configuration files for services, applications, and system settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Edit files like &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt; to configure the SSH server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This is where the brain of your system lives in terms of how it behaves.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Always back up config files before modifying them. Use version control if possible.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;/usr&lt;/code&gt; – Shared User Resources
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Contains user-facing programs and libraries. Think of it as a second root for user applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Software installed from repositories often lives here (&lt;code&gt;/usr/bin&lt;/code&gt;, &lt;code&gt;/usr/lib&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Separates core OS files from user-installed applications and documentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Don’t confuse &lt;code&gt;/usr&lt;/code&gt; with &lt;code&gt;/home&lt;/code&gt;: this is for shared resources, not individual user data.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;/opt&lt;/code&gt; – Optional Software
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Used for manually or third-party installed software that doesn’t come from package managers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Installing a custom monitoring tool or analytics dashboard.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Keeps your manual installs from cluttering system directories.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Use this for organizing non-standard apps like Java, ElasticSearch, etc.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;/tmp&lt;/code&gt; – Temporary Storage
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A scratch space for temporary files. Often cleared on reboot.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Used by applications or users to store temporary runtime data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Helps avoid clutter in main directories and improves app performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Never store critical data here. It could be wiped after a restart.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;/proc&lt;/code&gt; – Process Info
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A virtual filesystem containing runtime system information and process data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Check system resources (&lt;code&gt;/proc/cpuinfo&lt;/code&gt;, &lt;code&gt;/proc/meminfo&lt;/code&gt;) or inspect running processes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Provides a real-time window into system operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
You can read from it like a file using &lt;code&gt;cat&lt;/code&gt;, e.g., &lt;code&gt;cat /proc/uptime&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;/var&lt;/code&gt; – Logs and Runtime Data
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Contains files that frequently change: logs, caches, mail, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Monitor logs (&lt;code&gt;/var/log/syslog&lt;/code&gt;, &lt;code&gt;/var/log/auth.log&lt;/code&gt;) to debug errors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Critical for system monitoring, troubleshooting, and auditing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Set up log rotation and monitoring alerts on this directory.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;/dev&lt;/code&gt; – Device Interfaces
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Represents hardware devices as files (e.g., &lt;code&gt;/dev/sda&lt;/code&gt; for a hard disk).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Mount USB drives or interact with hardware components directly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Matters:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Allows Linux to treat everything as a file—including hardware.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Use &lt;code&gt;lsblk&lt;/code&gt; or &lt;code&gt;fdisk -l&lt;/code&gt; to safely explore connected devices.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The Linux filesystem is logically structured, and each directory has a specific role.
&lt;/li&gt;
&lt;li&gt;Mastering it gives you control, confidence, and clarity while working on servers or embedded systems.
&lt;/li&gt;
&lt;li&gt;This foundational knowledge will help in upcoming topics like user management, permissions, and system troubleshooting.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>cloud</category>
      <category>cloudwhistler</category>
    </item>
  </channel>
</rss>
