<?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: Yash Chaudhari</title>
    <description>The latest articles on DEV Community by Yash Chaudhari (@yash1307).</description>
    <link>https://dev.to/yash1307</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%2F803745%2F228123b0-f3f5-4305-8b21-e4a7bb9c4bbd.png</url>
      <title>DEV Community: Yash Chaudhari</title>
      <link>https://dev.to/yash1307</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yash1307"/>
    <language>en</language>
    <item>
      <title>🤖 What is a Parameterized Job in Jenkins?</title>
      <dc:creator>Yash Chaudhari</dc:creator>
      <pubDate>Sat, 02 Aug 2025 13:40:16 +0000</pubDate>
      <link>https://dev.to/yash1307/what-is-a-parameterized-job-in-jenkins-137e</link>
      <guid>https://dev.to/yash1307/what-is-a-parameterized-job-in-jenkins-137e</guid>
      <description>&lt;p&gt;In Jenkins Parameterized Job is a type of job that allows us to select parameters while building the Jenkins Job.&lt;/p&gt;

&lt;p&gt;There are various types of Parameters we can select.&lt;/p&gt;

&lt;p&gt;For example - String, Choice, etc.&lt;/p&gt;

&lt;p&gt;In this article, we are going to see how to make a Parameterized Jenkins Job.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create a simple freestyle project.
&lt;/h2&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%2Fd1693y9qbod9rtzuw7vq.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%2Fd1693y9qbod9rtzuw7vq.png" alt=" " width="800" height="344"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Next, select the option - This project is parameterized, and click on Add Parameter.
&lt;/h2&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%2F3mezioyybbysjvaqc3io.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%2F3mezioyybbysjvaqc3io.png" alt=" " width="800" height="369"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  3. Then, select the parameter type that you want to add.
&lt;/h2&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%2Fcz0yxlrv3uim19h9mjoe.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%2Fcz0yxlrv3uim19h9mjoe.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Add the name of the parameter with a default value.
&lt;/h2&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%2Fenh8ymj5v0rqecgynuzh.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%2Fenh8ymj5v0rqecgynuzh.png" alt=" " width="800" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Next, in the Build steps section, select the Execute Shell option and add this command
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo $Param1
&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%2Fi0fowfzl7ny35robpexx.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%2Fi0fowfzl7ny35robpexx.png" alt=" " width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Click on save and Build the Project. You will see Build with Parameters option. Click on that.
&lt;/h2&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%2Fuq8znxjz4k1rvm3jycns.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%2Fuq8znxjz4k1rvm3jycns.png" alt=" " width="800" height="363"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  7. After clicking on the Build with Parameters option. Add the parameter value that you want to pass. In my case, I have passed "This is a Parameterized Jenkins Job". After that, click on Build.
&lt;/h2&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%2F1rgr1eoalodahlezwm02.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%2F1rgr1eoalodahlezwm02.png" alt=" " width="800" height="340"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  8. Check the Console Output of the Job.
&lt;/h2&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%2F7yscc99sdhz82v2826dh.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%2F7yscc99sdhz82v2826dh.png" alt=" " width="800" height="364"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Use Cases -
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;When we need to pass the values just before the job build, then we can pass the values. &lt;br&gt;
For example, if we are installing different versions of the software. So, we can pass the version of the software as a parameter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If there's a need that we have to pass the commands at run time. So, we can use this option.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>devops</category>
      <category>jenkins</category>
      <category>cicd</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Building Blocks of Docker: Understanding Images</title>
      <dc:creator>Yash Chaudhari</dc:creator>
      <pubDate>Tue, 15 Apr 2025 13:53:33 +0000</pubDate>
      <link>https://dev.to/yash1307/building-blocks-of-docker-understanding-images-1dj0</link>
      <guid>https://dev.to/yash1307/building-blocks-of-docker-understanding-images-1dj0</guid>
      <description>&lt;p&gt;Docker is widely used to containerize applications. There are also other containerization platforms such as Containerd, Rkt (Rocket), etc., but Docker is dominating the market.&lt;/p&gt;

&lt;p&gt;In this article, we will see what is Docker image?, the layers of a Docker image, and how to write a custom Docker image.&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%2Feogforiscej07uqj83hj.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%2Feogforiscej07uqj83hj.png" alt="Image description" width="238" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  • What is Docker Image?
&lt;/h2&gt;

&lt;p&gt;Docker Image is like a readymade template. It contains predefined code, libraries that help you to create containers. All are combined in a single file. So, there's no need to create an explicitly environment because that Docker Image is providing you that type of environment. So just need to run the Docker Image that's it.&lt;/p&gt;

&lt;p&gt;Remember 📝 - &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The Docker Image is written in a file that does not have an extension, and the name of that file is Dockerfile.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Remember the hierarchy -  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Dockerfile creates a Docker Image&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Docker Image creates a container&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before going to understanding the layers of a Docker Image, let's see what exactly the Dockerfile looks like.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM openjdk:17-slim

