<?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"><channel><title><![CDATA[Git's blog]]></title><description><![CDATA[Git's blog]]></description><link>https://techny.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 23 Sep 2026 06:10:45 GMT</lastBuildDate><atom:link href="https://techny.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Top 23 Linux Commands YOU MUST KNOW !]]></title><description><![CDATA[Linux Operating System is used to run over 90% of all cloud infrastructure and hosting services. For this reason , it's important to be familiar with popular Linux command. I am a Junior Software Engineer , I am using Amazon Linux Machine for demonst...]]></description><link>https://techny.hashnode.dev/top-23-linux-commands-you-must-know</link><guid isPermaLink="true">https://techny.hashnode.dev/top-23-linux-commands-you-must-know</guid><category><![CDATA[junior software engineer]]></category><category><![CDATA[linux for beginners]]></category><category><![CDATA[Linux]]></category><category><![CDATA[linux-commands]]></category><dc:creator><![CDATA[Gitalee Gaikwad]]></dc:creator><pubDate>Fri, 08 Mar 2024 04:28:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709872305472/07a8b81e-78be-417f-82be-ec44abf4a807.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Linux Operating System is used to run over 90% of all cloud infrastructure and hosting services. For this reason , it's important to be familiar with popular Linux command. I am a Junior Software Engineer , I am using Amazon Linux Machine for demonstration. Let’s get right into it!</p>
<h2 id="heading-what-is-a-linux-command">What Is a Linux Command?</h2>
<p>A Linux command is a program or utility that runs on the command line. A command line is an interface that accepts lines of text and processes them into instructions for your computer.</p>
<p><em>Before start discussing commands you should know following basic concepts:</em></p>
<ul>
<li><p><strong>Directory :</strong> In Linux folder refers to directory.</p>
</li>
<li><p><strong>Arguments :</strong></p>
<p>  Argument is an input given as part of commands.</p>
<p>  <em>Syntax</em></p>
<pre><code class="lang-bash">  &lt;<span class="hljs-built_in">command</span>&gt; &lt;argument&gt;  
  &lt;<span class="hljs-built_in">command</span>&gt; &lt;argument&gt; &lt;argument&gt;
</code></pre>
<p>  <em>Example</em></p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 ~]$ <span class="hljs-built_in">cd</span> GitDev
  [ec2-user@ip-172-31-29-38 GitDev]$ ls
  [ec2-user@ip-172-31-29-38 GitDev]$ touch code.py test.py
  [ec2-user@ip-172-31-29-38 GitDev]$ ls
  code.py test.py
</code></pre>
<p>  Look at the above, command <strong>cd GitDev</strong> has changed our directory to <strong>GitDev</strong> and <strong>touch code.py test.py</strong> created two files for us. These are arguments which are inputs to commands.</p>
</li>
<li><p><strong>Options :</strong></p>
<p>  Options modify the default behavior of the command. Generally, they are used to change the output.</p>
<p>  <em>Example</em></p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 GitDev]$ ls
  code.py  test.py
  [ec2-user@ip-172-31-29-38 GitDev]$ ls -l
  total 0
  -rw-r--r--. 1 ec2-user ec2-user 0 Mar  4 17:19 code.py
  -rw-r--r--. 1 ec2-user ec2-user 0 Mar  4 17:21 test.py
  [ec2-user@ip-172-31-29-38 GitDev]$ ls --inode
  493092 code.py  493093 test.py
</code></pre>
<p>  By default without option, the <strong>ls</strong> command lists the contents of the current directory. In the second command, we used the <strong>-l</strong> option the command displays contents with their properties in a list format. When we use <strong>--inode</strong> option in third the <strong>ls</strong> command, the command displays the <strong>inode</strong> number with the contents.</p>
</li>
<li><p><strong>Absolute Path</strong></p>
<p>  An absolute path is the location of a file or directory specified from the root working directory(/). Absolute path is complete path of file.</p>
<p>  <em>Example:</em></p>
<pre><code class="lang-bash">
  [ec2-user@ip-172-31-29-38 ~]$ ls /home/ec2-user/GitDev/
  code.py  test.py
</code></pre>
<p>  In the above example we provided complete path <strong>/home/ec2-user/GitDev/</strong> of <strong>GitDev</strong> directory to list content of directory.</p>
</li>
<li><p><strong><em>Relative Path</em></strong></p>
<p>  Relative path is defined as path related to the current working directory.</p>
<p>  <em>Example :</em></p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 ~]$ <span class="hljs-built_in">cd</span> GitDev/
  [ec2-user@ip-172-31-29-38 GitDev]$ ls
  code.py  test.py
</code></pre>
<p>  In the above example we are changing directory to <strong>GitDev</strong> using relative path <strong>GitDev/.</strong> There is no / before argument <strong>GitDev</strong> which indicates it’s a relative directory to present working directory.</p>
</li>
</ul>
<h3 id="heading-1pwd">1.pwd</h3>
<p><mark>pwd</mark> command use to print the current working directory.</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-29-38 ~]$ <span class="hljs-built_in">pwd</span>
/home/ec2-user
</code></pre>
<p>Here, my current working directory is <strong>/home/ec2-user</strong>.</p>
<h3 id="heading-2ls">2.ls</h3>
<p><mark>ls</mark> command use to list the content of directory.</p>
<pre><code class="lang-bash">          [ec2-user@ip-172-31-29-38 GitDev]$ ls
          code.py  test.py
          [ec2-user@ip-172-31-29-38 GitDev]$ ls -l
          total 0
          -rw-r--r--. 1 ec2-user ec2-user 0 Mar  4 17:19 code.py
          -rw-r--r--. 1 ec2-user ec2-user 0 Mar  4 17:21 test.py
