<?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>Forem: Fazal ur Rehman</title>
    <description>The latest articles on Forem by Fazal ur Rehman (@iamfazal).</description>
    <link>https://forem.com/iamfazal</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%2F521879%2F5c0bcb29-cd09-488d-b4cb-f41a177f4870.jpeg</url>
      <title>Forem: Fazal ur Rehman</title>
      <link>https://forem.com/iamfazal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/iamfazal"/>
    <language>en</language>
    <item>
      <title>File Ownership</title>
      <dc:creator>Fazal ur Rehman</dc:creator>
      <pubDate>Wed, 20 Jan 2021 04:58:54 +0000</pubDate>
      <link>https://forem.com/iamfazal/changing-file-ownership-and-permissions-4jei</link>
      <guid>https://forem.com/iamfazal/changing-file-ownership-and-permissions-4jei</guid>
      <description>&lt;p&gt;In this Part, I will cover how to create and modify &lt;strong&gt;Users&lt;/strong&gt; and &lt;strong&gt;Groups&lt;/strong&gt;. this section will be based on hands-on learning so I'm assuming you have already gone through the previous part.&lt;/p&gt;

&lt;p&gt;If you didn't follow me yet, go and press the follow button to get notified of my next upcoming articles. Also, don't forget to give me your precious feedback.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Group&lt;/strong&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Creating A Group
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;groupadd&lt;/code&gt; command used to create a new group. the command requires only one parameter and that is the name of the group.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AEMQfrzV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/igwu9phxuozwueqt3o58.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AEMQfrzV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/igwu9phxuozwueqt3o58.png" alt="creatingGroup"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;No output means the command is successfully executed.&lt;/em&gt; After Creating or modifying group you can view the changes in the &lt;em&gt;/etc/group&lt;/em&gt; file with &lt;code&gt;grep&lt;/code&gt; command or if you are working on a distributed(network-based) system then &lt;code&gt;getent&lt;/code&gt; command shows you both local and network group.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jEf8FVth--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gnvjb72ann43b4fiyf8x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jEf8FVth--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gnvjb72ann43b4fiyf8x.png" alt="groups"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you can see the group name along with a number. this number is a unique Group ID(&lt;em&gt;GID&lt;/em&gt;) which &lt;code&gt;groupadd&lt;/code&gt; command itself provides, you can also specify GID with the help of &lt;code&gt;-g&lt;/code&gt; option of &lt;code&gt;groupadd&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dysqeT8p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cneircwasz36h2o6mf0t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dysqeT8p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cneircwasz36h2o6mf0t.png" alt="Group with specific GID"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Group Operations
&lt;/h2&gt;

&lt;p&gt;With the help of the &lt;code&gt;id&lt;/code&gt; command, you can check which user account, you are using and which groups are available to use&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2VypbOxU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kbseeg3mt2f8az1djj2j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2VypbOxU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kbseeg3mt2f8az1djj2j.png" alt="id"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The output of the &lt;code&gt;id&lt;/code&gt; command displays the User ID(&lt;em&gt;UID&lt;/em&gt;) and user account name of the current user followed by the GID and group name of the primary group and the GIDs and group names of all group memberships.&lt;br&gt;
&lt;em&gt;Notice:&lt;/em&gt; Groups that we created now are not in the list because we didn't add any users yet. &lt;/p&gt;

&lt;h3&gt;
  
  
  Switch Group
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;id&lt;/code&gt; commands list information along with your groups, you can also list only group name using &lt;code&gt;groups&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mhqlkGL_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/50vtfk0gvoj9luhfr20k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mhqlkGL_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/50vtfk0gvoj9luhfr20k.png" alt="Switch Group"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you can use the &lt;code&gt;newgrp&lt;/code&gt; command to change your current primary group&lt;br&gt;
&lt;code&gt;newgrp [group_name]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Cm4YkptV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/aktzrlkt0nottnz7h3os.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Cm4YkptV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/aktzrlkt0nottnz7h3os.png" alt="confirm group change"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;id&lt;/code&gt; command output shows your current primary group, so it is useful for verifying that the &lt;code&gt;newgrp&lt;/code&gt; command executed with no error. you can see in the second output group is changed from first id's command output. now if the user creates a file and view its details, the new file will be owned by the &lt;em&gt;sambashare&lt;/em&gt; group:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MNbj6tlt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/uchwt408genfxp88atwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MNbj6tlt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/uchwt408genfxp88atwy.png" alt="new file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The &lt;code&gt;newgrp&lt;/code&gt; command opens a new shell; as long as the user stays in that shell, the primary group won't change. Once the user has closed the terminal the group shift back to the primary group.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Changing File Ownership
&lt;/h3&gt;

