<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Peter Johnson</title>
    <description>The latest articles on Forem by Peter Johnson (@peterjohnson).</description>
    <link>https://forem.com/peterjohnson</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%2F805281%2F7f9f4580-c77c-46c7-9f80-2985f4eca040.jpg</url>
      <title>Forem: Peter Johnson</title>
      <link>https://forem.com/peterjohnson</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/peterjohnson"/>
    <language>en</language>
    <item>
      <title>Upload files to AWS S3 using Python</title>
      <dc:creator>Peter Johnson</dc:creator>
      <pubDate>Mon, 25 Jul 2022 15:55:57 +0000</pubDate>
      <link>https://forem.com/peterjohnson/upload-files-to-aws-s3-using-python-3230</link>
      <guid>https://forem.com/peterjohnson/upload-files-to-aws-s3-using-python-3230</guid>
      <description>&lt;p&gt;Hi, guys in this blog I'm going to share how you can upload files to AWS S3 using &lt;strong&gt;Python&lt;/strong&gt;. Before getting started make sure that you have got the following requirements installed on your machine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS CLI&lt;/li&gt;
&lt;li&gt;Configured IAM user &lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To operate we will be using &lt;strong&gt;Boto3&lt;/strong&gt; which is an &lt;strong&gt;AWS SDK&lt;/strong&gt; for Python which provides API for AWS infrastructure services.&lt;/p&gt;

&lt;p&gt;We will be making use of the &lt;strong&gt;upload_file&lt;/strong&gt; method. This method accepts a &lt;strong&gt;file name&lt;/strong&gt;, a &lt;strong&gt;bucket name&lt;/strong&gt;, and an &lt;strong&gt;object name&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import boto3
s3_client = boto3.client("s3")
perform = s3_client.upload_file("FILE PATH","BUCKET NAME", "OBJECT NAME")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explaining the code:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First of all, we import boto3, then we create an S3 client so that we can access the different methods offered by boto3, and we'll be using the &lt;strong&gt;upload_file&lt;/strong&gt; method to upload our file. Upon running the code the mentioned file will be uploaded to the respective &lt;strong&gt;S3 bucket&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It's this simple to upload a file from your machine to an S3 bucket using Python, Hope that this was helpful to you.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>aws3</category>
      <category>python</category>
      <category>storage</category>
    </item>
    <item>
      <title>AWS Amplify - Deploy your application in minutes.</title>
      <dc:creator>Peter Johnson</dc:creator>
      <pubDate>Sat, 02 Jul 2022 18:46:28 +0000</pubDate>
      <link>https://forem.com/peterjohnson/aws-amplify-deploy-your-application-in-minutes-119p</link>
      <guid>https://forem.com/peterjohnson/aws-amplify-deploy-your-application-in-minutes-119p</guid>
      <description>&lt;p&gt;In this blog I would like to provide a guide on how you can deploy your web application whether it be static or dynamic using &lt;strong&gt;AWS Amplify.&lt;/strong&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Before moving on let's basically understand what is Amplify:
&lt;/h5&gt;

&lt;p&gt;In simple words Amplify is a framework that consists of Libraries, UI components, and CLI interfaces to build and deploy mobile and web applications.&lt;/p&gt;

&lt;h5&gt;
  
  
  1. Search for Amplify on AWS console and you'll land in a page like this:
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E-cPN0tt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jpub5l6lsf05o2ujhtf9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E-cPN0tt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jpub5l6lsf05o2ujhtf9.png" alt="Imag" width="880" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  2. Click on the &lt;strong&gt;New app&lt;/strong&gt; dropdown and select &lt;strong&gt;Host web app&lt;/strong&gt;.
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0vySnJKP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3hq7isyx5eskm9epxz6c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0vySnJKP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3hq7isyx5eskm9epxz6c.png" alt="Imag" width="880" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  3. In the next page you can see the different ways in which you can connect your code and Amplify:
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--REtlr0qA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i0t0b2sjjzwup4fkp3os.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--REtlr0qA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i0t0b2sjjzwup4fkp3os.png" alt="Image" width="880" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example by authenticating using &lt;strong&gt;GitHub&lt;/strong&gt; you can link your corresponding repository and Amplify will do all the things for you, and when you push a new change to GitHub Amplify will automatically start a &lt;strong&gt;new build&lt;/strong&gt; and publish the new change.&lt;/p&gt;

