<?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: Asaduzzaman Sunam</title>
    <description>The latest articles on DEV Community by Asaduzzaman Sunam (@sunam007).</description>
    <link>https://dev.to/sunam007</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%2F1073750%2Fe355a703-3e4b-4200-9b84-f402bf7b6c7c.jpeg</url>
      <title>DEV Community: Asaduzzaman Sunam</title>
      <link>https://dev.to/sunam007</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sunam007"/>
    <language>en</language>
    <item>
      <title>Linux User and Group Management | Episode 3</title>
      <dc:creator>Asaduzzaman Sunam</dc:creator>
      <pubDate>Sat, 09 May 2026 16:12:50 +0000</pubDate>
      <link>https://dev.to/sunam007/linux-user-and-group-management-episode-3-347b</link>
      <guid>https://dev.to/sunam007/linux-user-and-group-management-episode-3-347b</guid>
      <description>&lt;p&gt;Managing users and groups is a fundamental aspect of Linux system administration. &lt;/p&gt;

&lt;p&gt;By the end of this blog, we will learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create user accounts.&lt;/li&gt;
&lt;li&gt;Create and manage groups.&lt;/li&gt;
&lt;li&gt;Assign users to primary and supplementary groups.&lt;/li&gt;
&lt;li&gt;Lock and verify user accounts.&lt;/li&gt;
&lt;li&gt;Unlock user accounts.&lt;/li&gt;
&lt;li&gt;List all users.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Understanding Key Concepts
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Primary Group
&lt;/h4&gt;

&lt;p&gt;The primary group is the default group assigned to a user when they create files or directories.&lt;/p&gt;

&lt;p&gt;Every user must belong to exactly one primary group.&lt;/p&gt;

&lt;p&gt;By default, when creating a user, the system creates a group with the same name as the username and assigns it as the primary group.&lt;/p&gt;

&lt;h4&gt;
  
  
  Supplementary Groups
&lt;/h4&gt;

&lt;p&gt;Supplementary groups are additional groups a user belongs to, granting extra permissions beyond their primary group.&lt;/p&gt;

&lt;p&gt;A user can belong to multiple supplementary groups.&lt;br&gt;
These are stored in &lt;code&gt;/etc/group&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;Imagine a company where employees belong to different departments. When a new software developer joins, they are assigned to the &lt;code&gt;Developers&lt;/code&gt; group as their primary group. However, they also need access to project documentation, so they are added to the &lt;code&gt;Docs&lt;/code&gt; group as a supplementary group.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Adding Users to the System
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Objective:&lt;/strong&gt; Create user accounts for employees of &lt;code&gt;Meowhoo Labs&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;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;sudo &lt;/span&gt;useradd &amp;lt;username&amp;gt;