&lt;p&gt;As we created a file in the previous command that own the &lt;em&gt;sambashare&lt;/em&gt; group, we can change the group owner using &lt;code&gt;chgrp&lt;/code&gt; command:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nG1ND1LQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/uok70ql3cwjlsjcm6r8r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nG1ND1LQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/uok70ql3cwjlsjcm6r8r.png" alt="chgrp"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Rename &amp;amp; change GID of the group
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;groupmod&lt;/code&gt; command uses following parameters to make to make changes in group:&lt;br&gt;
• &lt;code&gt;-n&lt;/code&gt; With the help of this option we can rename a group:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JQe3jWE7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bowyrp34s5jzo1fts29s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JQe3jWE7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bowyrp34s5jzo1fts29s.png" alt="rename"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;• &lt;code&gt;-g&lt;/code&gt; option is used to change the GID of the group:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GEAs9zId--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xj60gpc5wpxkfvwi6f6i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GEAs9zId--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xj60gpc5wpxkfvwi6f6i.png" alt="GID change"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Deleting Group
&lt;/h3&gt;

&lt;p&gt;If you decide to delete a group with the &lt;code&gt;groupdel&lt;/code&gt; command, remember that any files that are owned by that group will become orphaned. Only supplemental groups can be deleted, so if any group is the primary group for any user, it cannot be deleted:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--h_9cdosV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8qy8pw6sy6hwvh99830n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h_9cdosV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8qy8pw6sy6hwvh99830n.png" alt="delete group"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;User&lt;/strong&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Creating A User
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;useradd&lt;/code&gt; command used to create a new user. the command requires only one parameter that is the name of the user:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--J2fVS3EI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xco3a061oi91l1prkcal.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--J2fVS3EI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xco3a061oi91l1prkcal.png" alt="Creating A User"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;No output means command successfully executed.&lt;/em&gt; &lt;br&gt;
When executed without any option, &lt;code&gt;useradd&lt;/code&gt; creates a new user account using the default settings specified in the &lt;code&gt;&lt;em&gt;/etc/default/useradd&lt;/em&gt;&lt;/code&gt; file. The command adds an entry to the &lt;code&gt;&lt;em&gt;/etc/passwd&lt;/em&gt;&lt;/code&gt;, &lt;code&gt;&lt;em&gt;/etc/shadow&lt;/em&gt;&lt;/code&gt;, &lt;code&gt;&lt;em&gt;/etc/group&lt;/em&gt;&lt;/code&gt; and &lt;code&gt;&lt;em&gt;/etc/gshadow&lt;/em&gt;&lt;/code&gt; files.&lt;br&gt;
Next, you have to set the password for the newly created user to login. To do that run the &lt;code&gt;passwd&lt;/code&gt; command followed by the username:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6u0cKJsl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/emvyp0iwahzz1wg3arwr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6u0cKJsl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/emvyp0iwahzz1wg3arwr.png" alt="passwd"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can check the home directory by listing the contents of the &lt;code&gt;/home&lt;/code&gt; directory:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e1EtViH5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dkpd6o5m38yb4dkefjvj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e1EtViH5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dkpd6o5m38yb4dkefjvj.png" alt="listing user"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you can also specify User Id(UID) with the help of &lt;code&gt;-u&lt;/code&gt; option of &lt;code&gt;groupadd&lt;/code&gt; command.&lt;/p&gt;

&lt;h2&gt;
  
  
  User Operations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Changing File Ownership
&lt;/h3&gt;

