<?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: Shashank Katte</title>
    <description>The latest articles on DEV Community by Shashank Katte (@shashankkatte).</description>
    <link>https://dev.to/shashankkatte</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%2F569149%2Fd53bfb5d-695c-467d-ab51-e40349eaba02.jpeg</url>
      <title>DEV Community: Shashank Katte</title>
      <link>https://dev.to/shashankkatte</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shashankkatte"/>
    <language>en</language>
    <item>
      <title>Docker Cheatsheet for Web Devs</title>
      <dc:creator>Shashank Katte</dc:creator>
      <pubDate>Thu, 01 Jul 2021 16:06:43 +0000</pubDate>
      <link>https://dev.to/shashankkatte/docker-cheatsheet-for-web-devs-123n</link>
      <guid>https://dev.to/shashankkatte/docker-cheatsheet-for-web-devs-123n</guid>
      <description>&lt;p&gt;As a web-dev in the microservices era you will encounter Docker sooner than later. It's always good to have the essential commands at arm's reach. Following is a list of Essential Docker commands that have helped me on a daily basis, hope this helps yo too. Happy Hacking!&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker Commands
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Docker run command
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;docker run &amp;lt;image-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;example&lt;br&gt;
&lt;code&gt;docker run hello-world&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  To add a override command
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;docker run &amp;lt;image-name&amp;gt; &amp;lt;default command override&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;example&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker run busybox ls&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  List all the running containers
&lt;/h3&gt;

&lt;p&gt;Docker ps command specifically shows running containers&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker ps&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Show all container ever run on machine&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker ps --all&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker ps is also used to get the ID of coantainer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;docker run = docker create + docker start&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;when we create container we just prep it with say file sysytem etc&lt;/li&gt;
&lt;li&gt;When we run the container then we provide the default command that runs the program&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;docker create hello-world&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;now we use the id to start&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker start -a 3c8a5bb0fe7153955d1261054e5b4c99f757920f7760fa7c07803cdbee4b36c1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-a&lt;/code&gt; argument watches for any output and prints it on terminal&lt;/p&gt;
&lt;h3&gt;
  
  
  To re-run an exitied container
&lt;/h3&gt;

&lt;p&gt;first we get the conatiner of ID with ps command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker ps --all&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then use the id with start command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker start -a 1285b5630516&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When we re-run / restart a container we cannot replace the default command, it automatically takes the default command on re-run with commond it was created with.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Removing stopped containers
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;docker system prune&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Docker logs command
&lt;/h3&gt;

&lt;p&gt;Docker logs command shows all the output of con tainer when it had been running&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker logs 73e564097bd5e6689c2bc5687c038dca99ec77d8716f7ff9eeab9434d422bb8d&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Stopping a running container
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;docker stop &amp;lt;container-id&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This sends a SIGTERM signal allowing container to shut down in some time usually 10s, after that it issues Docker kill anyway &lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker kill &amp;lt;container-id&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command issues a SIGKILL that immediately stops the container&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker stop is better way to stop&lt;/strong&gt;*&lt;/p&gt;
&lt;h3&gt;
  
  
  Executing commands in running containers
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;docker exec -it &amp;lt;container-id&amp;gt; &amp;lt;command&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;exec command allows us to type extra commands&lt;/li&gt;
&lt;li&gt;it flag helps us to enter text and send it to container&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The &lt;code&gt;it&lt;/code&gt; flag&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;its a -i and -t &lt;/li&gt;
&lt;li&gt;i attaches our terminal to STDIN&lt;/li&gt;
&lt;li&gt;t flag makes sure that it shows the output formatted on terminal, like auto complete you see with redis-cli&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  How to get shell access in docker container
&lt;/h3&gt;

&lt;p&gt;sh is command processor like bash, zsh etc&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker exec -it &amp;lt;container-id&amp;gt; sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;if ctrl + c doesnt help you exit use ctrl+d or just type exit&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  starting container with a shell
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;docker run -it &amp;lt;container-name&amp;gt; sh&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating a Docker image
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Flow to Creating a DockerFile
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;specify base image&lt;/li&gt;
&lt;li&gt;Run some commands to install additional programs&lt;/li&gt;
&lt;li&gt;specify command to run on container startup&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Sample docker file to create redis image
&lt;/h3&gt;