&lt;span class="nb"&gt;sudo &lt;/span&gt;useradd user1
&lt;span class="nb"&gt;sudo &lt;/span&gt;useradd user2
&lt;span class="nb"&gt;sudo &lt;/span&gt;useradd user3
&lt;span class="nb"&gt;sudo &lt;/span&gt;useradd user4


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(no output — users created successfully)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;useradd&lt;/code&gt; command creates a new user.&lt;/li&gt;
&lt;li&gt;By default, a home directory is assigned unless specified otherwise.&lt;/li&gt;
&lt;li&gt;The primary group is the same as the username by default.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;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;id &lt;/span&gt;user1

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uid=1001(user1) gid=1001(user1) groups=1001(user1)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output shows that &lt;code&gt;user1&lt;/code&gt; has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;UID 1001 (User ID) and GID 1001 (Group ID), meaning they belong to a primary group named user1.&lt;/li&gt;
&lt;li&gt;No supplementary groups, so they only have access to resources assigned to their primary group.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Creating the &lt;code&gt;meow-land&lt;/code&gt; Group
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Objective:&lt;/strong&gt; Create a group for administrative users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;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;sudo &lt;/span&gt;groupadd meow-land

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(no output — group created)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;groupadd&lt;/code&gt; command creates a new group.&lt;/li&gt;
&lt;li&gt;Groups allow multiple users to share permissions efficiently.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;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;getent group meow-land

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;meow-land:x:1005:

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This output shows that the group &lt;code&gt;meow-land&lt;/code&gt; exists with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;GID 1005&lt;/code&gt; (Group ID).&lt;/li&gt;
&lt;li&gt;No users listed, meaning no one is currently a member of this group.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Assigning a Primary Group to a User
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Objective:&lt;/strong&gt; Set &lt;code&gt;meow-land&lt;/code&gt; as the primary group for &lt;code&gt;user1&lt;/code&gt;.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-g&lt;/span&gt; meow-land user1

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(no output — primary group changed for user1)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;usermod&lt;/code&gt; command modifies user settings.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;-g&lt;/code&gt; option changes the primary group.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Verification&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;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;id &lt;/span&gt;user1

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uid=1001(user1) gid=1005(meow-land) groups=1005(meow-land)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This output shows that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;user1&lt;/code&gt; has UID 1001 (User ID).&lt;/li&gt;
&lt;li&gt;Primary group is now &lt;code&gt;meow-land&lt;/code&gt; with GID 1005.&lt;/li&gt;
&lt;li&gt;Belongs only to the &lt;code&gt;meow-land&lt;/code&gt; group (no supplementary groups).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can also verify the group of user1 by:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;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;groups &lt;/span&gt;user1

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user1 : meow-land

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Adding Users to a Supplementary Group
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Objective:&lt;/strong&gt; Add &lt;code&gt;user2&lt;/code&gt;, &lt;code&gt;user3&lt;/code&gt;, and &lt;code&gt;user4&lt;/code&gt; to &lt;code&gt;meow-land&lt;/code&gt; as a supplementary group.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;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;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; meow-land user2
&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; meow-land user3
&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; meow-land user4

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(no output — usermod success)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;&lt;strong&gt;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;id &lt;/span&gt;user2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uid=1002(user2) gid=1002(user2) groups=1002(user2),1005(meow-land)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output shows the user user2 and their group memberships:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;uid=1002(user2) → user2 has a user ID (UID) of 1002.&lt;/li&gt;
&lt;li&gt;gid=1002(user2) → user2's primary group is 1002(user2).&lt;/li&gt;
&lt;li&gt;groups=1002(user2),1005(meow-land) → user2 is also a supplementary member of the &lt;code&gt;meow-land&lt;/code&gt; group (GID 1005).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can also verify the group of &lt;code&gt;user2&lt;/code&gt; by:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;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;groups &lt;/span&gt;user2

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user2 : user2 meow-land

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also check the members of the group &lt;code&gt;meow-land&lt;/code&gt; by:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;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;getent group meow-land

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;o/p&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;meow&lt;/span&gt;-&lt;span class="n"&gt;land&lt;/span&gt;:&lt;span class="n"&gt;x&lt;/span&gt;:&lt;span class="m"&gt;1005&lt;/span&gt;:&lt;span class="n"&gt;user2&lt;/span&gt;,&lt;span class="n"&gt;user3&lt;/span&gt;,&lt;span class="n"&gt;user4&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This output shows that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Group name: &lt;code&gt;meow-land&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;GID (Group ID): 1005&lt;/li&gt;
&lt;li&gt;Members: user2, user3, user4 (they are part of this supplementary group)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: &lt;code&gt;user1&lt;/code&gt; is not listed as a member of &lt;code&gt;meow-land&lt;/code&gt; because user1's primary group is set to &lt;code&gt;meow-land&lt;/code&gt; (GID 1005), rather than being added as a supplementary group member.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Locking a User Account
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Objective:&lt;/strong&gt; Suppose &lt;code&gt;user4&lt;/code&gt; is on a long vacation and we need to temporarily disable the user account of &lt;code&gt;user4&lt;/code&gt; so that he cannot log in to the system.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-L&lt;/span&gt; user4

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;o/p&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(no output — account locked successfully)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;-L&lt;/code&gt; option locks an account, preventing password-based login.&lt;/li&gt;
&lt;li&gt;The user’s data remains intact.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;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;passwd &lt;span class="nt"&gt;-S&lt;/span&gt; user4

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;o/p&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user4 L 09/05/2026 0 99999 7 -1

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;The output of &lt;code&gt;passwd -S user4&lt;/code&gt; provides the status of the user account user4:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;L&lt;/code&gt; → The account is locked, meaning the user cannot log in.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;09/05/2026&lt;/code&gt; → Last password change date.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;0&lt;/code&gt; → Minimum days before the password can be changed (0 means no restriction).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;99999&lt;/code&gt; → Maximum days before the password expires (99999 means never expires).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;7&lt;/code&gt; → Warning period (days before expiration to notify the user).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-1&lt;/code&gt;→ Password inactivity period (-1 means no automatic account deactivation).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. Unlocking a User Account
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Objective:&lt;/strong&gt; After user4's vacation, we need to unlock his account so that he can log in to the system again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;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;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-U&lt;/span&gt; user4

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;usermod: unlocking the user's password would result in a passwordless account.
You should set a password with usermod -p to unlock this user's password.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Oops! Seems like we have encountered an error. This error occurs because the user account &lt;code&gt;user4&lt;/code&gt; does not have a password set, and unlocking it with usermod &lt;code&gt;-U&lt;/code&gt; would leave the account passwordless (a security risk). To resolve this, you need to set a password for the user first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set a password first:&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;sudo &lt;/span&gt;passwd user4

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Then unlock the account:&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;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-U&lt;/span&gt; user4

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(no output — account unlocked successfully)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;&lt;strong&gt;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;passwd &lt;span class="nt"&gt;-S&lt;/span&gt; user4

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user4 P 09/05/2026 0 99999 7 -1

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;The output of &lt;code&gt;passwd -S user4&lt;/code&gt; provides the status of the user account &lt;code&gt;user4&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-U&lt;/code&gt; →  The account has a usable password (unlocked).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;09/05/2026&lt;/code&gt; → Last password change date.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;0&lt;/code&gt; → Minimum days before the password can be changed (0 means no restriction).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;99999&lt;/code&gt; → Maximum days before the password expires (99999 means never expires).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;7&lt;/code&gt; → Warning period (days before expiration to notify the user).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-1&lt;/code&gt;→ Password inactivity period (-1 means no automatic account deactivation).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means user4's account is now active with a password set.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. List All Users
&lt;/h2&gt;