WORKDIR ./app

COPY . .

RUN javac HelloWorld.java

CMD ["java", "HelloWorld"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code is the simple Docker Image code, which will create a java image with the Hello World Program. So, when we create the container from this image, we will be able to see the output.&lt;/p&gt;

&lt;h2&gt;
  
  
  • What are layers in Docker Image
&lt;/h2&gt;

&lt;p&gt;Every line in the Dockerfile acts as a layer for the Docker Image&lt;/p&gt;

&lt;p&gt;From the above code, let's break it down.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;FROM openjdk:17-slim&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This line acts as a base layer for the Docker Image. On the above, those remaining lines will execute. In some Docker Images, the base layer is ubuntu also. In our case, it is OpenJDK.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;WORKDIR ./app&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This line is the working directory for the Dockerfile. It will create a working directory where all the files related to the Dockerfile will be stored. This line will act as a second layer for the Docker Image.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;COPY . .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This line will copy all the files in the working directory that are required to create the Docker Image. This is the third layer for the Docker Image.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;RUN javac HelloWorld.java&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After copying all the files in the working directory, this line will execute, and the Docker Image will be created. This is the fourth layer for the Docker Image.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CMD ["java", "HelloWorld"]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This line will execute during container creation. It is the fifth layer for the Docker Image.&lt;/p&gt;

&lt;p&gt;Now, let's create a Docker Image of the Simple Java Hello World Program from the code which is mentioned above.&lt;/p&gt;

&lt;p&gt;Command to create a Docker Image&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t java-image .
&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%2Frfyyelr26ys8pq7zztra.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%2Frfyyelr26ys8pq7zztra.png" alt="Image description" width="800" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Docker Image has been created.&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%2Fnhg5w6yw8e1ewsk63e0z.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%2Fnhg5w6yw8e1ewsk63e0z.png" alt="Image description" width="800" height="94"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lastly, let's create a container. So, we will be able to see the output of the Java Code.&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%2Fc80xaiyd0g7b5vrf4uf5.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%2Fc80xaiyd0g7b5vrf4uf5.png" alt="Image description" width="732" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this way, we have seen each layer of the Docker Image.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>kubernetes</category>
      <category>containers</category>
      <category>programming</category>
    </item>
    <item>
      <title>Simple Pod YAML file in K8s for beginners</title>
      <dc:creator>Yash Chaudhari</dc:creator>
      <pubDate>Tue, 15 Apr 2025 11:35:30 +0000</pubDate>
      <link>https://dev.to/yash1307/simple-pod-yaml-file-in-k8s-for-beginners-p1l</link>
      <guid>https://dev.to/yash1307/simple-pod-yaml-file-in-k8s-for-beginners-p1l</guid>
      <description>&lt;p&gt;In Kubernetes, YAML files play a significant role not just in Kubernetes but also in Ansible, Docker Compose etc. Many beginners are in question about how to write YAML files for pods. In this article we will see how to write a simple YAML file for pods.&lt;/p&gt;

&lt;p&gt;First of all, remember 4 things while writing YAML files for pods&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What are they? 🤓&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;They are as follows - &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;apiVersion&lt;/li&gt;
&lt;li&gt;kind&lt;/li&gt;
&lt;li&gt;metadata&lt;/li&gt;
&lt;li&gt;spec&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;In Kubernetes, there are many Kubernetes objects such as pod, deployment, cronjob, etc. So, apiVersion indicates the Kubernetes API version for creating pods. The image shown below displays different API versions for Kubernetes objects.&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%2Fkjko5yztv7vzcao8mibg.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%2Fkjko5yztv7vzcao8mibg.png" alt="Image description" width="800" height="578"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. kind
&lt;/h2&gt;

&lt;p&gt;The kind field denotes which Kubernetes object will create.&lt;/p&gt;

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

&lt;p&gt;The metadata includes the data about Kubernetes objects which is going to be created, like name, labels, etc.&lt;/p&gt;

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

&lt;p&gt;The spec denotes what will be included inside the pods after creation.&lt;br&gt;
For example - Containers.&lt;/p&gt;

&lt;p&gt;Now, let's see a simple YAML file for creating pods.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: v1
kind: Pod
metadata:
  name: first-pod-01
spec:
  containers:
    - name: nginx
      image: nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above YAML file, all the 4 things are mentioned, which we have seen above.&lt;/p&gt;

&lt;p&gt;After running the &lt;code&gt;kubectl apply -f &amp;lt;YAML file name&amp;gt;&lt;/code&gt;, the pod will be created.&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%2Fosc01w7oca8skb9qyezh.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%2Fosc01w7oca8skb9qyezh.png" alt="Image description" width="661" height="80"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note - Image I have used to show API versions of different Kubernetes object from this &lt;a href="https://x.com/pavangudiwada_/status/1485811507955134464" rel="noopener noreferrer"&gt;link.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>docker</category>
      <category>containers</category>
      <category>devops</category>
    </item>
    <item>
      <title>Step-by-Step Guide to Changing File Permissions in Linux 🐧</title>
      <dc:creator>Yash Chaudhari</dc:creator>
      <pubDate>Fri, 11 Apr 2025 14:15:05 +0000</pubDate>
      <link>https://dev.to/yash1307/step-by-step-guide-to-changing-file-permissions-in-linux-l1o</link>
      <guid>https://dev.to/yash1307/step-by-step-guide-to-changing-file-permissions-in-linux-l1o</guid>
      <description>&lt;p&gt;In Linux, there are many files and directories that belong to different users and different groups, but how to check permissions for those files? So, for this, there is a command that lists down the files and directories with their permissions and owners.&lt;/p&gt;

&lt;p&gt;The command is -&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;For example -&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%2Fwh84osh6y78wf3qg48ti.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%2Fwh84osh6y78wf3qg48ti.png" alt="Image description" width="750" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🤔 &lt;strong&gt;But again, there's a question what is written there before any filename or directory name?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The answer is that it denotes the type (is it file or directory) with their permissions such as users, groups and others &lt;/p&gt;

&lt;p&gt;Let's break it down -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;drwxr-xr-x 1 root root 4096 Apr 11 08:31 apt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First letter &lt;code&gt;d&lt;/code&gt; means it is a directory and if it is file then it will be denoted with &lt;code&gt;-&lt;/code&gt; sign &lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-rw-r--r-- 1 root root   98 Nov 22 03:45 shells.state
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, the next 9 letters are divided into three categories&lt;/p&gt;

&lt;p&gt;Owners, Groups  and Others and that &lt;code&gt;rwx&lt;/code&gt; letters indicates&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;For example -&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%2Fsfdt6ou1n60egc9y4u65.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%2Fsfdt6ou1n60egc9y4u65.png" alt="Image description" width="660" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, all permissions, such as read, write, and execute have their own Octal Coding System. It means they have assigned with octal codes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Permission   Symbol  Value
Read           r       4
Write          w       2
Execute        x       1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we are assigning the permissions to users, groups or others with the help of octal values then we have to sum up their values.&lt;/p&gt;

&lt;p&gt;For example, I want to assign full permission to users, groups and others then, the values will be - &lt;/p&gt;

&lt;p&gt;&lt;code&gt;4 (Read) + 2 (Write) + 1 (Execute) = 7  For Users&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;&lt;code&gt;4 (Read) + 2 (Write) + 1 (Execute) = 7  For Groups&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;4 (Read) + 2 (Write) + 1 (Execute) = 7  For Others&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, the final code will be 777.&lt;/p&gt;

&lt;p&gt;2nd Example - I only want to assign read permission to users and groups then, the values will be -&lt;/p&gt;

&lt;p&gt;&lt;code&gt;4 (Read) + 0 (Write) + 0 (Execute) = 4  For Users&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;4 (Read) + 0 (Write) + 0 (Execute) = 4  For Groups&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;0 (Read) + 0 (Write) + 0 (Execute) = 0  For Others&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, the final code will be 440&lt;/p&gt;

&lt;p&gt;3rd Example - I want to assign execute permission to users and read permission to groups then, the values will be -&lt;/p&gt;

&lt;p&gt;&lt;code&gt;0 (Read) + 0 (Write) + 1 (Execute) = 1  For Users&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;&lt;code&gt;4 (Read) + 0 (Write) + 0 (Execute) = 4  For Groups&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;0 (Read) + 0 (Write) + 0 (Execute) = 0  For Others&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, the final code will be 140&lt;/p&gt;

&lt;p&gt;Now, how to change the file permissions?&lt;/p&gt;

&lt;p&gt;For example- The File shown below has some permission&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-rw-r--r-- 1 root root 0 Apr 11 14:00 sample 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I want to change the file permission and want to assign execute permission to groups and others&lt;/p&gt;

&lt;p&gt;So, the Octal code will be -&lt;/p&gt;

&lt;p&gt;&lt;code&gt;0 (Read) + 0 (Write) + 0 (Execute) = 0  For Users&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;0 (Read) + 0 (Write) + 1 (Execute) = 1  For Groups&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;0 (Read) + 0 (Write) + 1 (Execute) = 1  For Others&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The final code will be 011&lt;/p&gt;

&lt;p&gt;Command to change file permissions -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod &amp;lt;octal_code&amp;gt; &amp;lt;filename/dir. name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





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

&lt;/div&gt;



&lt;p&gt;After giving the command, the permissions have changed&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;------x--x 1 root root 0 Apr 11 14:00 sample
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>linux</category>
      <category>ubuntu</category>
      <category>bash</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