&lt;p&gt;As we created a file in the group section that was owned by &lt;code&gt;&lt;em&gt;anonymous&lt;/em&gt;&lt;/code&gt; user and &lt;code&gt;&lt;em&gt;openSourceLover&lt;/em&gt;&lt;/code&gt; group:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yKqmFHEJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qdzap2a5elio34mjuk08.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yKqmFHEJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qdzap2a5elio34mjuk08.png" alt="change file owner"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To change the user owner the &lt;code&gt;chown&lt;/code&gt; command is used:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eJLUx3hU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3xk9kisystn5v0rh7cpw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eJLUx3hU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3xk9kisystn5v0rh7cpw.png" alt="chown"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;chown&lt;/code&gt; command used to change the user or group or both at the same time.&lt;br&gt;
&lt;em&gt;Please refer to the manual pages by using the &lt;code&gt;man chown&lt;/code&gt; command to explore in-depth&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Rename User
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;usermod&lt;/code&gt; command is used to make changes in user with the help of &lt;code&gt;-l&lt;/code&gt; option we can rename a user.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6DAbcZMN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2k5hospxl3ovp24ivjs1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6DAbcZMN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2k5hospxl3ovp24ivjs1.png" alt="rename user"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Delete User
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;userdel&lt;/code&gt; command is used to delete users. When you delete a user account, you also need to decide whether you want to delete the user's home directory or not. &lt;code&gt;-r&lt;/code&gt; option used to delete home directory along with user.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hope this article will help you to create and modify user and group. See you in the next article.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Thanks :))&lt;/p&gt;

</description>
      <category>linux</category>
      <category>beginners</category>
      <category>users</category>
      <category>groups</category>
    </item>
    <item>
      <title>File Ownership and Permissions in Linux</title>
      <dc:creator>Fazal ur Rehman</dc:creator>
      <pubDate>Tue, 12 Jan 2021 04:54:22 +0000</pubDate>
      <link>https://forem.com/iamfazal/file-ownership-and-permissions-in-linux-4f8m</link>
      <guid>https://forem.com/iamfazal/file-ownership-and-permissions-in-linux-4f8m</guid>
      <description>&lt;p&gt;After getting a positive response and awesome feedback on my first article I'm very excited to share my second one&lt;/p&gt;

&lt;p&gt;In this read, I will cover file permission and ownership, as I have already discussed in my previous article &lt;a href="https://dev.to/iamfazal/power-of-ls-command-2hja"&gt;power of ls command&lt;/a&gt;, that this is a very important corner of Linux. In addition, the concept of file and directory permissions, user and user group will be explored.&lt;/p&gt;

&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;File ownership is critical for file security. Every file has some permissions, a single user owner, and a group owner. Understanding this core is very interesting and also very crucial when you are working on a distributed Linux based system. one important vulnerability exists when local access is granted, &lt;em&gt;Eg: write permission is assigned to user or group while you are assigning only read permission&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you have read my previous article &lt;a href="https://dev.to/iamfazal/power-of-ls-command-2hja"&gt;power of ls command&lt;/a&gt;, you would know permission can be view by long listing &lt;code&gt;-l&lt;/code&gt; option of the &lt;code&gt;ls&lt;/code&gt; command, use this command to view.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbdsj981z08t1r1mqs26u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbdsj981z08t1r1mqs26u.png" alt="Permissions"&gt;&lt;/a&gt; &lt;br&gt;
Notice that for each file listed, the first character either start with &lt;code&gt;&lt;em&gt;d&lt;/em&gt;&lt;/code&gt; or &lt;code&gt; - &lt;/code&gt;&lt;em&gt;(hyphen)&lt;/em&gt;. This conveys the information either the file is a directory or a regular file, Other file types are giving below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Feh11aa71exb8efmyhy0b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Feh11aa71exb8efmyhy0b.png" alt="Permission table"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next highlighted nine characters are three group permission for three different types of owners.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5e3dr68b6sbftp9v2bxp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5e3dr68b6sbftp9v2bxp.png" alt="Permission"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Permission group:
&lt;/h3&gt;

&lt;p&gt;Each permission group contains a combination of these characters.&lt;br&gt;
&lt;/p&gt;
&lt;li&gt; &lt;code&gt;r :&lt;/code&gt; The &lt;em&gt;Read&lt;/em&gt; permission gives the authority to open and read a file. &lt;/li&gt;
&lt;li&gt; &lt;code&gt;w :&lt;/code&gt; The &lt;em&gt;Write&lt;/em&gt; permission gives the authority to write or modify the file.&lt;/li&gt;
&lt;li&gt; &lt;code&gt;x :&lt;/code&gt; The &lt;em&gt;Execute&lt;/em&gt; permission gives the authority to run a file.&lt;/li&gt;
&lt;li&gt; &lt;code&gt;- :&lt;/code&gt; No permission.&lt;/li&gt;
&lt;em&gt;Note that First character always represent read permission, second one write, and last execute. hyphen means no permission&lt;/em&gt;
&lt;h3&gt;
  
  
  Ownership:
&lt;/h3&gt;
&lt;h4&gt;
  
  
  User:
&lt;/h4&gt;