&lt;p&gt;to see all users present in a Linux system, we can check the &lt;code&gt;/etc/passwd&lt;/code&gt; file, which contains user account information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;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;cat&lt;/span&gt; /etc/passwd

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;root&lt;/span&gt;:&lt;span class="n"&gt;x&lt;/span&gt;:&lt;span class="m"&gt;0&lt;/span&gt;:&lt;span class="m"&gt;0&lt;/span&gt;:&lt;span class="n"&gt;root&lt;/span&gt;:/&lt;span class="n"&gt;root&lt;/span&gt;:/&lt;span class="n"&gt;bin&lt;/span&gt;/&lt;span class="n"&gt;bash&lt;/span&gt;
&lt;span class="n"&gt;daemon&lt;/span&gt;:&lt;span class="n"&gt;x&lt;/span&gt;:&lt;span class="m"&gt;1&lt;/span&gt;:&lt;span class="m"&gt;1&lt;/span&gt;:&lt;span class="n"&gt;daemon&lt;/span&gt;:/&lt;span class="n"&gt;usr&lt;/span&gt;/&lt;span class="n"&gt;sbin&lt;/span&gt;:/&lt;span class="n"&gt;usr&lt;/span&gt;/&lt;span class="n"&gt;sbin&lt;/span&gt;/&lt;span class="n"&gt;nologin&lt;/span&gt;
&lt;span class="n"&gt;bin&lt;/span&gt;:&lt;span class="n"&gt;x&lt;/span&gt;:&lt;span class="m"&gt;2&lt;/span&gt;:&lt;span class="m"&gt;2&lt;/span&gt;:&lt;span class="n"&gt;bin&lt;/span&gt;:/&lt;span class="n"&gt;bin&lt;/span&gt;:/&lt;span class="n"&gt;usr&lt;/span&gt;/&lt;span class="n"&gt;sbin&lt;/span&gt;/&lt;span class="n"&gt;nologin&lt;/span&gt;
.
.
.
.
.
.
.