&lt;p&gt;Create a file named &lt;code&gt;Dockerfile&lt;/code&gt;  no extension just Dockerfile&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Use an existing docker image as base &lt;/span&gt;
FROM alpine


&lt;span class="c"&gt;# Download and install a dependency&lt;/span&gt;
RUN apk add &lt;span class="nt"&gt;--update&lt;/span&gt; redis

&lt;span class="c"&gt;# Tell the image what to do when it starts as a container&lt;/span&gt;
CMD &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"redis-server"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;use the docker build command to build image&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker build .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run the image as usual&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Writing a docker file == say, given a computer with no OS and being asked to install chrome&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Tagging an image
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;docker build -t &amp;lt;docker-hub -id&amp;gt;/&amp;lt;project&amp;gt;:&amp;lt;version&amp;gt; .&lt;/code&gt; Dont forget the dot at the end.&lt;/p&gt;

&lt;p&gt;to run the image&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker run &amp;lt;docker-hub -id&amp;gt;/&amp;lt;project&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;this automatically takes the latest version.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Technically, the version number at the end is the actual tag here&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Manual image generation with docker commit
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;docker commit -c 'CMD ["&amp;lt;command&amp;gt;"]' &amp;lt;container id&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Copy build files
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;COPY &amp;lt;relative local file system&amp;gt; &amp;lt;relative dest&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Port forwarding
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;docker run -p &amp;lt;portno&amp;gt; : &amp;lt;container-port-no&amp;gt; &amp;lt;image-id&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Specifying a working directory
&lt;/h2&gt;

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

&lt;p&gt;Any following commands will be executed relative to working dir&lt;/p&gt;

</description>
      <category>docker</category>
      <category>webdev</category>
      <category>codenewbie</category>
      <category>devops</category>
    </item>
    <item>
      <title>Open source MERN survey APP for you to Learn and contribute</title>
      <dc:creator>Shashank Katte</dc:creator>
      <pubDate>Fri, 09 Apr 2021 21:02:18 +0000</pubDate>
      <link>https://dev.to/shashankkatte/open-source-mern-survey-app-for-you-to-learn-and-contribute-5b8a</link>
      <guid>https://dev.to/shashankkatte/open-source-mern-survey-app-for-you-to-learn-and-contribute-5b8a</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/shashankkatte/feedbackr-mern"&gt;Github link here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedbackr is an Opensource and free survey app. 📝. Use it as a starter app to build your own custom feedback collection App or use it as your reference to explore a production ready MERN App.&lt;/p&gt;

&lt;p&gt;If you are exploring MERN stack, this app will show you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;how to use &lt;strong&gt;React and Redux&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Routing with &lt;strong&gt;React routing&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using reusable &lt;strong&gt;Redux Forms&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Payments with &lt;strong&gt;Stripe&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Google OAuth Authentication&lt;/strong&gt; with &lt;strong&gt;Passport.js&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Persisting data into &lt;strong&gt;MongoDB&lt;/strong&gt; and using &lt;strong&gt;Mongoose&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using &lt;strong&gt;webhooks&lt;/strong&gt; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sending Automated &lt;strong&gt;Emails&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;API key handling techniques&lt;/strong&gt; and  Deployment strategy with configs to &lt;strong&gt;Heroku&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a very good App for you to practice your MERN Skills and contribute to opensource. See you there!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/shashankkatte/feedbackr-mern"&gt;Github link here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The App is based off of learnings from great teachers like Stephen Grider, Brad traversy, Max - Academind, Freecodecamp and many more.&lt;/p&gt;