&lt;p&gt;A user is the owner of the file. By default, the person who creates a file becomes its owner. The first set of three characters is for the owner permissions.&lt;/p&gt;

&lt;h4&gt;
  
  
  Group:
&lt;/h4&gt;

&lt;p&gt;A group can contain multiple users. The most common reason to create a group is to provide a way for users to share files. For example, if several people work together on the same project and need to be able to collaborate on documents stored in files for the project. In this scenario, the administrator can make these people members of a common group, change the directory ownership to the new group, and set permissions on the directory that allows members of the group to access the files. All users that belong to the same group will have the same permissions to the files or directories. The second set of three characters is for group permission.&lt;br&gt;
Eg: If the login user doesn't have permission to access the file, But the user belongs to the group that has permission then he/she can easily access it.&lt;/p&gt;

&lt;h4&gt;
  
  
  Other:
&lt;/h4&gt;

&lt;p&gt;Other includes all users that are neither the owner nor any group member who could own the file. In short, the whole world can have accessibility. The last three characters are for them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9il92axvvzmgd16133pf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9il92axvvzmgd16133pf.png" alt="Alt Text"&gt;&lt;/a&gt; &lt;br&gt;
The permission block is succeeded by an integer. This integer is a &lt;em&gt;hard&lt;/em&gt; link counter, Indicates how many files are linked to this file. There are two types of links in Linux file systems &lt;em&gt;hard&lt;/em&gt; and &lt;em&gt;soft&lt;/em&gt;. The difference between them is significant. It is because the way in which they work is totally different but both provide multiple directory entries (or references) to a single file. After link count, you see the user owner, the group owner, the file size, the date/time the file was last modified, and the last filename.&lt;/p&gt;

&lt;p&gt;I hope this informative blog was helpful to you. Did you find it beneficial? Don’t forget to like and share. See more by following me and keep yourself informed of my next upcoming blogs.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;~ let me know in comments if you want me to write an article on soft and hard links, I will happily do it&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Thanks! happy coding :))&lt;/p&gt;

</description>
      <category>linux</category>
      <category>beginners</category>
      <category>permissions</category>
      <category>filesystem</category>
    </item>
    <item>
      <title>Power of ls command</title>
      <dc:creator>Fazal ur Rehman</dc:creator>
      <pubDate>Tue, 05 Jan 2021 19:08:50 +0000</pubDate>
      <link>https://forem.com/iamfazal/power-of-ls-command-2hja</link>
      <guid>https://forem.com/iamfazal/power-of-ls-command-2hja</guid>
      <description>&lt;h1&gt;
  
  
  what is a command?
&lt;/h1&gt;

&lt;p&gt;The simplest answer is that a command is a software program that, when executed on the CLI, performs any action.&lt;br&gt;
some commands take additional input to run correctly, This input is known as &lt;code&gt;&lt;em&gt;options&lt;/em&gt;&lt;/code&gt; and &lt;code&gt;&lt;em&gt;arguments&lt;/em&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt; command [options] [arguments] &lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Options are used to modify the behavior of command.&lt;/li&gt;
  &lt;li&gt;Arguments are used to provide additional information.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Today we'll discuss the fundamentals of &lt;code&gt;ls&lt;/code&gt; command and try to cover some basic parameters. we use this command daily basic and frequently even though we never aware of all the available options.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ls&lt;/code&gt;: By itself, the ls command lists files and directories contained in the current working directory.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---n3m_cbu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/o7jrnrfeqtoaz6cyk73v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---n3m_cbu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/o7jrnrfeqtoaz6cyk73v.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Arguments
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;ls&lt;/code&gt; command takes the argument as a name of the directory, it lists the contents of the directory, In the following example, the &lt;em&gt;/etc/dpkg&lt;/em&gt; directory is used as an argument.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Bf6duUQ0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zxdil8m6ttsx62tpc7b4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bf6duUQ0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zxdil8m6ttsx62tpc7b4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
The &lt;code&gt;ls&lt;/code&gt; command also accepts multiple arguments. To list the contents of both the &lt;em&gt;/etc/ppp&lt;/em&gt; and &lt;em&gt;/etc/ssh&lt;/em&gt; directories&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sm4uMdA_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/t39j6m49vqfe2ub74vfy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sm4uMdA_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/t39j6m49vqfe2ub74vfy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Options
&lt;/h4&gt;