&lt;span class="n"&gt;user1&lt;/span&gt;:&lt;span class="n"&gt;x&lt;/span&gt;:&lt;span class="m"&gt;1001&lt;/span&gt;:&lt;span class="m"&gt;1005&lt;/span&gt;::/&lt;span class="n"&gt;home&lt;/span&gt;/&lt;span class="n"&gt;user1&lt;/span&gt;:/&lt;span class="n"&gt;bin&lt;/span&gt;/&lt;span class="n"&gt;bash&lt;/span&gt;   &lt;span class="c"&gt;# GID 1005 = meow-land
&lt;/span&gt;&lt;span class="n"&gt;user2&lt;/span&gt;:&lt;span class="n"&gt;x&lt;/span&gt;:&lt;span class="m"&gt;1002&lt;/span&gt;:&lt;span class="m"&gt;1002&lt;/span&gt;::/&lt;span class="n"&gt;home&lt;/span&gt;/&lt;span class="n"&gt;user2&lt;/span&gt;:/&lt;span class="n"&gt;bin&lt;/span&gt;/&lt;span class="n"&gt;bash&lt;/span&gt;
&lt;span class="n"&gt;user3&lt;/span&gt;:&lt;span class="n"&gt;x&lt;/span&gt;:&lt;span class="m"&gt;1003&lt;/span&gt;:&lt;span class="m"&gt;1003&lt;/span&gt;::/&lt;span class="n"&gt;home&lt;/span&gt;/&lt;span class="n"&gt;user3&lt;/span&gt;:/&lt;span class="n"&gt;bin&lt;/span&gt;/&lt;span class="n"&gt;bash&lt;/span&gt;
&lt;span class="n"&gt;user4&lt;/span&gt;:&lt;span class="n"&gt;x&lt;/span&gt;:&lt;span class="m"&gt;1004&lt;/span&gt;:&lt;span class="m"&gt;1004&lt;/span&gt;::/&lt;span class="n"&gt;home&lt;/span&gt;/&lt;span class="n"&gt;user4&lt;/span&gt;:/&lt;span class="n"&gt;bin&lt;/span&gt;/&lt;span class="n"&gt;bash&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can see all the users are listed, including system-created users like root, daemon, and bin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Mastering user and group management is key to Linux system administration. With these commands, we can securely create, modify, lock, and manage user access with confidence.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>linux</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Linux File System Basics &amp; Navigation | Episode 2</title>
      <dc:creator>Asaduzzaman Sunam</dc:creator>
      <pubDate>Mon, 27 Apr 2026 06:57:19 +0000</pubDate>
      <link>https://dev.to/sunam007/day-1-of-my-devops-journey-linux-file-system-basics-navigation-5gfo</link>
      <guid>https://dev.to/sunam007/day-1-of-my-devops-journey-linux-file-system-basics-navigation-5gfo</guid>
      <description>&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Linux terminal or Windows Subsystem for Linux (WSL)&lt;/li&gt;
&lt;li&gt;Basic familiarity with using a terminal&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Linux file system
&lt;/h2&gt;