</description>
      <category>codenewbie</category>
      <category>webdev</category>
      <category>opensource</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Open-source TypeScript Tutorial</title>
      <dc:creator>Shashank Katte</dc:creator>
      <pubDate>Mon, 15 Mar 2021 19:30:37 +0000</pubDate>
      <link>https://dev.to/shashankkatte/open-source-typescript-tutorial-56eb</link>
      <guid>https://dev.to/shashankkatte/open-source-typescript-tutorial-56eb</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/shashankkatte/ts-playground"&gt;Here's a simple, Open-source repo to learn and practice TypeScript&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Instead of creating a long article on all the basics of TypeScript, I have created a &lt;a href="https://github.com/shashankkatte/ts-playground"&gt;GitHub Repo&lt;/a&gt; with the combination of README and source files to help us learn and refresh our TypeScript skills right in our code editor.&lt;/p&gt;

&lt;p&gt;It's a growing open-source repo, where you can collaborate and enhance it with your knowledge, practice code snippets, sample apps and best practices.&lt;/p&gt;

&lt;p&gt;Beginners, experts and curious minds all are welcome.&lt;/p&gt;

</description>
      <category>codenewbie</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>typescript</category>
    </item>
    <item>
      <title>21 Lessons from Building Clones On youtube</title>
      <dc:creator>Shashank Katte</dc:creator>
      <pubDate>Mon, 01 Mar 2021 21:42:12 +0000</pubDate>
      <link>https://dev.to/shashankkatte/21-lessons-from-building-clones-on-youtube-1k1f</link>
      <guid>https://dev.to/shashankkatte/21-lessons-from-building-clones-on-youtube-1k1f</guid>
      <description>&lt;p&gt;Learning a new skill online is fun and free, but how do you make that learning permanent? &lt;a href="https://medium.com/@shashankkatte/21-essential-lessons-from-building-clones-on-youtube-e47202e9c437?sk=d7229aff0b0ab59121c205d61e0cbdae"&gt;Here are the lessons&lt;/a&gt; I have learned taking the journey myself.&lt;/p&gt;

&lt;p&gt;I am eager to know yours :)&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>codenewbie</category>
      <category>career</category>
    </item>
    <item>
      <title>Part 1: Introduction to Cloud Computing with AWS </title>
      <dc:creator>Shashank Katte</dc:creator>
      <pubDate>Mon, 22 Feb 2021 14:23:22 +0000</pubDate>
      <link>https://dev.to/shashankkatte/introduction-to-cloud-computing-with-aws-kco</link>
      <guid>https://dev.to/shashankkatte/introduction-to-cloud-computing-with-aws-kco</guid>
      <description>&lt;p&gt;Cloud computing is an ocean and finding the right learning resources in a single place is a challenge. &lt;/p&gt;

&lt;p&gt;I'm creating a series of Human understandable short articles on AWS from my own learnings over the years. - Cloud Fundamentals with AWS.&lt;/p&gt;

&lt;p&gt;I hope this saves you time and helps you get from beginner to expert on AWS.&lt;/p&gt;