&lt;p&gt;For this blog we'll select &lt;strong&gt;Deploy without Git provider&lt;/strong&gt; which means we can directly upload the code files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1tO3fPHj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8m3si91wuflv7elnt595.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1tO3fPHj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8m3si91wuflv7elnt595.png" alt="Imag" width="880" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  4. Now it's time to upload the code files and also you need to provide a &lt;strong&gt;App name&lt;/strong&gt; and &lt;strong&gt;Environment name&lt;/strong&gt;.
&lt;/h5&gt;

&lt;p&gt;Here I've dragged and dropped my code files, alternatively if you have got the files stored in an &lt;strong&gt;S3 bucket&lt;/strong&gt; you can connect to the bucket as well, after uploading click on &lt;strong&gt;save and deploy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aRs522AO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/275czd9hnu31dqfzozw2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aRs522AO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/275czd9hnu31dqfzozw2.png" alt="Image" width="880" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the deployment is successful you can click on the &lt;strong&gt;Domain&lt;/strong&gt; and access your website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jh0QAVi7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/of8qrqo38ekw18wf7mrj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jh0QAVi7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/of8qrqo38ekw18wf7mrj.png" alt="Imag" width="880" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's it we are done with the deployment, hope you guys found it useful &lt;strong&gt;Thank you&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>webdev</category>
      <category>production</category>
      <category>amplify</category>
    </item>
    <item>
      <title>Host a Website on AWS EC2 Instance</title>
      <dc:creator>Peter Johnson</dc:creator>
      <pubDate>Fri, 01 Jul 2022 18:08:56 +0000</pubDate>
      <link>https://forem.com/peterjohnson/host-a-website-on-aws-ec2-instance-11ld</link>
      <guid>https://forem.com/peterjohnson/host-a-website-on-aws-ec2-instance-11ld</guid>
      <description>&lt;p&gt;Through this blog I'll provide a step-by-step guide through which you can host your static website on an AWS EC2 Instance.&lt;/p&gt;

&lt;p&gt;So the services that we'll using are &lt;strong&gt;EC2 Instance&lt;/strong&gt; and &lt;strong&gt;S3 Bucket&lt;/strong&gt; &lt;em&gt;(Used to store the code files)&lt;/em&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. The first step is to create an S3 bucket
&lt;/h4&gt;

&lt;h6&gt;
  
  
  Couple of important things to note are:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;The bucket name is required to be unique and if you are planning to connect a domain name make sure your domain &amp;amp; bucket name are the same.&lt;/li&gt;
&lt;li&gt;Also make sure you uncheck &lt;strong&gt;Block all public access&lt;/strong&gt; otherwise the bucket won't be accessible.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_xLeZwNF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z7feb9dc13rxlvgn5dtg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_xLeZwNF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z7feb9dc13rxlvgn5dtg.png" alt="Image" width="880" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  2. The next step is upload the code files
&lt;/h4&gt;

&lt;p&gt;Inside the bucket click on the upload button and upload the respective code files onto the bucket. &lt;/p&gt;

&lt;h4&gt;
  
  
  3. Change permission
&lt;/h4&gt;

&lt;p&gt;In order for the bucket to be accessible we also need to make a change in the the permission section by modifying the bucket policy with the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicRead",
            "Effect": "Allow",
            "Principal": "*",
            "Action": [
                "s3:GetObject",
                "s3:GetObjectVersion"
            ],
            "Resource": [
                "arn:aws:s3:::DOC-EXAMPLE-BUCKET/*"
            ]
        }
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here you need to replace &lt;em&gt;DOC-EXAMPLE-BUCKET&lt;/em&gt; with your bucket name.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Now it's time to create an EC2 Instance
&lt;/h4&gt;