&lt;p&gt;A Linux file system is the way Linux organizes and stores files and folders on a computer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Everything starts from one root directory: &lt;code&gt;/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;No C: or D: drives — all files, folders, and devices live somewhere under &lt;code&gt;/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;It's a tree structure: &lt;code&gt;/&lt;/code&gt; → subdirectories → files&lt;/li&gt;
&lt;li&gt;In Linux, devices and directories are also treated as files — everything is considered a file in the system.&lt;/li&gt;
&lt;li&gt;Paths matter: 
# Absolute path → starts with &lt;code&gt;/&lt;/code&gt; 
# Relative path → starts from current folder.&lt;/li&gt;
&lt;li&gt;Case-sensitive: &lt;code&gt;file.txt&lt;/code&gt; ≠ &lt;code&gt;File.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Permissions exist: Every file has read, write, execute permissions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Important directories
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;/home&lt;/code&gt; → user files&lt;br&gt;
&lt;code&gt;/etc&lt;/code&gt; → configuration files&lt;br&gt;
&lt;code&gt;/bin&lt;/code&gt; → basic commands&lt;br&gt;
&lt;code&gt;/dev&lt;/code&gt; → device files&lt;br&gt;
&lt;code&gt;/var&lt;/code&gt; → logs, dynamic data&lt;/p&gt;
&lt;h2&gt;
  
  
  Basic navigation commands
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Viewing Your Current Directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;     &lt;span class="c"&gt;# where am I? (print working directory)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: The &lt;code&gt;pwd&lt;/code&gt; command (Print Working Directory) displays the full path of your current location in the file system. For example, it might output something like &lt;code&gt;/home/&amp;lt;username&amp;gt;/&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Listing Directory Contents&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt;     &lt;span class="c"&gt;# list files and folders in the current directory&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Documents  Downloads  my_folder  notes.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: The &lt;code&gt;ls&lt;/code&gt;command shows all files and directories inside your current location. It helps you quickly see what’s available in that directory.&lt;/p&gt;

&lt;p&gt;Command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt;     &lt;span class="c"&gt;# list all files (including hidden) with detailed information&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;drwxr-xr-x  5 user user 4096 Apr 27 10:00 .
drwxr-xr-x  3 user user 4096 Apr 26 09:00 ..
-rw-r--r--  1 user user   45 Apr 25 14:20 notes.txt
drwxr-xr-x  2 user user 4096 Apr 27 09:50 my_folder
-rw-r--r--  1 user user  220 Apr 20 08:00 .bashrc
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: The &lt;code&gt;ls -la&lt;/code&gt; command lists all files and directories, including hidden ones (those starting with .), in a detailed format. It shows permissions, owner, size, and last modified time for each item.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Creating Directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;my_folder     &lt;span class="c"&gt;# create a new directory named "my_folder"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example o/p:&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;# (no output if successful)&lt;/span&gt;

&lt;span class="nb"&gt;ls
&lt;/span&gt;my_folder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: The &lt;code&gt;mkdir&lt;/code&gt;(make directory) command is used to create a new folder in the current location. If the command runs successfully, it usually doesn’t show any output—you’ll see the new directory when you list files using &lt;code&gt;ls&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Command&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;# Create main directory structure&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/code/lab/projects/website
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/code/lab/documents/reports
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/code/lab/documents/notes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example o/p:&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;# (no output if successful)&lt;/span&gt;

&lt;span class="nb"&gt;ls&lt;/span&gt; ~/code/lab
documents  projects
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: The &lt;code&gt;mkdir -p&lt;/code&gt; command creates directories, including any parent folders that do not already exist. Here, it creates a nested folder structure in one go.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;~&lt;/code&gt; symbol means your home directory. For example, if your username is &lt;code&gt;bond007&lt;/code&gt;, then &lt;code&gt;~&lt;/code&gt; represents &lt;code&gt;/home/bond007&lt;/code&gt; . So &lt;code&gt;~/code&lt;/code&gt; means &lt;code&gt;/home/bond007/code&lt;/code&gt; .&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;-p&lt;/code&gt; flag means create parent directories as needed, so even if code, lab, or documents do not exist yet, Linux will create them automatically.&lt;/p&gt;