&lt;p&gt;Here is &lt;a href="https://medium.com/katte-io/introduction-to-cloud-computing-128b07e15e5?source=friends_link&amp;amp;sk=6f726de8f58f8c31bc233020997ddefd"&gt;Part 1: Introduction to Cloud Computing&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Next posts on Cloud servers and Storage coming soon.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>aws</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>21 Lessons Learned from Building Clones On youtube</title>
      <dc:creator>Shashank Katte</dc:creator>
      <pubDate>Thu, 11 Feb 2021 14:22:50 +0000</pubDate>
      <link>https://dev.to/shashankkatte/21-lessons-learned-from-building-clones-on-youtube-5c0a</link>
      <guid>https://dev.to/shashankkatte/21-lessons-learned-from-building-clones-on-youtube-5c0a</guid>
      <description>&lt;p&gt;Learning to code Online is fun, free and exciting. But just binging on Videos building Tinder clones won't cut it. How do you solidify your learning? It takes strategy and focus.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/nerd-for-tech/21-lessons-from-building-clones-on-youtube-45340535cf32?sk=975972e3151bb32d8921a4b860e5f540"&gt;Here are 21 lessons I learned my self going through online learning.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>career</category>
      <category>webdev</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Getting along with Git &amp; Github</title>
      <dc:creator>Shashank Katte</dc:creator>
      <pubDate>Mon, 08 Feb 2021 19:07:53 +0000</pubDate>
      <link>https://dev.to/shashankkatte/getting-along-with-git-github-5gam</link>
      <guid>https://dev.to/shashankkatte/getting-along-with-git-github-5gam</guid>
      <description>&lt;p&gt;A no non-sense reference for developers by a developer. Read &lt;a href="https://medium.com/katte-io/getting-along-with-git-github-e1fb7e25d059?source=friends_link&amp;amp;sk=50f0fab75e5bebade84161e0af702a7e"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>github</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How agile principles of ‘done’ can help you as a Software Developer</title>
      <dc:creator>Shashank Katte</dc:creator>
      <pubDate>Sun, 07 Feb 2021 14:28:56 +0000</pubDate>
      <link>https://dev.to/shashankkatte/how-agile-principles-of-done-can-help-you-as-a-software-developer-4j7h</link>
      <guid>https://dev.to/shashankkatte/how-agile-principles-of-done-can-help-you-as-a-software-developer-4j7h</guid>
      <description>&lt;p&gt;Learn how having a definition of done can protect you from unwanted distractions. &lt;a href="https://medium.com/javascript-in-plain-english/dod-db13fd3b6059?source=friends_link&amp;amp;sk=f658b5c50d916f295314fcb4514cd280"&gt;Read more on how I've used it myself&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agile</category>
      <category>productivity</category>
      <category>devops</category>
      <category>webdev</category>
    </item>
    <item>
      <title>7 Javascript Concepts to Master Before Any Framework / Library</title>
      <dc:creator>Shashank Katte</dc:creator>
      <pubDate>Fri, 05 Feb 2021 16:37:35 +0000</pubDate>
      <link>https://dev.to/shashankkatte/7-javascript-concepts-to-master-before-any-framework-library-287h</link>
      <guid>https://dev.to/shashankkatte/7-javascript-concepts-to-master-before-any-framework-library-287h</guid>
      <description>&lt;p&gt;These are the 7 concepts I feel are most important to understand and learn any new JS framework or library.&lt;a href="https://medium.com/codestory/7-js-concepts-to-master-a71f33d676f3?source=friends_link&amp;amp;sk=d1167b474cd431a75a35ca6d7f1e6d10"&gt;Read the full article here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Shell Commands You Should Have Memorized Yesterday</title>
      <dc:creator>Shashank Katte</dc:creator>
      <pubDate>Thu, 04 Feb 2021 14:11:54 +0000</pubDate>
      <link>https://dev.to/shashankkatte/shell-commands-you-should-have-memorized-yesterday-4ap3</link>
      <guid>https://dev.to/shashankkatte/shell-commands-you-should-have-memorized-yesterday-4ap3</guid>
      <description>&lt;h2&gt;
  
  
  Master the Terminal to be a productive developer
&lt;/h2&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%2Fcdn-images-1.medium.com%2Fmax%2F10368%2F0%2A76Za9CYOUB6mqP2M" 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%2Fcdn-images-1.medium.com%2Fmax%2F10368%2F0%2A76Za9CYOUB6mqP2M" alt="Photo by [Louis Hansel @shotsoflouis](https://unsplash.com/@louishansel?utm_source=medium&amp;amp;utm_medium=referral) on [Unsplash](https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral)"&gt;&lt;/a&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@louishansel?utm_source=medium&amp;amp;utm_medium=referral" rel="noopener noreferrer"&gt;Louis Hansel @shotsoflouis&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Being a developer means spending an awful lot of time in the terminal, especially Linux based terminal. You may fear this minimal dark text window, but it is your most potent ally to be a productive developer.&lt;/p&gt;

&lt;p&gt;Terminals (a.k.a Console a.k.a command prompt) can be found everywhere. You find them integrated into your code editors like Visual Studio code or as a CLI (command line interface) to services like GitHub or AWS.&lt;/p&gt;