&lt;p&gt;I've created a basic instance within the free-tier eligibility.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--II6BzyWN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fck99bi1x9fvd8e1v6ny.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--II6BzyWN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fck99bi1x9fvd8e1v6ny.png" alt="Image" width="724" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  5. Connecting to the instance
&lt;/h4&gt;

&lt;p&gt;The connection with instance is established using &lt;strong&gt;ssh&lt;/strong&gt;, you can use the following command and replace the &lt;strong&gt;IP&lt;/strong&gt; with your respective &lt;strong&gt;IP&lt;/strong&gt; and &lt;strong&gt;Key&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -i "peterawsjan.pem" ec2-user@18.221.22.171
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  6. Setting up the web server
&lt;/h4&gt;

&lt;p&gt;First of all let's grab the sudo permission by entering&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo su
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now its time to set things up, our EC2 Instance will act as an Server so for that we install httpd.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yum install httpd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NovijP1d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/as87pxril40u8quqoiom.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NovijP1d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/as87pxril40u8quqoiom.png" alt="Image" width="838" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that's done we need to pull data from our S3 bucket to the html folder of our Instance for that lets change directory.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;To fetch data from S3 bucket we need the &lt;strong&gt;object url&lt;/strong&gt; which can be found in &lt;strong&gt;index.html&lt;/strong&gt; file in the S3 section of the AWS console.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget "your object URL"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you fetch it the type will be &lt;strong&gt;.zip&lt;/strong&gt; and you need to unzip and move&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uzip "your folder name"
mv "your folder name"* .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  That's it now its time to start our server.
&lt;/h5&gt;



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

&lt;/div&gt;



&lt;p&gt;You can access your hosted website by searching your Instances IP address.&lt;/p&gt;

&lt;p&gt;I really hope this blog helped you host your website using EC2 Instance, Thank you. &lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Will Quantum computing supersede Cloud computing?</title>
      <dc:creator>Peter Johnson</dc:creator>
      <pubDate>Sat, 12 Feb 2022 20:16:35 +0000</pubDate>
      <link>https://forem.com/peterjohnson/will-quantum-computing-supersede-cloud-computing-9dc</link>
      <guid>https://forem.com/peterjohnson/will-quantum-computing-supersede-cloud-computing-9dc</guid>
      <description>&lt;p&gt;In this Blog I'll be sharing my view on &lt;strong&gt;Quantum Computing&lt;/strong&gt; superseding &lt;strong&gt;Cloud Computing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's start of by understanding what Quantum and Cloud computing is - &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quantum computers&lt;/strong&gt; use the properties of quantum physics to store data and perform computations. In the case of classical computers the information is stored in the form of bits that can either be 0s or 1s but in a quantum computer, the basic unit of memory is a quantum bit or qubit. &lt;/p&gt;

&lt;p&gt;Quantum computers have the unique ability to exist in more than one state simultaneously. So in situations where there are a large number of possible combinations, quantum computers can consider them simultaneously there by providing the output in a fraction of time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cloud computing&lt;/strong&gt; is the delivery of online services (such as servers, databases, software) to users. With the help of cloud computing, storing data on local machines is not required. It helps you access data from a remote server. Moreover, it is also used to store and access data from anywhere across the world.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Will quantum computing supersede cloud computing?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As of now I think it's a &lt;strong&gt;NO&lt;/strong&gt;, both quantum computing and cloud computing has their own advantages and disadvantages. &lt;/p&gt;

&lt;p&gt;Quantum computing will be more relevant to certain businesses where highly complex algorithms need to be evaluated which in a normal computer would take days, weeks, months or even years.&lt;/p&gt;