&lt;p&gt;Command&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;# Create some sample files&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello World"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ~/code/lab/projects/website/index.html
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Project Plan"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ~/code/lab/documents/reports/plan.txt
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Meeting Notes"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ~/code/lab/documents/notes/meeting.txt
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Todo List"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ~/code/lab/documents/notes/todo.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example o/p:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xs88f18dw59ohbr5ki1.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%2F4xs88f18dw59ohbr5ki1.png" alt=" " width="571" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: The &lt;code&gt;echo&lt;/code&gt; command prints text, and the &lt;code&gt;&amp;gt;&lt;/code&gt; symbol redirects that text into a file, creating it if it doesn’t exist (or overwriting it if it already exists).&lt;/p&gt;

&lt;p&gt;For example, echo &lt;code&gt;"Hello World" &amp;gt; index.html&lt;/code&gt; creates a file named &lt;code&gt;index.html&lt;/code&gt; and writes "Hello World" inside it.&lt;/p&gt;



&lt;p&gt;Command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; ~/code/lab/projects     &lt;span class="c"&gt;# list files and folders inside the projects directory&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: The &lt;code&gt;ls ~/code/lab/projects&lt;/code&gt; command shows the contents of the projects directory without needing to navigate into it. The &lt;code&gt;~&lt;/code&gt; represents your home directory (e.g., &lt;code&gt;/home/bond007&lt;/code&gt;), so this command lists everything inside &lt;code&gt;/home/bond007/code/lab/projects&lt;/code&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Navigating to directories&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;my_folder     &lt;span class="c"&gt;# move into the "my_folder" directory&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: The &lt;code&gt;cd&lt;/code&gt; (change directory) command is used to navigate between directories in the file system. It changes your current location to the specified folder.&lt;/p&gt;

&lt;p&gt;Command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ..     &lt;span class="c"&gt;# move one level up (to the parent directory)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: The &lt;code&gt;cd ..&lt;/code&gt; command moves you one level up from your current directory to its parent. The &lt;code&gt;..&lt;/code&gt; represents the parent directory in the file system.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Finding Files with &lt;code&gt;find&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;find&lt;/code&gt; command is used to search files and directories in Linux based on different conditions like name, type, size, time, etc.&lt;/p&gt;

&lt;p&gt;Find by &lt;code&gt;name&lt;/code&gt; and Find by &lt;code&gt;type&lt;/code&gt; are two most important types of find commands&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Find by name&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;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"file.txt"&lt;/span&gt;
find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"*.txt"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Find by type&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;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; f     &lt;span class="c"&gt;# files only&lt;/span&gt;
find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d     &lt;span class="c"&gt;# directories only&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbcncivov6rj6ty47jhxe.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%2Fbcncivov6rj6ty47jhxe.png" alt=" " width="800" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"*.txt"&lt;/span&gt;     &lt;span class="c"&gt;# find all .txt files in current directory and subdirectories&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./documents/notes/meeting.txt
./documents/notes/todo.txt
./documents/reports/plan.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find ./documents/notes &lt;span class="nt"&gt;-type&lt;/span&gt; f     &lt;span class="c"&gt;# find only files inside notes directory&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./documents/notes/meeting.txt
./documents/notes/todo.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: The &lt;code&gt;find&lt;/code&gt; command is used to search for files and directories. &lt;code&gt;find . -name "*.txt"&lt;/code&gt; searches from the current directory (.) and finds all files ending with &lt;code&gt;.txt&lt;/code&gt;. &lt;code&gt;find ./documents/notes -type f&lt;/code&gt; searches only inside the notes folder and returns only files (-type f), ignoring directories. The &lt;code&gt;-name&lt;/code&gt; option specifies a pattern, and &lt;code&gt;-type f&lt;/code&gt; limits the search to files.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Searching File Contents with &lt;code&gt;grep&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Command&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;# Search for "Meeting" in all files under documents&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s2"&gt;"Meeting"&lt;/span&gt; ~/code/lab/documents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/code/lab/documents/notes/meeting.txt:Meeting Notes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: The &lt;code&gt;grep&lt;/code&gt; command is used to search for specific text inside files. The &lt;code&gt;-r&lt;/code&gt; flag means recursive search, so it will go through all folders and subfolders inside the given path.&lt;/p&gt;