&lt;p&gt;Being able to fire commands at will in the terminal saves you more time and energy than dragging your mouse pointer around clicking away at the GUI. Interestingly it’s not all that daunting to get started.&lt;/p&gt;

&lt;p&gt;Let's look at the must-know commands…&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Get to know where you are with “pwd”
&lt;/h2&gt;

&lt;p&gt;The pwd command stands for the &lt;em&gt;present working directory. *It tells you exactly which folder/directory you are in the file system. Think of this as your — *find my location&lt;/em&gt; service on google maps. Here’s how to use it: just type pwd at the cursor in the terminal, hit return and it outputs the path to your current directory.&lt;/p&gt;

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

&lt;/div&gt;
&lt;h2&gt;
  
  
  2. Listing files and directories with “ls”
&lt;/h2&gt;

&lt;p&gt;ls is a very powerful command that lists all the contents of a directory. You can use different flags along with it to choose what information is shown.&lt;/p&gt;

&lt;p&gt;When you use it without any options, it displays the names of all the unhidden files and directories in the current directory you are in.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Adding the -l flag along with ls will list all the unhidden contents of your current directory in a tabular format with more details&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;Now, if we want to display all the hidden files and directories we use the -a flag. If we use it along with -l flag it lists all the contents including hidden ones in a nice tabular format&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I highly recommend that you use this format of the ls command, to list out all the contents of directories.&lt;/em&gt;&lt;/p&gt;

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

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;In Linux/mac hidden files and directory names start with . , for example .my-secret-directory is a hidden directory.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  3. Change directories with “cd”
&lt;/h2&gt;

&lt;p&gt;cd stands for change directory. As you might have already guessed it helps us move around directories. Hitch a ride!&lt;/p&gt;

&lt;p&gt;When you use cd without any flags, it takes you to your home directory/root directory. For example, if I try this command on my mac it will take me to my home directory /Users/shashank&lt;/p&gt;

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

&lt;/div&gt;

&lt;p&gt;To get into a particular directory you use cd followed by the name of the directory&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cd my-directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;you can also do multiple jumps per se and get into a directory nested into another directory (subdirectory) using the path. For example, if I want to jump into my projects folder I would do this&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cd shashank/projects
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  4. Understand the dot “.” and double dots “..”
&lt;/h2&gt;

&lt;p&gt;The single dot . is an alias for the current directory and the double dots .. is an alias for the parent directory.&lt;/p&gt;

&lt;p&gt;So if you do a $ cd . You will still stay in the current directory. However, the single dot alias is much useful with other commands like open&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ open .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This launches your default file explorer at the current directory. If you are on mac this launces the finder displaying contents of the current directory.&lt;/p&gt;

&lt;p&gt;now if you use&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cd ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This will take you one level higher or to the parent directory of your current directory.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Yes the alias for current and parent directory &lt;em&gt;.&lt;/em&gt; and &lt;em&gt;..&lt;/em&gt; are also hidden. You will see them listed when you use &lt;em&gt;ls&lt;/em&gt; with &lt;em&gt;-a&lt;/em&gt; flag&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  5. Create Directories with “mkdir”
&lt;/h2&gt;

&lt;p&gt;mkdir stands for make directory. To create a directory use mkdir with the directory name&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mkdir my-new-directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can also use the long path to create directories provided the path until the new directory exists. For example, you can create my-new directroy like so:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mkdir /users/shashank/my-new-directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This will work provided the directory structure /users/shashank already exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Crete a new file with “touch”
&lt;/h2&gt;

&lt;p&gt;touch lets you quickly create an empty file or multiple files. This command is very useful when you need to create files without any content to test out logs etc. to use it you use touch followed by the filename(s) with extension.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ touch log.txt dump.csv 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  7. Add content to file with “&amp;gt;” and “&amp;gt;&amp;gt;”
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;lets you overwrite and push content into a file. For example, you can push the contents from file1 to file2. The contents of file2 will be overwritten if it already has any content&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ file1 &amp;gt; file2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;However, if you want to append content to an existing file without overwriting use &amp;gt;&amp;gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ file1 &amp;gt;&amp;gt; file2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  8. View the file contents with “cat”
&lt;/h2&gt;