&lt;p&gt;Quantum computing is highly efficient in situations where there are a large number of possible combinations as it can consider them simultaneously. For Example in the financial sector quantum computing can perform deep analytics to new, faster trading possibilities. But these kinds of highly complex algorithms and high processing power will be used by only a fraction of businesses. &lt;/p&gt;

&lt;p&gt;Not all organizations or technology based businesses require such high computational power for their application to operate, in that case a classical computer with specification optimized for their application would be more than sufficient.&lt;/p&gt;

&lt;p&gt;The possibilities of Quantum Computing is immense and can benefit a lot of sectors, moreover more companies are investing on Quantum Computing(Amazon Braket, IBM, Sycamore), moreover a combination of quantum and classical computing can be also beneficial.&lt;/p&gt;

</description>
      <category>quantumcomputing</category>
      <category>cloud</category>
      <category>sycamore</category>
      <category>braket</category>
    </item>
    <item>
      <title>Must Know Linux Command that can make your Life Easier.</title>
      <dc:creator>Peter Johnson</dc:creator>
      <pubDate>Sun, 30 Jan 2022 11:48:52 +0000</pubDate>
      <link>https://forem.com/peterjohnson/must-know-linux-command-that-can-make-your-life-easier-2ffn</link>
      <guid>https://forem.com/peterjohnson/must-know-linux-command-that-can-make-your-life-easier-2ffn</guid>
      <description>&lt;p&gt;The main intention of this article is to provide a basic understanding of Linux commands, you can learn more about them by using the &lt;strong&gt;man&lt;/strong&gt; command&lt;br&gt;
&lt;code&gt;man 'command name'&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;The locate command is used to locate files. Either a specific file can be searched or files with specific extensions can be searched as well.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The following command returns the entire path for the file "names.txt" if it exists on the machine. &lt;br&gt;
&lt;code&gt;locate "name.txt"&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The following command returns all the files that has the extension ".txt"&lt;br&gt;
&lt;code&gt;locate "*.txt"&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Find is an important command which is used to find files or directories. So Locate command return the file &lt;strong&gt;location&lt;/strong&gt; and the &lt;strong&gt;Find&lt;/strong&gt; command return the file/directory name if it exists.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The following command return all the files in the current working directory(&lt;strong&gt;.&lt;/strong&gt;).&lt;br&gt;
&lt;code&gt;find .&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The following command return all the directories in the current working directory.&lt;br&gt;
&lt;code&gt;find . -type d&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The following command returns all the files having the file extension "&lt;strong&gt;.txt&lt;/strong&gt;" in the current working directory. &lt;strong&gt;-type f&lt;/strong&gt; specifies that the type that should be searched is "&lt;strong&gt;file&lt;/strong&gt;".&lt;br&gt;
&lt;strong&gt;-name "*.txt"&lt;/strong&gt; specifies that the name of the file that needs to be searched is everything(&lt;em&gt;) with the extension *&lt;/em&gt;.txt** .&lt;br&gt;
&lt;code&gt;find . -type f -name "*.txt"&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The following command returns all the files that are modified 20 minutes ago. &lt;br&gt;
&lt;code&gt;find . -type f -mmin -20&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The following command returns all the files that has a size more than 1Kb. &lt;br&gt;
&lt;code&gt;find . -type f -size +1k&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The following command returns all the files that has got read-write-execute permissions. &lt;br&gt;
&lt;code&gt;find . -perm 777&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. File Permissions
&lt;/h2&gt;

