<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Deepak Vishwakarma on Medium]]></title>
        <description><![CDATA[Stories by Deepak Vishwakarma on Medium]]></description>
        <link>https://medium.com/@deepakv30?source=rss-27acd45ac432------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3ddMEI-kde3R591vljF8lQ.png</url>
            <title>Stories by Deepak Vishwakarma on Medium</title>
            <link>https://medium.com/@deepakv30?source=rss-27acd45ac432------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 14:25:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@deepakv30/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[DevOps 101: A Beginner’s Guide to Seamless Development & Operations ]]></title>
            <link>https://medium.com/@deepakv30/devops-101-a-beginners-guide-to-seamless-development-operations-ab299b0b02da?source=rss-27acd45ac432------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab299b0b02da</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[devops101]]></category>
            <category><![CDATA[beginers-guide]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Deepak Vishwakarma]]></dc:creator>
            <pubDate>Sat, 17 May 2025 17:23:44 GMT</pubDate>
            <atom:updated>2025-05-17T17:35:03.815Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N2kYzgnT1CWd1_R4BtL4uQ.png" /><figcaption>🚀 <strong>“DevOps 101: Mastering Collaboration, Automation, and Speed!”</strong> 🔧💡</figcaption></figure><p><strong>DevOps</strong> is more than just a set of tools — it’s a transformative <strong>culture</strong> that bridges development and operations, helping teams <strong>collaborate seamlessly</strong> to deliver software faster and more reliably. If you’re looking to improve efficiency, reduce errors, and scale software development effortlessly, DevOps is your answer.</p><p>In this article, we’ll break down the <strong>fundamentals of DevOps</strong> and guide you on how to implement it in your organization.</p><h4>🔍 <strong>What is DevOps?</strong></h4><p>At its core, DevOps is <strong>not a specific tool or technology</strong> — it’s a mindset that emphasizes <strong>collaboration, automation, and continuous improvement</strong>. The goal? To eliminate silos between development and operations and build a streamlined, efficient software development process.</p><p><strong>Key Pillars of DevOps</strong></p><ol><li><strong>Automation</strong> — Reducing manual tasks to boost efficiency and minimize errors.</li><li><strong>Continuous Delivery &amp; Deployment</strong> — Ensuring fast, incremental updates rather than large, risky releases.</li><li><strong>Monitoring &amp; Logging</strong> — Actively tracking system performance to resolve issues before they escalate.</li><li><strong>Culture of Collaboration</strong> — Encouraging open communication between teams for rapid problem-solving.</li></ol><h4>🚀 <strong>Why Automation is a Game-Changer?</strong></h4><p>A key principle of DevOps is <strong>automation</strong>. By automating repetitive tasks, teams can: ✅ <strong>Reduce errors</strong><br> ✅ <strong>Improve consistency</strong><br> ✅ <strong>Speed up the development pipeline</strong></p><p>Automation tools like <strong>CI/CD, Infrastructure as Code (IaC), and automated testing</strong> ensure software delivery is <strong>fast and reliable</strong>.</p><h4>📈 Continuous Delivery &amp; Deployment</h4><p>With <strong>Continuous Delivery and Deployment</strong>, software teams can <strong>ship features and fixes faster</strong> while <strong>minimizing risks</strong>. Instead of waiting for large releases, DevOps focuses on <strong>incremental updates</strong>, improving user experience and system reliability.</p><h4>🛠 <strong>Monitoring &amp; Logging: Prevent Issues Before They Arise</strong></h4><p>Proactive <strong>monitoring and logging</strong> help teams detect <strong>performance bottlenecks, security vulnerabilities, and system failures</strong> before they impact users. Tools like <strong>Prometheus, ELK Stack, and Grafana</strong> enable <strong>real-time monitoring and debugging</strong>.</p><h4>🚀 How to Get Started with DevOps?</h4><p>Breaking into DevOps can feel overwhelming, but here are three simple steps to ease into it:</p><p><strong>1️⃣ Start Small</strong></p><p>Begin with a <strong>small project</strong> and scale gradually. Implement DevOps on a contained workflow before rolling it out organization-wide.</p><p><strong>2️⃣ Prioritize Automation</strong></p><p>Integrate <strong>CI/CD pipelines, automated testing, and Infrastructure as Code</strong> to <strong>streamline processes</strong>.</p><p><strong>3️⃣ Foster Collaboration</strong></p><p>Hold <strong>regular cross-team meetings, use shared tools, and set common objectives</strong> to <strong>improve communication and efficiency</strong>.</p><h4>🔥 Conclusion</h4><p>DevOps isn’t just a process — it’s a culture of <strong>collaboration, automation, and continuous improvement</strong>. By <strong>breaking down silos</strong>, automating workflows, and ensuring <strong>continuous delivery</strong>, teams can ship high-quality software <strong>faster and more reliably</strong>.</p><p>💡 Are you ready to adopt DevOps in your organization? Start <strong>small, automate, and collaborate</strong> — before you know it, you’ll be reaping the benefits of DevOps! 🎨🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab299b0b02da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kick-start your AWS Cloud journey within 10 minutes]]></title>
            <link>https://medium.com/@deepakv30/kick-start-aws-cloud-journey-in-5-minutes-786b0a95d15f?source=rss-27acd45ac432------2</link>
            <guid isPermaLink="false">https://medium.com/p/786b0a95d15f</guid>
            <category><![CDATA[aws-devops]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[basics-of-cloud]]></category>
            <category><![CDATA[amazon-web-services-intro]]></category>
            <category><![CDATA[aws-service-catalog]]></category>
            <dc:creator><![CDATA[Deepak Vishwakarma]]></dc:creator>
            <pubDate>Wed, 14 Dec 2022 11:35:20 GMT</pubDate>
            <atom:updated>2023-02-23T16:31:47.085Z</atom:updated>
            <content:encoded><![CDATA[<p>This article will help you to kick-start your AWS cloud journey by knowing about the basics and being familiar with the jargon used in AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*Hk7uuC6HfPwTd9nMws81Ww.png" /><figcaption>The above pic shows the symbol of AWS, and a quotation from Mahatma Gandhi true for the Cloud</figcaption></figure><h3><strong>What Is Cloud Computing?</strong></h3><p>Cloud computing is the <strong>on-demand delivery of IT resources</strong> and applications via the Internet with <strong>pay-as-you-go pricing</strong>. At its core, AWS provides on-demand delivery of IT resources via the Internet on a secure cloud services platform, offering computing power, storage, databases, content delivery, and other functionality to help businesses scale and grow. Using AWS resources instead of your own is <strong>like purchasing electricity from a power company instead of running your own generator</strong>, and it provides the key advantages of cloud computing.</p><p>You can choose public, private, or hybrid cloud deployments and the service model based on the level of flexibility, control, and management you need. The three main types of cloud service models include:</p><ul><li><strong>Infrastructure as a service (IaaS)</strong>: <strong>Cloud provider </strong>manages (Virtualization) (Physical Hardware) (Networking) whereas<strong>, User</strong> has to manage: (Application) (App Runtime) (OS).</li><li><strong>Platform as a service</strong> <strong>(PaaS)</strong>: <strong>Cloud provider</strong> manages (App Runtime) (OS) (Virtualization) (Physical Hardware) Networking) whereas, a <strong>User</strong> only takes care (Application) (Data).</li><li><strong>Software as a service (SaaS)</strong>: Here, the <strong>Cloud provider</strong> manages everything (Application) (Data) (App Runtime) (OS) (Virtualization) (Physical Hardware) (Networking).</li></ul><h4><strong>Benefits of Cloud Computing</strong></h4><ol><li><strong>Pay-as-you-go pricing model</strong>: Similar to your electricity bill, pay your bills for what resources you have used.</li><li><strong>Global Reach</strong>: Go Global in Minutes- easily deploy their applications to multiple locations around the world with just a few clicks.</li><li>E<strong>conomy of scale: </strong>Focus on Business Differentiators- Stop spending money on running and maintaining data centers.</li><li>S<strong>calability: </strong>Scale Up and down your infrastructure as per demand.</li><li><strong>Reliability &amp;High Availability</strong>: The platform is designed to be highly redundant, with multiple data centers around the world. This means that even if one data center goes offline, your applications will continue to run without interruption.</li><li><strong>Others</strong>: Security, Elasticity, Agility, and many more.</li></ol><p>Stop Guessing the Capacity, Memory, and Compute power- Thanks to Cloud computing platforms like <strong>Amazon Web Services (AWS)</strong>, <strong>Google Cloud Platform (GCP)</strong>, and <strong>Microsoft Azure</strong>.</p><h4>About Amazon Web Services (AWS)</h4><p>Amazon Web Services (AWS) is a cloud computing platform that provides a wide range of services including computing, storage, and content delivery. AWS offers a variety of services designed to help businesses and organizations of all sizes build, deploy, and manage their applications and workloads in the cloud. This allows organizations to focus on their core business, rather than on building and maintaining the infrastructure required to support their operations.</p><h4><strong>AWS Cloud Economics: (Simple narration, Why Cloud?)</strong></h4><p>When running any business there are 2 kinds of expenses involved Capital Expenses (Cap Ex) and Operational Expenses (Op Ex). <strong>Cap-Ex</strong> is the one-time capital investment that you do when setting up a business for the first time. <strong>Op-Ex</strong> is your monthly expense to keep your business in operation.</p><p>Let’s understand this with an example: A owner of an e-commerce platform is trying to scale up his business as it has grown over the last year and now festival sales are about to be there in the upcoming month, also they have projections that their business is going to get 10 times in next year. Now they want to figure out whether setting up their own data center will be good or taking their infrastructure to the cloud will be better.</p><blockquote>If setting up their own data center they figured they would need 100 servers and it will take around approx. 10 Cr investment in setting up the data center, this cost is Cap-Ex (<strong>Cap-Ex</strong> includes, land, building the data center, cooling system, servers, networking devices, and power set up). To keep the data center operational they need to set expend 10 Lakh/Month ( <strong>Op-Ex</strong> includes Electricity, Manpower, Licensing of software, and Repair of infrastructure).</blockquote><ul><li>These expenses they will have to bear whether they use their server to their 100 percent capacity or not.</li><li>This data center can’t be scaled up immediately if there is a requirement for more servers.</li><li>There is risk associated due to acts of nature and human error.</li></ul><blockquote>On the other hand, if they plan to operate and scale up their business on the cloud and borrow as many servers as their business demands during festival sales, these demands will go down after the festival. It was estimated 10 Lakh during festival sales and that number would go down in the upcoming month. What would you suggest to your organization?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*2HKLhIEXHCfXvUbdLuz-wQ.jpeg" /></figure><h4>Important things to note when moving to the cloud:</h4><p>It’s very important to identify which resources will reduce costs when moving to the cloud.</p><ul><li><strong>Right sizing</strong> is the most effective way to control cloud costs. It involves continually analyzing needs and patterns and then turning off idle instances and right-sizing instances that are either over-provisioned or poorly matched to the workload. It will save a lot.</li><li><strong>Automation</strong> in the cloud means a code that <strong>controls infrastructure, deployment, and self-monitoring</strong>. Automating the cloud is like developing a single set of tools that are used to design, build, deploy, and change a system. Automating the right way can save dollars and manpower in performing a task or solving a problem.</li><li><strong>AWS Compliance</strong> empowers to maintain security and data protection in the AWS Cloud. When systems are built in the AWS Cloud, AWS and customers <strong>share compliance responsibilities</strong>. It’s good to know where we need to be compliant and AWS reduces the scope to be compliant.</li></ul><h4>Few Important services offered by AWS:</h4><p>Amazon Web Services (AWS) offers a wide range of cloud computing services that can help organizations with a variety of different computing needs. Now we discuss a few important services in very brief to have an understanding of what can we do on AWS and we could be aware of what AWS has to offer.</p><ol><li>A<strong>mazon Elastic Compute Cloud (EC2) </strong>— provides scalable computing capacity in the cloud</li><li><strong>Amazon Simple Storage Service (S3)</strong> — provides secure, durable, and scalable object storage in the cloud</li><li><strong>Amazon Elastic Block Store (EBS) </strong>— provides block storage for Amazon EC2 instances</li><li><strong>Amazon Glacier</strong> — provides low-cost, long-term storage for data archiving and backup</li><li><strong>Amazon Cloud Front</strong>: content delivery network (CDN) service that speeds up the delivery of static and dynamic web content</li><li><strong>Amazon Elastic Load Balancer</strong> — automatically distributes incoming application traffic across multiple targets</li><li><strong>Amazon Lambda</strong> — enables users to <strong>run code without provisioning</strong> or managing servers</li><li><strong>Amazon Elastic Beanstalk</strong>: This service makes it easy to deploy and run applications on the AWS platform.</li><li><strong>Amazon Elastic Container Service (ECS)</strong> — allows users to run and manage Docker containers on AWS</li><li><strong>Amazon Elastic Container Registry (ECR)</strong> — allows you to easily store, share, and deploy your container software anywhere</li><li><strong>Amazon Elastic Kubernetes Service (EKS)</strong> — allows users to<strong> run Kubernetes </strong>on AWS</li><li><strong>AWS Fargate </strong>— allows to focus on building applications without managing servers and is compatible with (ECS) and (EKS)</li><li><strong>Amazon Lightsail</strong> — allows launching simple (OS), a pre-configured application, or a development stack — such as WordPress, Plesk, LAMP, Nginx, and more.</li><li><strong>Amazon Cognito </strong>— provides authentication, authorization, and user management for mobile and web applications</li><li><strong>Amazon API Gateway </strong>— allows developers to create, publish, maintain, monitor, and secure <strong>APIs</strong></li><li><strong>Amazon Route 53 </strong>— scalable and highly available Domain Name System <strong>(DNS)</strong> web service.</li><li><strong>Amazon Relational Database Service (RDS) —</strong> This is a managed database service that makes it easy to set up, operate, and scale a<strong> </strong>relational database in the cloud.</li><li><strong>Amazon DynamoDB —</strong> This is a fully managed <strong>No-SQL database</strong> service that provides fast and predictable performance.</li><li><strong>Amazon Aurora</strong> — High-performance managed relational database</li><li><strong>Amazon Redshift</strong> — Provides fast, simple, cost-effective data warehousing, useful for data engineering.</li><li><strong>Amazon CloudWatch</strong> — allows to observe, and monitor resources and applications on AWS, on-premises, and on other clouds.</li><li><strong>AWS CloudFormation</strong> — allows provisioning of cloud with IaC (Infrastructure as code), similar to Terraform.</li><li><strong>AWS CloudTrail</strong> — enables auditing, security monitoring, and operational troubleshooting. CloudTrail records user activity and API calls across AWS services as events.</li><li><strong>AWS Config</strong> — allows continually assesses, audits, and evaluates the configurations and relationships of your resources.</li><li><strong>AWS Identity and Access Management (IAM)</strong> —helps to specify who can access which AWS services and resources, and under which conditions.</li><li><strong>AWS Key Management Service (KMS)</strong> — allows you to create, manage, and control cryptographic keys across your applications.</li></ol><p>These are just a few examples of the many services offered by AWS.</p><p>There lot more to discuss in AWS however, I don’t want this article to be very lengthy. So, I’ll discuss a few useful services in detail in an upcoming blog and will do some practicals on the AWS management console.</p><blockquote>Thank you for taking the time to read this article. <em>You can contact me in case of any doubts or if you need any assistance or have any feedback:<br>Email: deepakv.knit@gmail.com<br>GitHub: </em><a href="https://github.com/deepakv30">https://github.com/deepakv30</a><em><br>LinkedIn: </em><a href="https://www.linkedin.com/in/deepakv30/">https://www.linkedin.com/in/deepakv30/</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=786b0a95d15f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with Shell Scripting]]></title>
            <link>https://medium.com/@deepakv30/getting-started-with-shell-scripting-ef84489b82b4?source=rss-27acd45ac432------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef84489b82b4</guid>
            <dc:creator><![CDATA[Deepak Vishwakarma]]></dc:creator>
            <pubDate>Sun, 20 Nov 2022 05:28:18 GMT</pubDate>
            <atom:updated>2022-11-20T05:28:18.902Z</atom:updated>
            <content:encoded><![CDATA[<p>Here, we will try to cover basic terminologies used in shell scripting and will try to get a bigger picture of what shell scripting is not. We will try to bust the myth about shell scripting and we will get started with the conditional and iterative statements.</p><figure><img alt="shebang" src="https://cdn-images-1.medium.com/max/1024/1*I0oi-OIRmQOHCK_1G8ahhQ.png" /></figure><h3>Shell Scripting?</h3><p>Let’s understand the shell and script separately to understand shell scripting.</p><blockquote><strong>Shell</strong>: A shell is a type of computer program called a <strong>command-line interpreter</strong> that lets users control their operating systems with <strong>command-line interfaces</strong>.</blockquote><blockquote><strong>Script</strong>: A script is a computer language with <strong>several commands within a file</strong> capable of being <strong>executed without being compiled.</strong></blockquote><blockquote>Now, simply saying <strong>Shell script</strong> is a list of several commands within a file that is run by the Unix shell which is a command line interpreter.</blockquote><p>The Shell Script is most useful for <strong>repetitive tasks that may be time-consuming to execute by typing one line at a time</strong>.</p><h4>What is BASH?</h4><blockquote>Bash (Bourne Again Shell) is the free and enhanced version of the Bourne shell distributed with Linux and GNU operating systems.</blockquote><blockquote><strong>Myth: </strong>“Bash is a programming language”</blockquote><blockquote><strong>Bash is not a programming language</strong>, it is a command-line interpreter. Bash is a software replacement for the original Bourne shell.</blockquote><p>You will notice that every script starts with #!/bin/bash This is called <strong>shebang</strong>. It is basically to <strong>refer the path to the interpreter</strong>. There are many interpreters, like bash, csh, ksh, and tcsh, etc. Let’s try to refer different interpreters.</p><ol><li>Bourne Again Shell referred to as BASH <strong><em>#!/bin/bash</em></strong></li><li>Original Bourne Shell or C Shell<strong><em> </em></strong><strong><em>#!/bin/sh</em></strong></li><li>KSH or Korn Shell <strong><em>#!/bin/ksh</em></strong></li><li>TCSH <strong><em>#!/bin/tcsh</em></strong></li></ol><pre>#This is a comment line on Linux<br>#Know which interpreter your Linux uses by the command &quot;which $BASH&quot;<br>[ec2-user@ip-172-31-92-132 ~]$ which $BASH<br>/bin/bash</pre><h4><strong>Let’s write our first script in bash</strong></h4><pre>#!/bin/bash<br>echo &quot;Welcome to the world of Linux&quot;</pre><pre>#To run the script we need to save it as a script file and make it executable<br>[ec2-user@ip-172-31-92-132 ~]$ chmod +x script.sh<br>[ec2-user@ip-172-31-92-132 ~]$ ./script.sh<br>Welcome to the world of Linux</pre><h4>Most commonly used commands when working with Shell scripting</h4><p><strong>read</strong>: The read command takes one line of input from the user and assigns it to a variable. <strong>Syntax</strong>: read -p “PROMPT MESSAGE” VARIABLE</p><pre>#!/bin/bash<br>read -p &quot;Enter your name: &quot; name<br>echo &quot;Hello $name, Welcome to the world of Linux&quot;<br>[ec2-user@ip-172-31-92-132 ~]$ ./script.sh <br>Enter your name: Deepak Vishwakarma<br>Hello Deepak Vishwakarma, Welcome to the world of Linux<br><br>#PRO TIP: Run the command &quot;man read&quot; to know more about the command</pre><p><strong>Variables</strong>: Variables are basically storage locations that have a name and can store some data which can be changed in the future.</p><pre># VALID VARIABLES <br>THIS3VARIABLE=&quot;ABC&quot;<br>THIS_IS_VARIABLE=&quot;ABC&quot;<br>thisIsVariable=&quot;ABC&quot;<br># Variables cannot start with a number and underscore is allowed<br><br># INVALID VARIABLES<br>4Number=&quot;INVALID&quot;<br>This-Is-Var=&quot;INVALID&quot;<br># No special character apart from underscore is allowed!</pre><p><strong>Operators</strong>: Operators are the symbol that tells the interpreter to perform some operation. Operators can be of different types link Arithmetic, Relational, Boolean, and String. Here we will discuss only the Arithmetic operators and we will use them in our script.</p><pre>var1 -eq var2  # True if var1 is equal to var2<br>var1 -ne var2  # True if var1 not equal to var2<br>var1 -lt var2  # True if var1 is less than var2<br>var1 -le var2  # True if var1 is less than or equal to var2<br>var1 -gt var2  # True if var1 is greater than var2<br>var1 -ge var2  # True if var1 is greater than or equal to var2</pre><h4>Conditional Statement</h4><ol><li><strong>if statement: </strong>Here statement will be processed only when “if” block the expression is true</li></ol><pre>#SYNTAX<br>if [ expression ]<br>then<br>   statement<br>fi<br># To close the if block we need to end with fi</pre><p>2. <strong>if-else statement: </strong>Here when “if” block expression is false then the “else” block statement will be processed.</p><pre>#SYNTAX<br>if [ expression ]<br>then<br>   statement1<br>else<br>   statement2<br>fi</pre><p>3. <strong>if..elif..else..fi statement (if elif ladder)</strong></p><pre>if [ expression1 ]<br>then<br>   statement1<br>   statement2<br>   .<br>   .<br>elif [ expression2 ]<br>then<br>   statement3<br>   statement4<br>   .<br>   .<br>else<br>   statement5<br>fi</pre><p>4. <strong>case-switch statement: </strong>This is very helpful when if we are checking the same expression(or condition) repetitively in the if elif ladder.</p><pre>case &quot;$VARIABLE&quot; in<br>  pattern_1)<br>  #commands when $VARIABLE matches pattern 1<br>    ;;<br>  pattern_2)<br>  #commands when $VARIABLE matches pattern 2<br>    ;;<br>  *)<br>  # This will run if $VARIABLE doesn&#39;t match any of the given patterns<br>    ;;<br>esac</pre><p><strong>&gt; if-elif ladder </strong>script to check different output for disk usage on file system</p><pre>#!/bin/bash<br>echo &quot;Select the Option From below:&quot;<br>echo -e &quot;<br>[ 1 ] Show Only the Disk-Name and Used-Space \n<br>[ 2 ] Show Only the Disk-Name and its Size \n<br>[ 3 ] Show Disk-Name and its File-System \n<br>[ 4 ] Show all fields in DiskUsage \n&quot;<br><br>read userInput<br>if [ $userInput == 1 ];<br>then<br>df -h --output=source,used<br><br>elif [ $userInput == 2 ];<br>then<br>df -h --output=source,size<br><br>elif [ $userInput == 3 ];<br>then<br>df -h --output=source,fstype<br><br>elif [ $userInput == 4 ];<br>then<br>df -ha<br>else<br>echo &quot;!!!!!!!!Wrong Output!!!!!!!!&quot;<br>fi<br><br># LET&#39;s RUN THE SCRIPT<br>[ec2-user@ip-172-31-92-132 ~]$ ./script.sh<br>Select the Option From below:<br><br>[ 1 ] Show Only the Disk-Name and Used-Space <br><br>[ 2 ] Show Only the Disk-Name and its Size <br><br>[ 3 ] Show Disk-Name and its File-System <br><br>[ 4 ] Show all fields in DiskUsage <br><br>1  #PROVIDED INPUT AS &quot;1&quot; AND IN NEXT LINE IT RETURNS OUTPUT <br>Filesystem      Used   <br>devtmpfs           0<br>tmpfs              0<br>tmpfs           408K<br>tmpfs              0<br>/dev/xvda1      1.6G<br>tmpfs              0</pre><h4>Iterative Statements: Loops</h4><ol><li><strong>For Loop</strong></li></ol><pre>#SYNTAX <br>for VARIABLE in ITEM1 ITEM2 ITEM3 ITEM4 ITEM5 .. N<br>do<br>    command 1<br>    command 2<br>    command N<br>done</pre><p>Example:</p><pre>#!/bin/bash<br>Subjects=&quot;Cloud Docker Kubernetes&quot;<br>for Subject in $Subjects<br>do<br>  echo &quot;I need to learn ${Subject}, to be a good DevOps Engineer&quot;<br>done<br><br>[ec2-user@ip-172-31-92-132 ~]$ vim subject.sh<br>[ec2-user@ip-172-31-92-132 ~]$ chmod +x subject.sh<br>[ec2-user@ip-172-31-92-132 ~]$ ./subject.sh <br>I need to learn Cloud, to be a good DevOps Engineer<br>I need to learn Docker, to be a good DevOps Engineer<br>I need to learn Kubernetes, to be a good DevOps Engineer</pre><p>Another way of using For Loop:</p><pre>for (( VARIABLE=1;VARIABLE&lt;N;VARIABLE++ ))<br>do<br>  command 1<br>  command 2<br>    ...<br>    ...<br>  command N<br>done</pre><p><strong>2. The While Loop</strong></p><p>While loop repeats a series of commands for as long as the given condition holds true.</p><pre>while [ CONNDITION_IS_TRUE ]<br>do<br>  # Commands will change the entry condition<br>  command 1<br>  command 2<br>    ...<br>    ...<br>  command N<br>done</pre><p>The condition can be any test or command. If the test command returns a 0 exit status, it means that the condition is true and commands will be executed. If the command returns a non-zero exit status, the loop will stop its iterations. If the condition is false initially, then the commands inside the loop will never get executed.<br>Don’t worry if you do not know what an exit status is. We will cover that in a bit :)</p><p><strong>Example: </strong>Reading a file line by line</p><pre>#!/bin/bash<br>LINE=1<br>while read CURRENT_LINE<br>do<br>  echo &quot;${LINE}: $CURRENT_LINE&quot;<br>  ((LINE++))<br>done &lt; /etc/passwd<br><br># This script loops through the file /etc/passwd line by line with line number<br>[ec2-user@ip-172-31-92-132 ~]$ vim file.sh<br>[ec2-user@ip-172-31-92-132 ~]$ chmod +x file.sh<br>[ec2-user@ip-172-31-92-132 ~]$ ./file.sh<br>1: root:x:0:0:root:/root:/bin/bash<br>2: bin:x:1:1:bin:/bin:/sbin/nologin<br>3: daemon:x:2:2:daemon:/sbin:/sbin/nologin<br>4: adm:x:3:4:adm:/var/adm:/sbin/nologin<br>5: lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin<br>...<br>...<br>...</pre><p><strong>TIP:</strong><br>continue statement is used to take the flow of control to the next iteration. Any statement after the continue statement is hit will not be executed and the flow of control will shift to the next iteration.<br>break statement can be used in while loops (or other loops like for loop) to end the loops. Once the break statement is hit, the flow of control will move outside the loop.</p><h4>What To Learn Next?</h4><ul><li>Positional Parameters, Exit Statuses, Logic Operations, Functions, Wildcards, Debugging, and so on.</li></ul><h3>Conclusion</h3><p>I hope this article would help you get started with Scripting. Connect with me on <a href="https://www.linkedin.com/in/deepakv30/">LinkedIn</a> and <a href="https://github.com/deepakv30">GitHub</a> for more such articles. I would more than happy if you send your feedback, and suggestions or ask queries.</p><h3>Where to go from here?</h3><p>This article contained the basics of shell scripting. However, I would recommend you to read the book <a href="http://linuxcommand.org/tlcl.php">“The Linux Command Line”</a> By William Shotts, it will explain to you how the Linux command line/terminal works in detail and how to customize it to make it much better!</p><blockquote><em>Thanks a lot for keeping your calm and reading till the end. All the best and Happy coding! You can contact me in case of any doubts or if you need any assistance:<br>Email: deepakv.knit@gmail.com<br>GitHub: </em><a href="https://github.com/deepakv30">https://github.com/deepakv30</a><em><br>LinkedIn: </em><a href="https://www.linkedin.com/in/deepakv30/">https://www.linkedin.com/in/deepakv30/</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef84489b82b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Commands Cheat-sheet]]></title>
            <link>https://medium.com/@deepakv30/linux-commands-cheat-sheet-913c5a5e36d8?source=rss-27acd45ac432------2</link>
            <guid isPermaLink="false">https://medium.com/p/913c5a5e36d8</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[linux-commands]]></category>
            <dc:creator><![CDATA[Deepak Vishwakarma]]></dc:creator>
            <pubDate>Mon, 14 Nov 2022 05:45:01 GMT</pubDate>
            <atom:updated>2022-11-14T05:45:01.111Z</atom:updated>
            <content:encoded><![CDATA[<p>This article will help us with all the very basic commands in Linux for working with files and directories. I have run all commands on a Linux machine running on AWS and shared output. I have tried to make it simple by showing the results of commands instead of going into the theory aspect of command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tk0BvANKXfP85bV0" /></figure><h3><strong>1. Manual pages:</strong></h3><p>To check manual pages of any command (important to know more about different versions of any command), configuration file, or daemon</p><pre>[root@ip-172-31-94-169 ec2-user]# man bash<br>BASH(1)                                                     General Commands Manual                                                    BASH(1)<br>NAME<br>       bash - GNU Bourne-Again SHell<br>SYNOPSIS<br>       bash [options] [file]<br>.<br>.<br>.</pre><h3>2<strong>. Working with directories</strong></h3><p>2.1 Print working directory (<strong>pwd</strong>)</p><pre>[root@ip-172-31-94-169 ec2-user]# pwd<br>/home/ec2-user</pre><p>2.2 Change directory (<strong>cd</strong>)</p><pre>[root@ip-172-31-94-169 ec2-user]# cd /etc<br>[root@ip-172-31-94-169 etc]# pwd<br>/etc</pre><p>2.3 Go back to the user’s home directory (<strong>cd ~ or cd</strong> )</p><pre>[ec2-user@ip-172-31-94-169 ~]$ cd<br>[ec2-user@ip-172-31-94-169 ~]$ pwd<br>/home/ec2-user</pre><p>2.4 Go back to the parent directory (<strong>cd ..</strong>)</p><pre>[ec2-user@ip-172-31-94-169 ~]$ cd ..<br>[ec2-user@ip-172-31-94-169 home]$ pwd<br>/home</pre><p>2.5 Go back to the previous directory (<strong>cd -</strong>)</p><pre>[ec2-user@ip-172-31-94-169 ~]$ cd /home<br>[ec2-user@ip-172-31-94-169 home]$ cd -<br>/home/ec2-user<br>[ec2-user@ip-172-31-94-169 ~]$ cd -<br>/home</pre><p>2.6 Absolute and relative paths: When we type path starting with using forward slash (/), then the root directory is assumed</p><pre>[ec2-user@ip-172-31-94-169 home]$ cd /home/ec2-user<br>[ec2-user@ip-172-31-94-169 ~]$ pwd<br>/home/ec2-user</pre><p>2.7 Path auto-completion — Use the tab key for path auto-completion</p><p>2.8 List content of directories (<strong>ls</strong>)</p><pre>[ec2-user@ip-172-31-94-169 ~]$ cd /home<br>[ec2-user@ip-172-31-94-169 home]$ ls<br>ec2-user</pre><p>2.9 List all hidden files along with the content of directories (<strong>ls –a</strong>)</p><pre>[ec2-user@ip-172-31-94-169 /]$ ls -a<br>.  ..  .autorelabel  bin  boot  dev  etc  home  lib  lib64  local  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var</pre><p>2.10 Long listing of contents of directories in an easily readable format (<strong>ls –l</strong>)</p><pre>[ec2-user@ip-172-31-94-169 /]$ ls -l<br>total 16<br>lrwxrwxrwx   1 root root    7 Oct 12 18:54 bin -&gt; usr/bin<br>dr-xr-xr-x   4 root root 4096 Oct 12 18:58 boot<br>drwxr-xr-x  15 root root 2900 Nov 13 22:41 dev<br>drwxr-xr-x  81 root root 8192 Nov 13 22:41 etc<br>drwxr-xr-x   3 root root   22 Nov 13 22:41 home<br>lrwxrwxrwx   1 root root    7 Oct 12 18:54 lib -&gt; usr/lib<br>lrwxrwxrwx   1 root root    9 Oct 12 18:54 lib64 -&gt; usr/lib64<br>drwxr-xr-x   2 root root    6 Oct 12 18:53 local<br>drwxr-xr-x   2 root root    6 Apr  9  2019 media<br>drwxr-xr-x   2 root root    6 Apr  9  2019 mnt<br>drwxr-xr-x   4 root root   27 Oct 12 18:57 opt<br>dr-xr-xr-x 160 root root    0 Nov 13 22:41 proc<br>dr-xr-x---   3 root root  103 Nov 13 22:41 root<br>drwxr-xr-x  28 root root  980 Nov 13 22:41 run<br>lrwxrwxrwx   1 root root    8 Oct 12 18:54 sbin -&gt; usr/sbin<br>drwxr-xr-x   2 root root    6 Apr  9  2019 srv<br>dr-xr-xr-x  13 root root    0 Nov 13 22:41 sys<br>drwxrwxrwt   8 root root  172 Nov 13 23:50 tmp<br>drwxr-xr-x  13 root root  155 Oct 12 18:54 usr<br>drwxr-xr-x  19 root root  269 Nov 13 22:41 var</pre><p>2.11 Long listing of contents of directories in human-readable format (<strong>ls –lh</strong>)</p><pre>[ec2-user@ip-172-31-94-169 /]$ ls -lh<br>total 16K<br>lrwxrwxrwx   1 root root    7 Oct 12 18:54 bin -&gt; usr/bin<br>dr-xr-xr-x   4 root root 4.0K Oct 12 18:58 boot<br>drwxr-xr-x  15 root root 2.9K Nov 13 22:41 dev<br>drwxr-xr-x  81 root root 8.0K Nov 13 22:41 etc<br>drwxr-xr-x   3 root root   22 Nov 13 22:41 home<br>.<br>.</pre><p>2.12 Create a new directory (<strong>mkdir</strong>)</p><pre>[ec2-user@ip-172-31-94-169 ~]$ mkdir newdir<br>[ec2-user@ip-172-31-94-169 ~]$ ls<br>newdir</pre><p>2.13 Creating multiple parent directories (<strong>mkdir –p</strong> )</p><pre>[ec2-user@ip-172-31-94-169 ~]$ mkdir -p newdir/newdir1/newdir2<br>[ec2-user@ip-172-31-94-169 ~]$ ls newdir<br>newdir1</pre><p>2.14 Remove the director when a directory is empty (<strong>rmdir</strong>)</p><pre>[ec2-user@ip-172-31-94-169 ~]$ rmdir newdir/newdir1/newdir2</pre><p>2.15 Recursively removing parent directories (<strong>rmdir –p</strong>)</p><pre>[ec2-user@ip-172-31-94-169 ~]$ rmdir -p newdir/newdir1</pre><h3>3. Working with Files</h3><p>-All files are case-sensitive in Linux. Everything in Linux is a file.</p><p>3.1 Command used to determine whether its a file or directory and if it is a file then what type of file is it</p><pre>[ec2-user@ip-172-31-94-169 amzn2-core]$ ls<br>cachecookie  comps.xml.gz  gen  mirrorlist.txt  packages  primary.sqlite.gz  repomd.xml  updateinfo.xml.gz<br>[ec2-user@ip-172-31-94-169 amzn2-core]$ file primary.sqlite.gz <br>primary.sqlite.gz: gzip compressed data, from Unix, max compression</pre><p>3.2 Create an empty file (<strong>touch</strong>). TIP: Try to check the manual for touch</p><pre>[ec2-user@ip-172-31-94-169 ~]$ touch file1<br>[ec2-user@ip-172-31-94-169 ~]$ ls<br>file1</pre><p>3.3 Remove file forever (<strong>rm</strong>)</p><pre>[ec2-user@ip-172-31-94-169 ~]$ rm file1</pre><p>3.4 Prevent yourself from accidentally removing a file (<strong>rm -i</strong>)</p><pre>[ec2-user@ip-172-31-94-169 ~]$ touch file1 file2 file3<br>[ec2-user@ip-172-31-94-169 ~]$ ls<br>file1  file2  file3 <br>[ec2-user@ip-172-31-94-169 ~]$ rm -i file1<br>rm: remove regular empty file ‘file1’? y<br>[ec2-user@ip-172-31-94-169 ~]$ ls<br>file2  file3</pre><p>3.5 Forcefully remove file or directory (rm –rf)</p><pre>[ec2-user@ip-172-31-94-169 ~]$ rm -rf file2<br>[ec2-user@ip-172-31-94-169 ~]$ ls<br>file3</pre><p>3.6 Copy file (<strong>cp</strong>)</p><pre>[ec2-user@ip-172-31-94-169 ~]$ cp file3 newfile<br>[ec2-user@ip-172-31-94-169 ~]$ ls<br>file3  newfile</pre><p>3.8 Copy multiple files to a directory, in such a case the last argument should be the target directory</p><pre>[ec2-user@ip-172-31-94-169 ~]$ ls<br>file3  newdir  newfile <br>[ec2-user@ip-172-31-94-169 ~]$ cp file3 newfile newdir/<br>[ec2-user@ip-172-31-94-169 ~]$ ls newdir/<br>file3  newfile</pre><p>3.9 Prevent overwriting of existing files (<strong>cp -i</strong>), here i simply outputs the interactive option</p><pre>[ec2-user@ip-172-31-94-169 newdir]$ ls<br>file3  newfile<br>[ec2-user@ip-172-31-94-169 newdir]$ cp -i file3 newfile<br>cp: overwrite ‘newfile’? y</pre><p>3.10 Rename file or move file to another directory or rename directories(<strong>mv</strong>)</p><pre>[ec2-user@ip-172-31-94-169 newdir]$ ls<br>file3  newfile<br>[ec2-user@ip-172-31-94-169 newdir]$ mv file3 rfile<br>[ec2-user@ip-172-31-94-169 newdir]$ ls<br>newfile  rfile</pre><p>3.11 Checks before overwriting any file (<strong>mv -i</strong>)</p><pre>[ec2-user@ip-172-31-94-169 newdir]$ ls<br>newfile  newfile1<br>[ec2-user@ip-172-31-94-169 newdir]$ mv -i newfile newfile1<br>mv: overwrite ‘newfile1’? y<br>[ec2-user@ip-172-31-94-169 newdir]$ ls<br>newfile1</pre><p><strong>Thanks for reading ❤️</strong></p><p><strong>Please leave a comment if you have any thoughts about the topic — I am open to learning and knowledge explorations.</strong></p><p><strong>Click the subscribe button for more content on DevOps and the Cloud.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=913c5a5e36d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>