&lt;p&gt;The quickest way to display file contents on the terminal is to use the cat command. Similar to touch you can provide multiple file names.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cat file1 file2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  9. Rename or move with “mv”
&lt;/h2&gt;

&lt;p&gt;mv is used to rename files/directories or move files/directories from one place to another&lt;/p&gt;

&lt;p&gt;To move a file&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mv file1 my-directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To rename a directory or file, provide the existing file/directory name followed by a new file name/directory name.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ file1 newfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;If the second parameter is a new folder, the mv command moves the file/directory in the first parameter into the folder in the second parameter. Otherwise, it will rename the file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  10. Delete files and folders with “rm” and “rmdir”
&lt;/h2&gt;

&lt;p&gt;You can delete a file using rm command.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rm filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If the file is write-protected, you will be prompted for confirmation before deleting it. If it's not protected the command goes ahead to delete the file&lt;/p&gt;

&lt;p&gt;To delete an empty folder use the rmdir command&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rmdir my-directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;*Danger zone: *To delete a folder that contains files without any prompt use the rm command with flags r and f&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rm -rf my-directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  11. Use the power of wildcards
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Wildcards&lt;/em&gt; (also referred to as meta characters) are symbols or special characters that represent other characters. You can use them with any command like ls or rm to list or remove files matching given criteria.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An asterisk (*) – matches one or more occurrences of any character, including no character.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Question mark (?) – represents or matches a single occurrence of any character.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bracketed characters ([ ]) – matches any occurrence of character enclosed in the square brackets. It is possible to use different types of characters (alphanumeric characters): numbers, letters, other special characters, etc.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here we list all files with a .txt extension&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ls -al *.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The following example matches all files with names beginning with l followed by any single character and ending with st.sh (which is the suffix).&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ls l?st.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and below we match all files with names starting with l followed by any of the characters in the square bracket but ending with st.sh.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ls l[abdcio]st.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Caution: Be extra careful while using wildcards with rm or rmdir. It can prove disastrous&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  10. Clean up the terminal window with “clear”
&lt;/h2&gt;

&lt;p&gt;With all the commands and inputs the terminal gets cluttered pretty fast. clear does what it says; it clears up the screen and takes your cursor right to the top so that you have a fresh clean area to fire more commands!&lt;/p&gt;

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

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;All is not lost when you use the clear command, If you want to look back at the previous commands and outputs, just scroll up and it’s right there.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  11. Use the “man” command to list a manual for any command
&lt;/h2&gt;

&lt;p&gt;Use man the command to print the complete manual of any command that you can run in the terminal. It gives details on usage options, flags, error codes, etc. &lt;em&gt;When in doubt man it!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here man command will print the entire manual for ls command&lt;/p&gt;


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

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  &lt;strong&gt;Bonus: Understand the power of TAB autocomplete and Arrow keys history&lt;/strong&gt;&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;These are not commands but short-cuts to reduce your typing in the terminal.&lt;/p&gt;

&lt;p&gt;Use the TAB key for autocompletion when you are typing file or directory names. You can type a single character and hit TAB. You can cycle through all the options that start with the character&lt;/p&gt;

&lt;p&gt;Also, you can cycle through the history of recently used commands using the up-Arrow and/or Down- arrow keys.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;p&gt;We have covered the bare minimum commands here, however, they are enough to get you going. As you start using the terminal more often and dip your hands into various CLIs you will pick up the commands essential in your context. I encourage you to explore the &lt;a href="https://www.linux.org/forums/linux-beginner-tutorials.123/" rel="noopener noreferrer"&gt;linux.org documentation&lt;/a&gt; for more commands.&lt;/p&gt;

&lt;p&gt;Thanks for reading and Happy hacking.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This post was first published on my &lt;a href="https://medium.com/@shashankkatte" rel="noopener noreferrer"&gt;Medium profile&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>linux</category>
      <category>github</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