&lt;p&gt;Linux offers 3 permissions that can be assigned to all files and directories. There are 3 categories of owners for a file they are &lt;strong&gt;User(u) - Group(g) - Other(o)&lt;/strong&gt;. &lt;code&gt;ls -l&lt;/code&gt; command displays all the files along with their permission details. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read(r/4)&lt;/strong&gt; - Permission to open and read a file. The permission can be assigned either by specifying &lt;strong&gt;r&lt;/strong&gt; or by using the number &lt;strong&gt;4&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the following image you can see that the file &lt;strong&gt;test.txt&lt;/strong&gt;&lt;br&gt;
is having &lt;strong&gt;read and write&lt;/strong&gt; permission for &lt;strong&gt;User&lt;/strong&gt; and &lt;strong&gt;read&lt;/strong&gt; permission for both &lt;strong&gt;Groups&lt;/strong&gt; and &lt;strong&gt;Others&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z2zA-WJj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o1b5uiekzypeze7mt1i1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z2zA-WJj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o1b5uiekzypeze7mt1i1.png" alt="Image1" width="880" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The following command sets the permission to &lt;strong&gt;read&lt;/strong&gt; for all the owners.&lt;br&gt;
&lt;code&gt;chmod 444 test.txt&lt;/code&gt;&lt;br&gt;
or&lt;br&gt;
&lt;code&gt;chmod u=r,g=r,o=r test.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output :&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2IkJvINl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4xbbhvaxyt0oz8v6qzxq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2IkJvINl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4xbbhvaxyt0oz8v6qzxq.png" alt="Image2" width="880" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Another Example :&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following command sets the permission to &lt;strong&gt;read,write and execute&lt;/strong&gt; for &lt;strong&gt;User&lt;/strong&gt; and &lt;strong&gt;read&lt;/strong&gt; to both &lt;strong&gt;Groups and Others&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chmod 744 test.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output :&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yGn-xFO8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x1bhl1jokvynkijt5ipk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yGn-xFO8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x1bhl1jokvynkijt5ipk.png" alt="Image3" width="880" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Write(w/2)&lt;/strong&gt; : Permission to modify a file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Execute(e/1)&lt;/strong&gt; : Permission to run a file.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Perform an action on multiple files
&lt;/h2&gt;

&lt;p&gt;There can be situations where we need to perform an action to multiple files simultaneously in that case the &lt;strong&gt;find&lt;/strong&gt; command which we discussed earlier comes in handy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example :&lt;/strong&gt;&lt;br&gt;
In the following image you can see that there are 4 files and consider a situation in which we need to delete them in one go. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nffIY7ky--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tw11ebbnug51nbih3esh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nffIY7ky--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tw11ebbnug51nbih3esh.png" alt="Image4" width="880" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The following command selects all the files in the current directory(&lt;strong&gt;"." : current directory, -type f : selects only file&lt;/strong&gt;) and executes(&lt;strong&gt;-exec&lt;/strong&gt;) the remove file command(&lt;strong&gt;rm -f&lt;/strong&gt;). &lt;strong&gt;{}&lt;/strong&gt; at first holds the first file &lt;strong&gt;file.txt&lt;/strong&gt; then &lt;strong&gt;+&lt;/strong&gt; selects the next file &lt;strong&gt;names.txt&lt;/strong&gt; as &lt;strong&gt;+&lt;/strong&gt; is mentioned and so on.. and for each file the command will be executed&lt;br&gt;
&lt;code&gt;find . -type f -exec rm -f {} +&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. top
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;top&lt;/strong&gt; command displays all the processes that are running along with their &lt;strong&gt;PID&lt;/strong&gt;,&lt;strong&gt;CPU usage&lt;/strong&gt;,&lt;strong&gt;Time&lt;/strong&gt;,&lt;strong&gt;Memory&lt;/strong&gt;,&lt;strong&gt;Port Number&lt;/strong&gt; etc..&lt;br&gt;
The &lt;code&gt;kill (PID)&lt;/code&gt; command can be used to kill a process, as the top command provides the PID of a process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output :&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dTjqI6rG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8l6z22cnlkmj8v05qc6p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dTjqI6rG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8l6z22cnlkmj8v05qc6p.png" alt="Image5" width="880" height="676"&gt;&lt;/a&gt;&lt;/p&gt;

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