&lt;p&gt;Here, it searches for the word &lt;code&gt;"Meeting"&lt;/code&gt; inside &lt;code&gt;~/code/lab/documents&lt;/code&gt; and shows the file name and the matching line where the text is found.&lt;br&gt;
&lt;/p&gt;

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

&lt;span class="c"&gt;# Search for "Plan" in all .txt files&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"Plan"&lt;/span&gt; ~/code/lab/documents/&lt;span class="k"&gt;*&lt;/span&gt;/&lt;span class="k"&gt;*&lt;/span&gt;.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/code/lab/documents/reports/plan.txt:Project Plan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: The grep command is used to search for text inside files. Here, it looks for the word "Plan" only inside .txt files located in subfolders of documents.&lt;/p&gt;

&lt;p&gt;The pattern &lt;code&gt;*/*.txt&lt;/code&gt; means:&lt;br&gt;
First &lt;code&gt;*&lt;/code&gt; → any subdirectory inside documents (like reports, notes)&lt;br&gt;
Second &lt;code&gt;*.txt&lt;/code&gt; → all text files inside those subdirectories&lt;/p&gt;




&lt;h2&gt;
  
  
  Common Issues and Troubleshooting
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Permission Denied&lt;/strong&gt;: Use &lt;code&gt;ls -la&lt;/code&gt; to check permissions. Modify permissions with &lt;code&gt;chmod&lt;/code&gt;if necessary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No such file or directory&lt;/strong&gt;: Verify the path you entered. Use tab completion to avoid typos.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Command not found&lt;/strong&gt;: Ensure the command syntax is correct and the required tools are installed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned Today
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Navigating directories using &lt;code&gt;cd&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Viewing my current location with &lt;code&gt;pwd&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Listing directory contents with &lt;code&gt;ls&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Finding files using &lt;code&gt;find&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Searching file contents with &lt;code&gt;grep&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>linux</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Why I Started Learning DevOps | Episode 1</title>
      <dc:creator>Asaduzzaman Sunam</dc:creator>
      <pubDate>Tue, 21 Apr 2026 08:00:52 +0000</pubDate>
      <link>https://dev.to/sunam007/day-0-why-i-started-learning-devops-4m20</link>
      <guid>https://dev.to/sunam007/day-0-why-i-started-learning-devops-4m20</guid>
      <description>&lt;p&gt;I’ve been a web developer for more than three years. I can build features, fix bugs, and ship code. But somewhere along the way, I realized: writing code is only a part of the job.&lt;/p&gt;

&lt;p&gt;Here’s why I decided to stop guessing and start learning DevOps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The tipping point&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It wasn’t about complex algorithms or bad legacy code. It was inconsistency.&lt;/p&gt;

&lt;p&gt;In large projects, multiple developers contribute at the same time. But without strong ownership or review practices, things got messy fast:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Different developers installed or updated packages without coordination.&lt;/li&gt;
&lt;li&gt;Some team members didn’t pull the latest code before starting work.&lt;/li&gt;
&lt;li&gt;Merge conflicts became a daily ritual, not an exception.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And then came the cross‑platform hell. I work on Windows. Others use Linux or macOS. Our production server runs Linux. The result?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Environment‑specific bugs.&lt;/li&gt;
&lt;li&gt;Configuration mismatches.&lt;/li&gt;
&lt;li&gt;File path and permission issues.&lt;/li&gt;
&lt;li&gt;Features that worked beautifully on my machine but broke on another OS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I realized my shallow understanding of the Linux file system (especially while developing on Windows) was a root cause. I was running commands from Google and AI, hoping they’d work. Sometimes they did. Sometimes they didn’t. That’s not engineering — that’s gambling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The wake-up call&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That moment came when I joined a corporate environment with no dedicated DevOps team.&lt;/p&gt;

&lt;p&gt;Suddenly, I wasn’t just writing code. I was doing everything:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fullstack development&lt;/li&gt;
&lt;li&gt;Merging and committing&lt;/li&gt;
&lt;li&gt;Deploying to the server&lt;/li&gt;
&lt;li&gt;Debugging production issues at 2 AM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But my Linux knowledge was shallow. I was operating blindly on live servers. There were tasks I actively avoided because I was afraid I’d crash the whole thing.&lt;/p&gt;

&lt;p&gt;One recurring nightmare: instability. We had multiple domains and apps on the same server. An app would work fine in the afternoon, and by next morning it was down. I’d manually restart processes (Docker, PM2) like a firefighter with no gear.&lt;/p&gt;

&lt;p&gt;Deployment was another time‑sink. Every build meant SSH‑ing into the Linux server manually. Five or six times a day. Across multiple apps. It was frustrating, repetitive, and wasteful.&lt;/p&gt;

&lt;p&gt;That’s when I understood: deployment automation isn’t optional — it’s survival.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The visibility gap that scared me&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Take performance issues. We ran a self‑hosted Strapi CMS with multiple users. The server would become slow or unresponsive. But I had zero visibility into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which process was eating CPU or RAM&lt;/li&gt;
&lt;li&gt;When spikes happened&lt;/li&gt;
&lt;li&gt;Which app was the culprit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I was reacting to problems, not controlling the system. Without monitoring, logging, or process management, I was flying blind.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What a “good day” looks like to me now&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I don’t want excitement. I want boring.&lt;/p&gt;

&lt;p&gt;A good day, once I truly know DevOps, is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Morning coffee + checking a dashboard instead of digging through logs on a broken server.&lt;/li&gt;
&lt;li&gt;Seeing CPU, memory, and traffic at a glance.&lt;/li&gt;
&lt;li&gt;Getting an alert before users notice something wrong.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From the dev side: &lt;code&gt;git push&lt;/code&gt; → everything automated. CI/CD runs tests, builds, deploys. No more manual SSH marathons. Docker ensures my app runs the same on my laptop, my coworker’s Mac, and the production server.&lt;/p&gt;

&lt;p&gt;Deployments become predictable and safe. If something breaks, I roll back instantly — no panic.&lt;/p&gt;

&lt;p&gt;And scaling? Auto‑scaling handles traffic spikes. More users → more instances. Less traffic → fewer resources. I don’t guess capacity or pay for idle servers.&lt;/p&gt;

&lt;p&gt;Most importantly: I’m not blind anymore. Logs, metrics, observability tools tell me the root cause. No more running random commands and praying.&lt;/p&gt;

&lt;p&gt;Also, AI is changing the game. Anyone can now “vibe‑code” an app with ChatGPT. But those apps are rarely production‑ready. Without DevOps knowledge, deploying them is risky. Learning to secure, deploy, and monitor properly is becoming a must‑have, not a nice‑to‑have.&lt;/p&gt;

&lt;p&gt;As I move toward senior roles, people will expect me to think beyond code. They’ll expect me to understand system behaviour under load, safe deployment strategies, and operational risk.&lt;/p&gt;

&lt;p&gt;If I avoid DevOps, I’ll stay comfortable for a while — but the industry will move forward without me.&lt;/p&gt;

&lt;p&gt;So here I am&lt;br&gt;
I’m not learning DevOps just to add Docker and Kubernetes to my resume.&lt;br&gt;
I’m learning it to become the engineer who can take a product from development to production — confidently, safely, and without panic.&lt;/p&gt;

&lt;p&gt;This blog series is me learning in public. Every day, I’ll pick one topic, practice it, and write about it.&lt;/p&gt;

</description>
      <category>devjournal</category>
      <category>devops</category>
      <category>learning</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