</code></pre>
<p>The <strong>ls</strong> command lists the contents of the <strong>GitDev</strong> directory. In the second command, we used the <strong>-l</strong> option the command displays contents with their properties in a list format.</p>
<h3 id="heading-3cd">3.cd</h3>
<p><mark>cd</mark> command use to change the directory:</p>
<ul>
<li><p>Change directory to</p>
</li>
<li><p>Change directory to <strong>home</strong> (~) directory</p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 ~]$ <span class="hljs-built_in">pwd</span>
  /home/ec2-user
  [ec2-user@ip-172-31-29-38 ~]$ <span class="hljs-built_in">cd</span> ~
  [ec2-user@ip-172-31-29-38 ~]$ <span class="hljs-built_in">pwd</span>
  /home/ec2-user
</code></pre>
</li>
<li><p>change directory to <strong>parent</strong> (..) directory</p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 ~]$ <span class="hljs-built_in">pwd</span>
  /home/ec2-user
  [ec2-user@ip-172-31-29-38 ~]$ <span class="hljs-built_in">cd</span> ..
  [ec2-user@ip-172-31-29-38 home]$ <span class="hljs-built_in">pwd</span>
  /home
</code></pre>
</li>
<li><p>change directory to <strong>previous (-)</strong> directory</p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 home]$ <span class="hljs-built_in">pwd</span>
  /home
  [ec2-user@ip-172-31-29-38 home]$ <span class="hljs-built_in">cd</span> -
  /home/ec2-user
</code></pre>
</li>
</ul>
<h3 id="heading-4touch">4.touch</h3>
<p><mark>touch</mark> command use to create file without content.</p>
<ul>
<li><pre><code class="lang-bash">              [ec2-user@ip-172-31-29-38 GitDev]$ touch code.py test.py
              [ec2-user@ip-172-31-29-38 GitDev]$ ls
              code.py test.py
</code></pre>
</li>
</ul>
<h3 id="heading-5cat">5.cat</h3>
<p><mark>cat</mark> command use to display the content o file. It is used to read the data from a file and gives its content as output. It also helps us to create, view, and concatenate files.</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-29-38 ~]$ cat /etc/os-release
NAME=<span class="hljs-string">"Amazon Linux"</span>
VERSION=<span class="hljs-string">"2023"</span>
ID=<span class="hljs-string">"amzn"</span>
ID_LIKE=<span class="hljs-string">"fedora"</span>
VERSION_ID=<span class="hljs-string">"2023"</span>
PLATFORM_ID=<span class="hljs-string">"platform:al2023"</span>
PRETTY_NAME=<span class="hljs-string">"Amazon Linux 2023"</span>
ANSI_COLOR=<span class="hljs-string">"0;33"</span>
CPE_NAME=<span class="hljs-string">"cpe:2.3:o:amazon:amazon_linux:2023"</span>
HOME_URL=<span class="hljs-string">"https://aws.amazon.com/linux/"</span>
BUG_REPORT_URL=<span class="hljs-string">"https://github.com/amazonlinux/amazon-linux-2023"</span>
SUPPORT_END=<span class="hljs-string">"2028-03-15"</span>
[ec2-user@ip-172-31-29-38 ~]$
</code></pre>
<p>To concatenate several files, enter:</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-29-38 GitDev]$ touch dev1.py dev2.py
[ec2-user@ip-172-31-29-38 GitDev]$ ls
code.py  dev1.py  dev2.py  test.py
[ec2-user@ip-172-31-29-38 GitDev]$ cat dev1.py dev2.py &gt; final.py
[ec2-user@ip-172-31-29-38 GitDev]$ ls
code.py  dev1.py  dev2.py  final.py  test.py
</code></pre>
<p>This command creates a file named <strong>final.py</strong> that is a copy of <strong>dev1.py</strong> followed by <strong>dev2.py</strong></p>
<h3 id="heading-6mkdir">6.mkdir</h3>
<p><mark>mkdir</mark> command use to create new directory in the current working directory. The mkdir command allows you to create directories from within the terminal. The default syntax is <strong>mkdir</strong> followed by the directory name.</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-29-38 ~]$ mkdir GitDev
[ec2-user@ip-172-31-29-38 ~]$ ls
GitDev
</code></pre>
<p>You can see ,we have created the <strong>GitDev</strong> directory.</p>
<h3 id="heading-7cp">7.cp</h3>
<p><mark>cp</mark> command use to copy files and directories from source to desired destination.</p>
<ul>
<li><p><strong>Copying Files</strong></p>
<p>  The following are examples of coping files</p>
<ul>
<li><p>To make copy of file withing the current directory</p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 GitDev]$ cp code.py copy_code.py
  [ec2-user@ip-172-31-29-38 GitDev]$ ls
  code.py  copy_code.py  dev1.py  dev2.py  final.py  test.py