&lt;p&gt;options used with commands to expend or modify the way a command behaves.&lt;br&gt;
&lt;code&gt;&lt;strong&gt;-a&lt;/strong&gt; :&lt;/code&gt; The &lt;code&gt;ls&lt;/code&gt; command omits hidden files by default. A hidden file is any file(or directory) that begins with a dot &lt;code&gt;.&lt;/code&gt; character. with the used of &lt;code&gt;-a&lt;/code&gt; option we can display all filed including hidden files.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xoYr6Fgq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ssfo3d1gjx58rolhxuoh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xoYr6Fgq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ssfo3d1gjx58rolhxuoh.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;strong&gt;-l&lt;/strong&gt; :&lt;/code&gt; With this option we get results in a long listing, providing additional information about the files that are listed, such as the permission, size, creation date, and other information. &lt;em&gt;(I will try to cover permission in the next post. this is a very important and fundamental part of Linux file system)&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VTaGIkDz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2e5owdjutygpzkb0a9dc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VTaGIkDz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2e5owdjutygpzkb0a9dc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;strong&gt;-h&lt;/strong&gt; :&lt;/code&gt; If the &lt;code&gt;-h&lt;/code&gt; option added with &lt;code&gt;-l&lt;/code&gt; the file sizes will be displayed in human readable order (or you can write full word form; &lt;em&gt;--human-readable&lt;/em&gt;)&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rdtgrzeE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dfmgixc2op3rvf445ttu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rdtgrzeE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dfmgixc2op3rvf445ttu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;note: The order of the combined options isn't important. The output of all of these examples would be the same:&lt;/em&gt; &lt;br&gt;
&lt;code&gt;ls -l -h&lt;br&gt;
ls -hl&lt;br&gt;
ls -lh &lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;strong&gt;-r&lt;/strong&gt; :&lt;/code&gt; By default ls print the results in ascending alphabetical order, with the help of &lt;code&gt;-r&lt;/code&gt; option we print the result in reverse order.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P8d9xWVW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/i3rzm7ebsirs25oxf2bc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P8d9xWVW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/i3rzm7ebsirs25oxf2bc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;strong&gt;-s&lt;/strong&gt; :&lt;/code&gt; To see the file (or directory) size. very use full with flag &lt;code&gt;-h&lt;/code&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--07ItK37y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4cbilidtuaq7kg9yyp4t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--07ItK37y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4cbilidtuaq7kg9yyp4t.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;strong&gt;-S&lt;/strong&gt; :&lt;/code&gt; To sort files by size. it is most useful when used with the &lt;code&gt;-l&lt;/code&gt; option so the file sizes are visible and &lt;code&gt;-h&lt;/code&gt; option to display human-readable file sizes.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--928fTL_7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7j6trgd653gmra57rg92.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--928fTL_7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7j6trgd653gmra57rg92.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;strong&gt;-R&lt;/strong&gt; :&lt;/code&gt; With the help of this flag we can display all of the files in a directory as well as all of the files in all subdirectories under that directory. This is called a &lt;em&gt;recursive listing&lt;/em&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OPWUuD75--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cqc2b5b7udi0ztaupmv7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OPWUuD75--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cqc2b5b7udi0ztaupmv7.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;strong&gt;-t&lt;/strong&gt;&lt;/code&gt; Sorted by modified time or created time&lt;br&gt;
&lt;code&gt;&lt;strong&gt;-m&lt;/strong&gt;&lt;/code&gt; List all the files and directories separated with comma&lt;/p&gt;

&lt;p&gt;I hope this article will help you to learn a few options of &lt;code&gt;ls&lt;/code&gt; commands in Linux. Please refer to the manual pages by using the &lt;code&gt; man ls &lt;/code&gt; command to explore in-depth&lt;/p&gt;

&lt;p&gt;Thanks! happy coding :))&lt;/p&gt;

</description>
      <category>linux</category>
      <category>ls</category>
      <category>ubuntu</category>
      <category>beginners</category>
    </item>
    <item>
      <title>2021 Surprise</title>
      <dc:creator>Fazal ur Rehman</dc:creator>
      <pubDate>Sat, 02 Jan 2021 05:43:07 +0000</pubDate>
      <link>https://forem.com/iamfazal/2021-surprise-ho7</link>
      <guid>https://forem.com/iamfazal/2021-surprise-ho7</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZPTtMtHL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8hj1ur77gag60nsyawo8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZPTtMtHL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8hj1ur77gag60nsyawo8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ooh shit! &lt;br&gt;
God already added COVID this year.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>terminal</category>
      <category>covid19</category>
      <category>firstpost</category>
    </item>
  </channel>
</rss>