</code></pre>
<p>  This created copy of <strong>code.py</strong> file as <strong>copy_code.py</strong></p>
</li>
<li><p>To copy a file in your current directory into another directory</p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 ~]$ cp main.py /home/ec2-user/GitDev
  [ec2-user@ip-172-31-29-38 ~]$ <span class="hljs-built_in">cd</span> GitDev/
  [ec2-user@ip-172-31-29-38 GitDev]$ ls
  code.py  copy_code.py  dev1.py  dev2.py  final.py  main.py  test.py
</code></pre>
<p>  This copied main.py file from current directory to <strong>/home/ec2-user/GitDev</strong> directory</p>
</li>
<li><p>To copy all the files in a directory to a new directory</p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 ~]$ cp GitDev/* GitTest
  [ec2-user@ip-172-31-29-38 ~]$ <span class="hljs-built_in">cd</span> GitTest/
  [ec2-user@ip-172-31-29-38 GitTest]$ ls
  code.py  copy_code.py  dev1.py  dev2.py  final.py  main.py  test.py
</code></pre>
<p>  This copied all files from <strong>GitDev</strong> directory to <strong>GitTest</strong> directory.</p>
</li>
</ul>
</li>
<li><p><strong>Copying Directory</strong></p>
<p>  To copy all the files from source directory to destination directory</p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 ~]$ cp -r GitDev GitTest
  [ec2-user@ip-172-31-29-38 ~]$ <span class="hljs-built_in">cd</span> GitTest/
  [ec2-user@ip-172-31-29-38 GitTest]$ ls
  code.py  copy_code.py  dev1.py  dev2.py  final.py  main.py  test.p
</code></pre>
</li>
</ul>
<h3 id="heading-8mv">8.mv</h3>
<p><strong><mark>mv</mark></strong> command use to <strong>move</strong> files and directories from one directory to another or to <strong>rename</strong> a file or directory</p>
<ul>
<li><p><strong>Move files</strong></p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 ~]$ mv final.py GitDev/
  [ec2-user@ip-172-31-29-38 GitDev]$ ls
  final.py
</code></pre>
<p>  Here, we moved <strong>final.py</strong> to <strong>GitDev.</strong> Use <strong>-r</strong>(recursively) option to move files more than one.</p>
</li>
<li><p><strong>Rename file</strong></p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 ~]$ mv main.py new_name.py
  [ec2-user@ip-172-31-29-38 ~]$ ls
  new_name.py
</code></pre>
<p>  Here, we renamed <strong>main.py</strong> to <strong>new_name.py</strong></p>
</li>
</ul>
<h3 id="heading-9rm">9.rm</h3>
<p><strong><mark>rm</mark></strong> use to delete file from current</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-29-38 ~]$ ls
GitDev  GitTest  main.py
[ec2-user@ip-172-31-29-38 ~]$ rm main.py 
[ec2-user@ip-172-31-29-38 ~]$ ls
GitDev  GitTest
</code></pre>
<p>To delete all the files in the mydir directory, one by one, type the following:</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-29-38 ~]$ <span class="hljs-built_in">cd</span> GitDev/
[ec2-user@ip-172-31-29-38 GitDev]$ ls
code.py  copy_code.py  dev1.py  dev2.py  final.py  main.py  test.py
[ec2-user@ip-172-31-29-38 GitDev]$ <span class="hljs-built_in">cd</span> ..
[ec2-user@ip-172-31-29-38 ~]$ rm -i GitDev/*
rm: remove regular empty file <span class="hljs-string">'GitDev/code.py'</span>? y
rm: remove regular empty file <span class="hljs-string">'GitDev/copy_code.py'</span>? yy
rm: remove regular empty file <span class="hljs-string">'GitDev/dev1.py'</span>? y
rm: remove regular empty file <span class="hljs-string">'GitDev/dev2.py'</span>? y
rm: remove regular empty file <span class="hljs-string">'GitDev/final.py'</span>? y 
rm: remove regular empty file <span class="hljs-string">'GitDev/main.py'</span>? y
rm: remove regular empty file <span class="hljs-string">'GitDev/test.py'</span>? y
[ec2-user@ip-172-31-29-38 ~]$ <span class="hljs-built_in">cd</span> GitDev/
[ec2-user@ip-172-31-29-38 GitDev]$ ls
</code></pre>
<p>After each file name displays, type <kbd>y</kbd> and press Enter to delete the file.</p>
<h3 id="heading-10rmdir">10.rmdir</h3>
<p><mark>rmdir</mark> command uses to delete directory.</p>
<ul>
<li><p><strong>Remove empty directory*</strong>GitDev*</p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 ~]$ rmdir GitDev/
  [ec2-user@ip-172-31-29-38 ~]$ ls
  GitTest
</code></pre>
</li>
<li><p><strong>Remove non empty directory*</strong>GitTest*</p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-29-38 ~]$ rmdir -r GitTest/
  [ec2-user@ip-172-31-29-38 ~]$ ls
</code></pre>
</li>
</ul>
<h3 id="heading-12-find">12. find</h3>
<p><mark>find</mark> command use to find the file in directory.</p>
<p>Syntax : <em>find directory_path -name file_name</em></p>
<p>Here directory_path is path of directory where you want search file.</p>
<pre><code class="lang-bash">ec2-user@ip-172-31-28-71 ~]$ find . -name main.py
./GitDev/main.py
</code></pre>
<p>In the above command searches file main.py in current directory.</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-28-71 ~]$ find . -name *.py    
./GitDev/main.py
./GitDev/test.py
</code></pre>
<p>In the above command searches all the which file name ends with .py in current directory.</p>
<h3 id="heading-13grep">13.grep</h3>
<p><mark>grep</mark> command use to search lines in file matching pattern.</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-28-71 ~]$ cat main.py    
<span class="hljs-comment"># This program adds two numbers</span>
num1 = 1.5
num2 = 6.3
<span class="hljs-comment"># Add two numbers</span>
sum = num1 + num2
<span class="hljs-comment"># Display the sum</span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">'The sum of {0} and {1} is {2}'</span>.format(num1, num2, sum))
[ec2-user@ip-172-31-29-58 ~]$ grep -i <span class="hljs-string">"num"</span> main.py 
<span class="hljs-comment"># This program adds two numbers</span>
num1 = 1.5
num2 = 6.3
<span class="hljs-comment"># Add two numbers</span>
sum = num1 + num2
<span class="hljs-built_in">print</span>(<span class="hljs-string">'The sum of {0} and {1} is {2}'</span>.format(num1, num2, sum))
[ec2-user@ip-172-31-29-58 ~]$ grep -c <span class="hljs-string">"num"</span> main.py 
6
</code></pre>
<p>The -i option enables to search for a string case insensitively in the given file. It matches the words "num" ,"num1", "num2". We can find the number of lines that matches the given string/pattern using option -c.</p>
<h3 id="heading-14awk">14.awk</h3>
<p><mark>awk</mark> command use for pattern search and processing.</p>
<p>What operations awk command can do?</p>
<ul>
<li><p>Scanning files line by line</p>
</li>
<li><p>Splitting each input line into fields</p>
</li>
<li><p>Comparing input lines and fields to patterns</p>
</li>
<li><p>Performing specified actions on matching lines</p>
<pre><code class="lang-bash">  [ec2-user@ip-172-31-28-71 ~]$ cat main.py    
  <span class="hljs-comment"># This program adds two numbers</span>
  num1 = 1.5
  num2 = 6.3
  <span class="hljs-comment"># Add two numbers</span>
  sum = num1 + num2
  <span class="hljs-comment"># Display the sum</span>
  <span class="hljs-built_in">print</span>(<span class="hljs-string">'The sum of {0} and {1} is {2}'</span>.format(num1, num2, sum))
  [ec2-user@ip-172-31-29-58 ~]$  awk <span class="hljs-string">'/num/ {print}'</span> main.py 
  <span class="hljs-comment"># This program adds two numbers</span>
  num1 = 1.5
  num2 = 6.3
  <span class="hljs-comment"># Add two numbers</span>
  sum = num1 + num2
  <span class="hljs-built_in">print</span>(<span class="hljs-string">'The sum of {0} and {1} is {2}'</span>.format(num1, num2, sum))
  [ec2-user@ip-172-31-29-58 ~]$ awk <span class="hljs-string">'{print $1,$4}'</span> main.py 
  <span class="hljs-comment"># adds</span>
  num1 
  num2 
  <span class="hljs-comment"># numbers</span>
  sum +
  <span class="hljs-comment"># sum</span>
  <span class="hljs-built_in">print</span>(<span class="hljs-string">'The {0}</span>
</code></pre>
</li>
</ul>
<p>awk '/num/ {print}' <a target="_blank" href="http://main.py">main.py</a> this prints the lines which match the given pattern. awk '{print $1,$4}' main.py splitting a line into two fields $1 and $4.</p>
<h3 id="heading-15df">15.df</h3>
<p><mark>df</mark> command is used to see the storage usage by different file system directories (technical term here is file system mounts).This displays information about total space and available space on a file system.</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-28-71 ~]$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
devtmpfs            4096       0      4096   0% /dev
tmpfs             486172       0    486172   0% /dev/shm
tmpfs             194472    2880    191592   2% /run
/dev/xvda1       8310764 1591284   6719480  20% /
tmpfs             486172       0    486172   0% /tmp
/dev/xvda128       10202    1310      8892  13% /boot/efi
tmpfs              97232       0     97232   0% /run/user/1000
</code></pre>
<h3 id="heading-16du">16.du</h3>
<p><mark>du</mark> command use to print disk usage in MB Gb. This displays the number of blocks used for files.</p>
<p>Exit Status:</p>
<p>This command returns the following exit values:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Item</strong></td><td><strong>Description</strong></td></tr>
</thead>
<tbody>
<tr>
<td><strong>0</strong></td><td>Successful completion.</td></tr>
<tr>
<td><strong>\&gt;0</strong></td><td>An error occurred.</td></tr>
</tbody>
</table>
</div><pre><code class="lang-bash">[ec2-user@ip-172-31-28-71 ~]$ du
4       ./.ssh
12      ./GitDev
36      .
</code></pre>
<p>This displays the number of disk blocks in the current directory and each of its subdirectories.</p>
<h3 id="heading-17lscpu">17.lscpu</h3>
<p><mark>lscpu</mark> command use to print CPU information. The lscpu command in Linux with the <code>-J</code> argument generates the output in JSON format.</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-28-71 ~]$ lscpu -J
{
   <span class="hljs-string">"lscpu"</span>: [
      {
         <span class="hljs-string">"field"</span>: <span class="hljs-string">"Architecture:"</span>,
         <span class="hljs-string">"data"</span>: <span class="hljs-string">"x86_64"</span>,
         <span class="hljs-string">"children"</span>: [
            {
               <span class="hljs-string">"field"</span>: <span class="hljs-string">"CPU op-mode(s):"</span>,
               <span class="hljs-string">"data"</span>: <span class="hljs-string">"32-bit, 64-bit"</span>
            },{
               <span class="hljs-string">"field"</span>: <span class="hljs-string">"Address sizes:"</span>,
               <span class="hljs-string">"data"</span>: <span class="hljs-string">"46 bits physical, 48 bits virtual"</span>
            },{
               <span class="hljs-string">"field"</span>: <span class="hljs-string">"Byte Order:"</span>,
               <span class="hljs-string">"data"</span>: <span class="hljs-string">"Little Endian"</span>
               }
     ]
}
MORE
</code></pre>
<h3 id="heading-18ps">18.ps</h3>
<p><mark>ps </mark> command use to get the information of processes. Processes need system resources like CPU, Physical memory etc. to stay alive.ps is a powerful tool that allows you to view information about the processes running on your Linux system. It helps monitor running processes, identify process ID (<strong>PID</strong>), terminal type (<strong>TTY</strong>), <strong>CPU</strong> time usage, command name, user ID and other information.</p>
<ul>
<li><strong><em>ps -ef or ps -aux*</em></strong>− List currently running processes in full format*</li>
</ul>
<pre><code class="lang-bash">[ec2-user@ip-172-31-28-71 ~]$ ps -ef
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  0 Mar06 ?        00:00:05 /usr/lib/systemd/systemd --switched-root --system --deserialize=32
root           2       0  0 Mar06 ?        00:00:00 [kthreadd]
root           3       2  0 Mar06 ?        00:00:00 [rcu_gp]
root           4       2  0 Mar06 ?        00:00:00 [rcu_par_gp]
root           5       2  0 Mar06 ?        00:00:00 [slub_flushwq]
root           6       2  0 Mar06 ?        00:00:00 [netns]
MORE
</code></pre>
<h3 id="heading-19kill">19.Kill</h3>
<p><mark>Kill</mark> command use to kill process.</p>
<p>Syntax : kill -9 process_id or process_name</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-28-71 ~]$ ps -ef | grep http
root       59143       1  0 16:57 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache     59164   59143  0 16:57 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache     59165   59143  0 16:57 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache     59166   59143  0 16:57 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache     59167   59143  0 16:57 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
ec2-user   62502   38348  0 17:03 pts/0    00:00:00 grep --color=auto http
[ec2-user@ip-172-31-28-71 ~]$ sudo <span class="hljs-built_in">kill</span> -9 59164
[ec2-user@ip-172-31-28-71 ~]$
</code></pre>
<p>This kills process apache which has process id 59143. You can get process ids from ps command.</p>
<h3 id="heading-20netstat">20.netstat</h3>
<p><mark>netstat</mark>  -an command that there’s indeed a process listening on ports. This command helps to check things about how your computer connects to the internet. netstat stands for network statistics.</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-29-58 ~]$ netstat -a | more 
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN     
tcp        0      0 ip-172-31-29-58.us-:ssh ec2-18-237-140-16:52390 ESTABLISHED
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN     
udp        0      0 ip-172-31-29-58.:bootpc 0.0.0.0:*                          
udp        0      0 localhost:323           0.0.0.0:*                          
udp6       0      0 ip-172-31:dhcpv6-client [::]:*                             
udp6       0      0 localhost6:323          [::]:*                             
raw6       0      0 [::]:ipv6-icmp          [::]:*                  7          
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  3      [ ]         STREAM     CONNECTED     18595    
unix  3      [ ]         STREAM     CONNECTED     18690    /run/systemd/journal/stdout
unix  3      [ ]         STREAM     CONNECTED     16002    
unix  2      [ ACC ]     STREAM     LISTENING     14501    /run/systemd/resolve/io.systemd.Resolve
unix  2      [ ACC ]     STREAM     LISTENING     14506    /run/systemd/resolve/io.systemd.Resolve.Monitor
--More--
</code></pre>
<p>netstat -a | more show both listening and non-listening sockets. With the –interfaces option, show interfaces that are not up.</p>
<h3 id="heading-21ifconfig">21.ifconfig</h3>
<p><mark>ifconfig </mark> command find the IP addresses. Configures or displays network interface parameters for a network by using TCP/IP.</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-28-71 ~]$ ifconfig
enX0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt;  mtu 9001
        inet 172.31.28.71  netmask 255.255.240.0  broadcast 172.31.31.255
        inet6 fe80::49:54ff:fec4:c79d  prefixlen 64  scopeid 0x20&lt;link&gt;
        ether 02:49:54:c4:c7:9d  txqueuelen 1000  (Ethernet)
        RX packets 48407  bytes 32785275 (31.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 31357  bytes 3158831 (3.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73&lt;UP,LOOPBACK,RUNNING&gt;  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10&lt;host&gt;
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 12  bytes 1020 (1020.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12  bytes 1020 (1020.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[ec2-user@ip-172-31-28-71 ~]$
</code></pre>
<h3 id="heading-22tcpdump">22.tcpdump</h3>
<p><mark>tcpdump</mark> command can be used to find all communications (aka network packages) happening through your network (coming in or going out of your machine)</p>
<h3 id="heading-23ping">23.ping</h3>
<p><mark>ping</mark> is a network utility tool and helps to check if a particular IP address is reachable</p>
<pre><code class="lang-bash">[ec2-user@ip-172-31-28-71 ~]$ ping google.com
PING google.com (142.250.217.110) 56(84) bytes of data.
64 bytes from sea09s30-in-f14.1e100.net (142.250.217.110): icmp_seq=1 ttl=58 time=7.77 ms
64 bytes from sea09s30-in-f14.1e100.net (142.250.217.110): icmp_seq=2 ttl=58 time=7.82 ms
64 bytes from sea09s30-in-f14.1e100.net (142.250.217.110): icmp_seq=3 ttl=58 time=7.90 ms
64 bytes from sea09s30-in-f14.1e100.net (142.250.217.110): icmp_seq=4 ttl=58 time=7.87 ms
64 bytes from sea09s30-in-f14.1e100.net (142.250.217.110): icmp_seq=5 ttl=58 time=7.86 ms
64 bytes from sea09s30-in-f14.1e100.net (142.250.217.110): icmp_seq=6 ttl=58 time=7.79 ms
64 bytes from sea09s30-in-f14.1e100.net (142.250.217.110): icmp_seq=7 ttl=58 time=7.83 ms
64 bytes from sea09s30-in-f14.1e100.net (142.250.217.110): icmp_seq=8 ttl=58 time=7.82 ms
^C
--- google.com ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7012ms
rtt min/avg/max/mdev = 7.769/7.832/7.900/0.040 ms
[ec2-user@ip-172-31-28-71 ~]$ ping git.com
PING git.com (44.233.224.228) 56(84) bytes of data.
^C
--- git.com ping statistics ---
56 packets transmitted, 0 received, 100% packet loss, time 57168ms

[ec2-user@ip-172-31-28-71 ~]$
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Unboxing the Power of the Cloud: An Introduction to Amazon Web Services (AWS)]]></title><description><![CDATA[What is Cloud Computing ?
Cloud computing is the on-demand access of computing resources servers, storage, software, AI-powered tools and more. These computing resources available to customers over internet with pay-per-use pricing.

Consider you are...]]></description><link>https://techny.hashnode.dev/unboxing-the-power-of-the-cloud-an-introduction-to-amazon-web-services-aws</link><guid isPermaLink="true">https://techny.hashnode.dev/unboxing-the-power-of-the-cloud-an-introduction-to-amazon-web-services-aws</guid><dc:creator><![CDATA[Gitalee Gaikwad]]></dc:creator><pubDate>Tue, 27 Feb 2024 18:34:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709031486594/bccc01f9-5551-495c-8f7e-316f67a22415.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-what-is-cloud-computing">What is Cloud Computing ?</h3>
<p>Cloud computing is the on-demand access of computing resources servers, storage, software, AI-powered tools and more. These computing resources available to customers over internet with pay-per-use pricing.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709057229515/f71374e4-47d2-4801-96bd-1b77e8adb4e3.png" alt class="image--center mx-auto" /></p>
<p>Consider you are responsible for running a web application on-premise, you face a variety of infrastructure and architecture issues.</p>
<ul>
<li><p><strong>Cost</strong></p>
<p>  <em>On-premises environment setup requires an upfront capital investment. Your IT teams must plan for the compute and storage resources for all phases of the project. Your project team might reach maximum capacity, which can impact productivity or leave hardware resources unused.</em></p>
</li>
<li><p><strong>Scalability</strong></p>
<p>  <em>Traditional data centers have limited scalability. Scaling up infrastructure to accommodate increased demand requires purchasing additional hardware, which takes time and might lead to over-provisioning or underutilization of resources during periods of low demand.</em></p>
</li>
<li><p><strong>Availability</strong></p>
<p>  <em>Server farms, which were previously maintained at each design center, are often consolidated into a limited number of data centers. For example, if your company has 20 design centers across America and Europe, you might consolidate all their servers into four data centers, geographically distributed across the two continents. Maintaining the high-availability of data centers is challenging and often depends on the reliability of external factors. In addition, IT teams need a well-curated plan for disaster recovery for server farms.</em></p>
</li>
<li><p><strong>Maintenance</strong></p>
<p>  <em>On-premises applications demand ongoing maintenance, upgrades, and repairs. Companies must allocate resources for hardware maintenance, firmware updates, security patches, and equipment replacements, adding to operational costs.</em></p>
</li>
</ul>
<p><strong>Benefits of cloud computing</strong></p>
<ul>
<li><p><strong>Cost-effectiveness</strong></p>
<p>  <em>Cloud computing lets you offload some or all of the expense and effort of purchasing, installing, configuring and managing</em> <a target="_blank" href="https://www.ibm.com/topics/mainframe"><em>mainframe computer</em></a><a target="_blank" href="https://www.ibm.com/topics/mainframe"><em>s and other on-prem</em></a><em>i</em><a target="_blank" href="https://www.ibm.com/topics/mainframe"><em>ses infrastructure.</em></a> <em>And you pay only for cloud-based infrastructure and other computing resources as you use them.</em> </p>
</li>
<li><p><strong>Unlimited scalability</strong></p>
<p>  <em>Cloud computing provides elasticity and self-service provisioning, so instead of purchasing excess capacity that sits unused during slow periods, you can scale capacity up and down in response to spikes and dips in traffic. You can also use your cloud provider’s global network to spread your applications closer to users worldwide.</em></p>
</li>
<li><p><strong>Increased speed and agility</strong></p>
<p>  <em>With cloud computing, your organization can use enterprise applications in minutes instead of waiting weeks or months for IT to respond to a request, purchase and configure supporting hardware, and install software.</em></p>
</li>
</ul>
<h3 id="heading-what-is-amazon-web-services-aws">What is Amazon Web Services (AWS) ?</h3>
<p><strong>AWS Meaning</strong>: The Amazon Web Services (AWS) platform provides more than 200 fully featured services from data centers located all over the world, and is the world's most comprehensive cloud platform.</p>
<p>Amazon web service is an online platform that provides scalable and cost-effective cloud computing solutions.</p>
<p>AWS is a broadly adopted cloud platform that offers several on-demand operations like compute power, database storage, content delivery, etc., to help corporates scale and grow.</p>
<h3 id="heading-aws-services"><strong>AWS Services</strong></h3>
<p>Amazon has many services for cloud applications. Let us list down a few key services of the AWS ecosystem and a brief description of how developers use them in their business.</p>
<p>Amazon has a list of services:</p>
<ul>
<li><p>Compute service</p>
</li>
<li><p>Storage</p>
</li>
<li><p>Database</p>
</li>
<li><p>Networking and delivery of content</p>
</li>
<li><p>Security tools</p>
</li>
<li><p>Developer tools</p>
</li>
<li><p>Management tools</p>
</li>
</ul>
<h3 id="heading-compute"><strong>Compute</strong></h3>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*6bBc5av8HyEUm2N--x6T_A.png" alt class="image--center mx-auto" /></p>
<ol>
<li><strong>AWS EC2</strong></li>
</ol>
<p>It is a web service which provides re-sizable compute capacity in the cloud. It is designed to make the web-scale computing easier for developers. To know more about the service you can refer to our AWS EC2 blog.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*DQ14CTXq8bsHRqwNXETeog.png" alt class="image--center mx-auto" /></p>
<p><strong>2. AWS Elastic Beanstalk</strong></p>
<p>Elastic Beanstalk lets you quickly deploy and manage applications in AWS without worrying about the underlying infrastructure.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:317/1*4JIVviO7b-_YamgA0BB4zA.png" alt class="image--center mx-auto" /></p>
<p><strong>3. AWS Elastic Load Balancing</strong></p>
<p>ELB automatically manages the workload on your instances and distributes them to other instances in case of an instance failure.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*F-LWwWI3UnWVuZmH37dEKA.png" alt class="image--center mx-auto" /></p>
<p><strong>4. AWS Lambda</strong></p>
<p>AWS Lambda is used to execute backend code without worrying about the underlying architecture, you just upload the code and it runs, it’s that simple!</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*VvnJKZpuEqqbHbToAyHLIw.png" alt class="image--center mx-auto" /></p>
<p><strong>5. AWS Autoscaling</strong></p>
<p>The Autoscaling feature is used to scale up and down automatically as and when required.</p>
<h3 id="heading-storage-and-content-delivery"><strong>Storage and Content Delivery</strong></h3>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*WZUMHsd1r1JSLQc7tOXNBA.png" alt class="image--center mx-auto" /></p>
<ol>
<li><strong>S3 AWS</strong></li>
</ol>
<p>S3 stands for simple storage service, it is used for storing data in the form of objects in the AWS Cloud.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:450/1*ybY86tw8bqijO8thO3CTgw.png" alt class="image--center mx-auto" /></p>
<p><strong>2. Amazon CloudFront</strong></p>
<p>CloudFront is a content delivery network which is used to cache data to an edge location which reduces latency.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*__lkrihJNABK_NLkZF_Dhw.png" alt class="image--center mx-auto" /></p>
<p><strong>3. Amazon EBS</strong></p>
<p>Amazon Elastic Block Storage is a storage service wherein each block of storage acts like a separate hard drive.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*HMAQ4W6G7unmeuywtphwww.png" alt class="image--center mx-auto" /></p>
<p><strong>4. Amazon Glacier</strong></p>
<p>Glacier is an archiving service offered by Amazon, which offers low-cost data archiving.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*_l5DRSzPeyrzgT7LagP-lw.png" alt class="image--center mx-auto" /></p>
<p><strong>5. AWS Import/Export Snowball</strong></p>
<p>It offers physical transfer of data between user’s location and AWS data centers, the device which is used to transfer the data is called Snowball.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*oqQRCIzr3vt1jUDrynCTDA.png" alt class="image--center mx-auto" /></p>
<p><strong>6. AWS Storage Gateway</strong></p>
<p>It is used to provide seamless integration with data security features between your on-premise software appliance and AWS Cloud.</p>
<h3 id="heading-database"><strong>Database</strong></h3>
<p><img src="https://miro.medium.com/v2/resize:fit:450/1*0J13Qp2sbcQt5qbVcMX_9A.png" alt class="image--center mx-auto" /></p>
<ol>
<li><strong>Amazon Aurora</strong></li>
</ol>
<p>It is a relational database engine that combines the speed and reliability of high-end commercial databases and the cost-effectiveness and simplicity of open-source databases.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*N4LTZgxkZ6eyVM1O4Gby_w.png" alt class="image--center mx-auto" /></p>
<p><strong>2. Amazon RDS</strong></p>
<p>Amazon RDS is a managed relational database service which does routine database tasks in 6 familiar databases like Amazon Aurora, MySQL, MariaDB, Oracle, Microsoft SQL Server, and PostgreSQL.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*NJdxTOBbCXvFRf5f6U9M_g.png" alt class="image--center mx-auto" /></p>
<p><strong>3. Amazon DynamoDB</strong></p>
<p>It is a fully managed No-SQL database service. It is known for extremely low latencies and scalability.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*TFdQBpn9zBc6M1agRRlWYg.png" alt class="image--center mx-auto" /></p>
<p><strong>4. Amazon ElastiCache</strong></p>
<p>It is a web service that makes it easy to set up, manage and scale a distributed cache-in environment in the cloud.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*SPqjZkIQ_5tnTbZabnp-Tw.png" alt class="image--center mx-auto" /></p>
<p><strong>5. Amazon Redshift</strong></p>
<p>Amazon Redshift is a fully managed petabyte-scale data warehouse service in the cloud.</p>
<h3 id="heading-networking"><strong>Networking</strong></h3>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*w-r0N3rKu8Av0zdm_IL3pQ.png" alt class="image--center mx-auto" /></p>
<ol>
<li><strong>VPC AWS</strong></li>
</ol>
<p>Amazon VPC lets you launch AWS resources in a virtual network that you define. It closely resembles a traditional network that you’d operate in your data center.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*e22POwLbjfmIRb6lbhx-kg.png" alt class="image--center mx-auto" /></p>
<p><strong>2. AWS Direct Connect</strong></p>
<p>It helps you establish a private connection between your premises and AWS, therefore giving better network performance and throughput than an Internet-based connection.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*dMkAy1MnXHhegskgzuLWfQ.png" alt class="image--center mx-auto" /></p>
<p><strong>3. Amazon Route 53</strong></p>
<p>Route 53 is a highly scalable and highly available Domain Name System by Amazon AWS. The name is in reference to the TCP and UDP’s port 53 where DNS requests are addressed.</p>
<h3 id="heading-management-tools"><strong>Management Tools</strong></h3>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*TATpMa2rInV7D7WElihncA.png" alt class="image--center mx-auto" /></p>
<p><strong>1. Amazon CloudWatch</strong></p>
<p>It is a monitoring tool by AWS which is used to keep a track on the AWS resources and the applications you run on Amazon AWS.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*4Rl6pAA0pcxb3kH62piOQA.png" alt class="image--center mx-auto" /></p>
<p><strong>2. AWS CloudFormation</strong></p>
<p>It is a service which helps you set up and model your Amazon AWS resources so that you can spend less time managing these resources and more time focusing on the development.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:312/1*8QdJfD7_XTeAzzVb9ByokA.png" alt class="image--center mx-auto" /></p>
<p><strong>3. AWS CloudTrail</strong></p>
<p>AWS CloudTrail is a logging service which records the API calls to your Amazon AWS account and delivers them to you.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:450/1*e3eXdOkzCmyJA2M8mUVPWg.jpeg" alt class="image--center mx-auto" /></p>
<p><strong>4. AWS Command Line Tool</strong></p>
<p>It is an all in one tool to manage all your AWS services, by downloading and configuring only one tool you can manage all the AWS services through the command line.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:365/1*MUmMsa23HvayCBbKQqQQxg.png" alt class="image--center mx-auto" /></p>
<p><strong>5. AWS OpsWorks</strong></p>
<p>It is a configuration management tool that helps configure and operate applications of all size and shapes using Chef.</p>
<p><strong>6. Trusted Advisor</strong></p>
<p><img src="https://miro.medium.com/v2/resize:fit:180/0*zF6iR_dw2DFM0tJH.png" alt class="image--center mx-auto" /></p>
<p>Trusted Advisor is a customized cloud monitoring tool, that analyzes your AWS environment and gives insights on the expense, performance improvement, security gaps, and reliability.</p>
<h3 id="heading-security-and-identity"><strong>Security and Identity</strong></h3>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*LixSco_xflV-nG57h-OOqg.png" alt class="image--center mx-auto" /></p>
<ol>
<li><strong>AWS Identity and Access Management(IAM)</strong></li>
</ol>
<p>It is an AWS service that helps you control access to your AWS resources for your users.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*9iC8bLGvHlAPGgEQucNMCQ.png" alt class="image--center mx-auto" /></p>
<p><strong>2. AWS Key Management Service</strong></p>
<p>It is a managed service that helps you create and control encryption keys which are used to encrypt your data, and uses Hardware Security Modules to protect the security of your keys.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:192/1*a9FGWtmjCzWYFldfdQXTXA.png" alt class="image--center mx-auto" /></p>
<p><strong>3. Amazon SES</strong></p>
<p>It is a cost-effective emailing service which is built on the scalable and reliable infrastructure of <a target="_blank" href="http://Amazon.com">Amazon.com</a></p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*LTfScmZVjFXCF9yHhiy9SQ.png" alt class="image--center mx-auto" /></p>
<p><strong>4. Amazon SNS</strong></p>
<p>It is a web service offered by AWS that manages the delivery of messages to subscribed <strong>endpoints or clients.</strong></p>
<p><img src="https://miro.medium.com/v2/resize:fit:225/1*25N4wr4sHxTGpYC5XACKFA.png" alt class="image--center mx-auto" /></p>
<p><strong>5. Amazon SQS</strong></p>
<p>It is a fast, reliable and scalable message queuing service, it can be used to transmit any volume of data at any level of throughput, without losing any messages or without the use of any other service.</p>
]]></content:encoded></item></channel></rss>