<?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: Kenneth Mahon</title>
    <description>The latest articles on DEV Community by Kenneth Mahon (@kennethstack).</description>
    <link>https://dev.to/kennethstack</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%2F703466%2F1445bde9-6c10-47fa-99ca-101ff2dbe8eb.png</url>
      <title>DEV Community: Kenneth Mahon</title>
      <link>https://dev.to/kennethstack</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kennethstack"/>
    <language>en</language>
    <item>
      <title>Automating User Creation and Management with a Bash Script</title>
      <dc:creator>Kenneth Mahon</dc:creator>
      <pubDate>Mon, 01 Jul 2024 12:51:36 +0000</pubDate>
      <link>https://dev.to/kennethstack/automating-user-creation-and-management-with-a-bash-script-58il</link>
      <guid>https://dev.to/kennethstack/automating-user-creation-and-management-with-a-bash-script-58il</guid>
      <description>&lt;p&gt;In this article, we'll walk through a bash script that reads user information from a text file, creates users and their groups, sets up home directories, generates random passwords, logs actions, and stores passwords securely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bash Script: create_users.sh&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;#!/bin/bash

# Define file paths
LOG_FILE="/var/log/user_management.log"
PASSWORD_FILE="/var/secure/user_passwords.txt"
INPUT_FILE=$1

# Ensure secure directory for passwords
mkdir -p /var/secure
chmod 700 /var/secure

# Function to generate random password
generate_password() {
    tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 12
}

# Ensure log file exists
touch $LOG_FILE
chmod 644 $LOG_FILE

# Ensure password file exists
touch $PASSWORD_FILE
chmod 600 $PASSWORD_FILE

# Read input file
if [[ ! -f "$INPUT_FILE" ]]; then
    echo "Input file not found!" | tee -a $LOG_FILE
    exit 1
fi

# Process each line in the input file
while IFS=";" read -r username groups; do
    # Trim whitespaces
    username=$(echo $username | xargs)
    groups=$(echo $groups | xargs)

    # Check if user already exists
    if id -u "$username" &amp;gt;/dev/null 2&amp;gt;&amp;amp;1; then
        echo "User $username already exists. Skipping." | tee -a $LOG_FILE
        continue
    fi

    # Create personal group for the user
    groupadd "$username"

    # Create user with personal group
    useradd -m -g "$username" "$username"
    if [[ $? -ne 0 ]]; then
        echo "Failed to create user $username." | tee -a $LOG_FILE
        continue
    fi

    # Create additional groups and add user to them
    IFS=',' read -ra ADDR &amp;lt;&amp;lt;&amp;lt; "$groups"
    for group in "${ADDR[@]}"; do
        group=$(echo $group | xargs)
        if ! getent group "$group" &amp;gt;/dev/null; then
            groupadd "$group"
        fi
        usermod -aG "$group" "$username"
    done

    # Generate random password and set it
    password=$(generate_password)
    echo "$username:$password" | chpasswd

    # Log user creation
    echo "Created user $username with groups $groups." | tee -a $LOG_FILE
    echo "$username,$password" &amp;gt;&amp;gt; $PASSWORD_FILE
done &amp;lt; "$INPUT_FILE"

echo "User creation process completed." | tee -a $LOG_FILE

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When working as a SysOps engineer, managing user accounts and groups is a routine but crucial task. Automating this process not only saves time but also reduces the potential for errors.&lt;/p&gt;

&lt;p&gt;Features:&lt;br&gt;
1.&lt;strong&gt;&lt;em&gt;Input File Processing&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
: The script takes a text file where each line contains a username and a list of groups, separated by a semicolon (;). Example:&lt;/p&gt;

&lt;p&gt;light;sudo,dev,www-data&lt;br&gt;
idimma;sudo&lt;br&gt;
mayowa;dev,www-data&lt;/p&gt;

&lt;p&gt;2.&lt;strong&gt;&lt;em&gt;User and Group Creation&lt;/em&gt;&lt;/strong&gt;: For each user, the script creates a personal group with the same name as the username and adds the user to the specified groups.&lt;/p&gt;

&lt;p&gt;3.&lt;strong&gt;&lt;em&gt;Home Directory Setup&lt;/em&gt;&lt;/strong&gt;: Home directories are created automatically with appropriate permissions.&lt;/p&gt;

&lt;p&gt;4.&lt;strong&gt;&lt;em&gt;Random Password Generation&lt;/em&gt;&lt;/strong&gt;: A secure random password is generated for each user.&lt;/p&gt;

&lt;p&gt;5.&lt;strong&gt;&lt;em&gt;Logging Actions&lt;/em&gt;&lt;/strong&gt;: All actions performed by the script are logged to &lt;code&gt;/var/log/user_management.log&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;6.&lt;strong&gt;&lt;em&gt;Secure Password Storage&lt;/em&gt;&lt;/strong&gt;: Usernames and passwords are stored in &lt;code&gt;/var/secure/user_passwords.txt&lt;/code&gt; with restricted access permissions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Script Breakdown:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.&lt;strong&gt;&lt;em&gt;File Paths and Secure Directory Setup:&lt;/em&gt;&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;LOG_FILE="/var/log/user_management.log"
PASSWORD_FILE="/var/secure/user_passwords.txt"
INPUT_FILE=$1
mkdir -p /var/secure
chmod 700 /var/secure

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.&lt;strong&gt;&lt;em&gt;Random Password Generation Function&lt;/em&gt;:&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;generate_password() {
    tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 12
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.&lt;strong&gt;_Log and Password File Initialization:&lt;br&gt;
_&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;touch $LOG_FILE
chmod 644 $LOG_FILE
touch $PASSWORD_FILE
chmod 600 $PASSWORD_FILE

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.&lt;strong&gt;&lt;em&gt;Processing the Input File&lt;/em&gt;&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;if [[ ! -f "$INPUT_FILE" ]]; then
    echo "Input file not found!" | tee -a $LOG_FILE
    exit 1
fi

while IFS=";" read -r username groups; do
    username=$(echo $username | xargs)
    groups=$(echo $groups | xargs)

    if id -u "$username" &amp;gt;/dev/null 2&amp;gt;&amp;amp;1; then
        echo "User $username already exists. Skipping." | tee -a $LOG_FILE
        continue
    fi

    groupadd "$username"

    useradd -m -g "$username" "$username"
    if [[ $? -ne 0 ]]; then
        echo "Failed to create user $username." | tee -a $LOG_FILE
        continue
    fi

    IFS=',' read -ra ADDR &amp;lt;&amp;lt;&amp;lt; "$groups"
    for group in "${ADDR[@]}"; do
        group=$(echo $group | xargs)
        if ! getent group "$group" &amp;gt;/dev/null; then
            groupadd "$group"
        fi
        usermod -aG "$group" "$username"
    done

    password=$(generate_password)
    echo "$username:$password" | chpasswd

    echo "Created user $username with groups $groups." | tee -a $LOG_FILE
    echo "$username,$password" &amp;gt;&amp;gt; $PASSWORD_FILE
done &amp;lt; "$INPUT_FILE"

echo "User creation process completed." | tee -a $LOG_FILE

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script ensures efficient user management and enhances security through automated processes. For more insights, explore further learning opportunities, check out the &lt;a href="https://hng.tech/internship"&gt;HNG Internship&lt;/a&gt; and &lt;a href="https://hng.tech/premium"&gt;HNG Premium&lt;/a&gt; website. You won't regret it&lt;/p&gt;

</description>
    </item>
    <item>
      <title>CONCLUSION ON BASH SCRIPTING</title>
      <dc:creator>Kenneth Mahon</dc:creator>
      <pubDate>Tue, 11 Jul 2023 08:10:36 +0000</pubDate>
      <link>https://dev.to/kennethstack/conclusion-on-bash-scripting-46h8</link>
      <guid>https://dev.to/kennethstack/conclusion-on-bash-scripting-46h8</guid>
      <description>&lt;p&gt;Good day Everyone; i'm so sorry i haven't been consistent updating us on my journey so far; work have really been demanding this days and taking alot of time but notwithstanding, my journey is not fading away.&lt;br&gt;
i won't be consistent in posting due to work but the 120 days of Learning devOps still intact; surely going to achieve it.&lt;/p&gt;

&lt;p&gt;to round up bash scripting before moving to python, i will be rounding up by sharing some scripting; interpret it and run it to see the result. i will also sharing a resources that covers all we have discussed about in my previous post on bash scripting&lt;br&gt;
LET GOOOOOO!!!!!!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;script 1&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;#!/bin/bash


read -p "Enter file name: " file_name
read -p "Enter search term: " search_term

if [ ! -f $file_name ]; then
    echo "File not found"
    exit 1
fi

while read line
do
    if [[ $line == *"$search_term"* ]]; then

        new_line=${line//$search_term/new_value}
        echo $new_line
    else
        echo $line
    fi
done &amp;lt; $file_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;script 2&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;for file in *.txt; do
  mv "$file" "${file%.txt}.doc"
done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Script 3&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;while ps -p 1234 &amp;gt;/dev/null; do
    sleep 1
done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is all. play with it and share your interpretation and output in the comment section. Day 15 loading.......&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RESOURCES:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=e7BufAVwDiM"&gt;Bash scripting for beginners&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>cloudcomputing</category>
      <category>devops</category>
      <category>120daysofdevops</category>
    </item>
    <item>
      <title>Continuation to Bash scripting: Introduction to Conditional statement and Loop</title>
      <dc:creator>Kenneth Mahon</dc:creator>
      <pubDate>Tue, 04 Jul 2023 10:58:56 +0000</pubDate>
      <link>https://dev.to/kennethstack/continuation-to-bash-scripting-introduction-to-conditional-statement-and-loop-4094</link>
      <guid>https://dev.to/kennethstack/continuation-to-bash-scripting-introduction-to-conditional-statement-and-loop-4094</guid>
      <description>&lt;p&gt;Good Day everyone!!! still on this journey of becoming a DevOps engineer, we will be looking more into loops as discussed in day 12.&lt;br&gt;
LET'S GOOOOO&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For loop&lt;/strong&gt;&lt;br&gt;
The for loop, allows you to execute statements a specific number of times. &lt;br&gt;
For Example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34lbpza1qlvisxcz9kye.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34lbpza1qlvisxcz9kye.png" alt="Input" width="800" height="126"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the example above, the loop will iterate 5 times.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2uri1km8gojl02djjfn0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2uri1km8gojl02djjfn0.png" alt="Output" width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let take a look at another real world example&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9emdcbxd8ldjf3decclw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9emdcbxd8ldjf3decclw.png" alt="Input" width="800" height="143"&gt;&lt;/a&gt;&lt;br&gt;
In this example, the for loop iterates over all files with the .txt extension, renames each file by changing its extension to .doc&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxl5vs9jhowqkgbsf9mst.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxl5vs9jhowqkgbsf9mst.png" alt="Output" width="800" height="276"&gt;&lt;/a&gt;&lt;br&gt;
If you notice, you will find out that all the ".txt" changed ".doc"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;While loop&lt;/strong&gt;&lt;br&gt;
While loops check for a condition and loop until the condition remains true. We need to provide a counter statement that increments the counter to control loop execution.&lt;br&gt;
For Example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft08rkgsohl1tz8wab1gi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft08rkgsohl1tz8wab1gi.png" alt="Input" width="800" height="161"&gt;&lt;/a&gt;&lt;br&gt;
In the example above, (( i += 1 )) is the counter statement that increments the value of i. The loop will run exactly 10 times.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn8g53duetju7t53mtzrs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn8g53duetju7t53mtzrs.png" alt="Output" width="800" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using the for loop for Nested Loops&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The for loop is one of the most commonly used loops in bash scripting, and it’s also an effective tool for creating nested loops. In a nested for loop, the outer loop controls the iteration over the first set of data, while the inner loop iterates over a second set of data for each value in the outer loop.&lt;/p&gt;

&lt;p&gt;Here’s an example of a nested for loop in bash scripting&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwnfpsjd3alye32mmtlpe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwnfpsjd3alye32mmtlpe.png" alt="Input" width="800" height="259"&gt;&lt;/a&gt;&lt;br&gt;
In this script, the outer loop iterates over the values 1, 2 and 3 while the inner loop iterates over the values a, b and c for each value of i in the outer loop. The echo statement prints out each combination of the two values.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faxymgpq10rp189uns1z2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faxymgpq10rp189uns1z2.png" alt="Output" width="800" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using the while loop for Nested Loops&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In bash scripting, the while loop is another powerful tool for creating nested loops. While for loops are useful for iterating over a fixed set of data, while loops are ideal for iterating until a specific condition is met. When used in a nested loop, the while loop can help to automate complex data processing tasks that involve iterative calculations or manipulations.&lt;br&gt;
Here’s an example of a nested for loop in bash scripting:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxwhxtxuizqj7zrko7hde.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxwhxtxuizqj7zrko7hde.png" alt="Input" width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this script, the outer loop starts with a value of 1 and increments by 1 until it reaches 3. For each value of outer, the inner loop starts with a value of 1 and increments by 1 until it also reaches 3. The echo statement prints out each combination of the two values.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqnxdy5ej6nv4vij6bd7j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqnxdy5ej6nv4vij6bd7j.png" alt="Output" width="800" height="251"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;bash Scripting is very interesting and very deep.&lt;br&gt;
Thanks for moving with me on this journey. Day 14 loading soon &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>cloudcomputing</category>
      <category>120daysofdevops</category>
    </item>
    <item>
      <title>Continuation to Bash scripting: Introduction to Conditional statement and Loop</title>
      <dc:creator>Kenneth Mahon</dc:creator>
      <pubDate>Sat, 01 Jul 2023 20:22:01 +0000</pubDate>
      <link>https://dev.to/kennethstack/continuation-to-bash-scripting-introduction-to-conditional-statement-and-loop-4kc4</link>
      <guid>https://dev.to/kennethstack/continuation-to-bash-scripting-introduction-to-conditional-statement-and-loop-4kc4</guid>
      <description>&lt;p&gt;Good Day everyone!! since yesterday have been a little busy/sad day but all the same we stay focus. &lt;br&gt;
still on the if statement, i added a little flavor to the last question we treated in day 11. so glad to explore things as a beginning; we learn more when we explore. LETS GOOOOOO&lt;/p&gt;

&lt;p&gt;Q. Write a Bash Script that checks the current date, day and time of the day and print a corresponding greeting message&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8qss5ww5jpcgmbbkh988.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8qss5ww5jpcgmbbkh988.png" alt="Solution to the Question" width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4dceauqbwqoc5oh4z2jn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4dceauqbwqoc5oh4z2jn.png" alt="Output" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;checking the output, you can see how many time i tried before getting the right script and writing it in a better way. don't be scared to try &lt;/p&gt;

&lt;p&gt;Today we won't be doing much practical just some read and tomorrow might be off day or we might use it to get hands dirty on all the "loops" we will be looking into today&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case statements&lt;/strong&gt;&lt;br&gt;
In Bash, case statements are used to compare a given value against a list of patterns and execute a block of code based on the first pattern that matches. The syntax for a case statement in Bash is as follows:&lt;/p&gt;

&lt;p&gt;Case statements syntax&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;case expression in
    pattern1)
        # code to execute if expression matches pattern1
        ;;
    pattern2)
        # code to execute if expression matches pattern2
        ;;
    pattern3)
        # code to execute if expression matches pattern3
        ;;
    *)
        # code to execute if none of the above patterns match expression
        ;;
esac
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, "expression" is the value that we want to compare, and "pattern1", "pattern2", "pattern3", and so on are the patterns that we want to compare it against.&lt;/p&gt;

&lt;p&gt;The double semicolon ";;" separates each block of code to execute for each pattern. The asterisk "*" represents the default case, which executes if none of the specified patterns match the expression. &lt;br&gt;
Let's experiment a script using case statement &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtdfkpp8cgroduganeho.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtdfkpp8cgroduganeho.png" alt="Input" width="800" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this example, since the value of "fruit" is "apple", the first pattern matches, and the block of code that echoes "This is a Green fruit." is executed. If the value of "fruit" were instead "banana", the second pattern would match and the block of code that echoes "This is a yellow fruit." would execute. If the value of "fruit" were instead "Orange", the third pattern would match and the block of code that echoes "This is a Orange fruit . If the value of "fruit" does not match any of the specified patterns, the default case is executed, which echoes "Unknown fruit."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15mshz5i0ol7y38ofcea.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15mshz5i0ol7y38ofcea.png" alt="Output" width="800" height="183"&gt;&lt;/a&gt;&lt;br&gt;
That easy!!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For loop&lt;/strong&gt;&lt;br&gt;
A for loop is used when you want to repeat a set of commands for a predefined number of times. The syntax of a for loop is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for variable in list
do
   command1
   command2
   ...
   commandN
done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this loop, the variable takes on each value in the list, and the commands inside the loop are executed for each value of the variable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;While loop&lt;/strong&gt;&lt;br&gt;
A while loop, on the other hand, is used when you want to repeat a set of commands until a specific condition is met. The syntax of a while loop is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while [ condition ]
do
   command1
   command2
   ...
   commandN
done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this loop, the commands inside the loop are executed repeatedly as long as the condition is true.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Until loop&lt;/strong&gt;&lt;br&gt;
Finally, an until loop is similar to a while loop, but it executes commands until the condition becomes true, instead of executing them while the condition is true. The syntax of an until loop is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;until [ condition ]
do
   command1
   command2
   ...
   commandN
done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this loop, the commands inside the loop are executed repeatedly until the condition becomes true.&lt;/p&gt;

&lt;p&gt;Stopping here today. watch out for day 13&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>cloudcomputing</category>
      <category>120daysofdevops</category>
    </item>
    <item>
      <title>Continuation to Bash scripting: Introduction to Conditional statement and Loop</title>
      <dc:creator>Kenneth Mahon</dc:creator>
      <pubDate>Fri, 30 Jun 2023 08:25:15 +0000</pubDate>
      <link>https://dev.to/kennethstack/continuation-to-bash-scripting-introduction-to-conditional-statement-and-loop-18nh</link>
      <guid>https://dev.to/kennethstack/continuation-to-bash-scripting-introduction-to-conditional-statement-and-loop-18nh</guid>
      <description>&lt;p&gt;surprise we are still on bash scripting? don't be surprise. bash scripting is wide and there are more to it. let's dive into conditional statement and loop&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;why is conditional statement and loop important?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Loops are useful in Bash scripts for automating repetitive tasks and streamlining workflows. For instance, a for loop can be used to rename multiple files at once, while a while loop can be used to monitor the status of a process and continue to monitor it until it has completed. An until loop can be used to repeatedly execute a task until a specific condition is met, such as establishing an Internet connection.&lt;/p&gt;

&lt;p&gt;Conditional statements can also be used with loops to add more control to Bash scripts. For example, a for loop can be used to iterate over a list of files and check if each file contains a specific text string. If the string is found, the script can perform a task on the file. By automating tasks with loops, developers can save time, improve efficiency, and reduce the likelihood of errors.&lt;/p&gt;

&lt;p&gt;i focused on condition statement for my Day 11, which i will be sharing right away.&lt;/p&gt;

&lt;p&gt;Conditional statements provide a way to add more control to Bash scripts and loops, enabling them to perform different actions based on specific conditions. Here’s how to use conditional statements with loops in Bash scripts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;If statements:&lt;/strong&gt; If statements are used to execute a command or a set of commands when a condition is true. You can use an if statement inside a loop to test a condition for each iteration of the loop. For example, you can use an if statement to check if a file exists and perform an action based on the result.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Case statements:&lt;/strong&gt; Case statements are used to test a variable against a list of possible values and execute a command or a set of commands based on the matching value. You can use a case statement inside a loop to perform different actions based on the value of a variable. For example, you can use a case statement to perform different actions based on the file type.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;While statements:&lt;/strong&gt; While statements provide a way to continue executing a loop while a condition is true. You can use a while statement inside a loop to test a condition and continue or break the loop based on the result. For example, you can use a while statement to continue reading a file until the end of the file is reached.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;For statements:&lt;/strong&gt; For statements provide a way to execute a loop for a specific number of times or for each item in a list. You can use a for statement inside a loop to perform different actions based on the iteration of the loop. For example, you can use a for statement to iterate over a list of files and perform an action for each file.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Conditional statements (if/else)&lt;/strong&gt;&lt;br&gt;
Expressions that produce a boolean result, either true or false, are called conditions. There are several ways to evaluate conditions, including if, if-else, if-elif-else, and nested conditionals.&lt;/p&gt;

&lt;p&gt;Syntax:&lt;/p&gt;

&lt;p&gt;if [[ condition ]];&lt;br&gt;
then&lt;br&gt;
    statement&lt;br&gt;
elif [[ condition ]]; then&lt;br&gt;
    statement &lt;br&gt;
else&lt;br&gt;
    do this by default&lt;br&gt;
fi&lt;/p&gt;

&lt;p&gt;Let's see an example of a Bash script that uses if, if-else, and if-elif-else statements to determine if a user-inputted number is positive, negative, or zero&lt;/p&gt;

&lt;p&gt;from the question above, we will be writing a script that will indicate if a number inputted by a user is positive, negative or zero. LET'S GOOOOOO&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pzv41ddtgvctjcdwndq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pzv41ddtgvctjcdwndq.png" alt="Solution to the Question" width="800" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;REMEMBER:&lt;br&gt;
-lt stands for less than&lt;br&gt;
-gt stands for greater than&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg8bd2jut1qpxy8ey7for.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg8bd2jut1qpxy8ey7for.png" alt="Output" width="800" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;very Easy right? let's solve some more questions&lt;/p&gt;

&lt;p&gt;Q. write a script that checks the sum of 2 numbers and that number must be validated else throw a suggestion or error&lt;br&gt;
Let's try this together&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fojja1ivfcwn02tqzxky7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fojja1ivfcwn02tqzxky7.png" alt="Solution to the Question" width="456" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;REMEMBER:&lt;br&gt;
-eq stands for equal to&lt;br&gt;
$# represent the number of command line argument passed to the script&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F16x8ayif6i3pm63321yl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F16x8ayif6i3pm63321yl.png" alt="Output" width="800" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;interesting!!!!!&lt;/p&gt;

&lt;p&gt;We can use logical operators such as AND -a and OR -o to make comparisons that have more significance.&lt;br&gt;
For Example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo "Enter a number"&lt;br&gt;
read num&lt;br&gt;
if [ $a -gt 30 -a $b -lt 60 ]; then&lt;br&gt;
echo "The value is Valid"&lt;br&gt;
else&lt;br&gt;
echo "ERROR: Input a number in the range 30 to 59"&lt;br&gt;
fi&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
run this and share your output in the comment section&lt;/p&gt;

&lt;p&gt;Q. Write a Bash Script that checks the time of the day and print a corresponding greeting message&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxqkqyc8d0tx587v3bk1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxqkqyc8d0tx587v3bk1.png" alt="Solution to the Question" width="800" height="257"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1uh8vlf7q3bxmugx7n4s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1uh8vlf7q3bxmugx7n4s.png" alt="Output" width="800" height="298"&gt;&lt;/a&gt;&lt;br&gt;
Did you notice the errors in the first two output of the script? it shows error is normal. it opens our mind to thinking wide in other to get a solution.&lt;br&gt;
Also did you Notice the changes in the last two output of the command, it shows the command was run in two different time and i added seconds to the script which made the last output show 9:19:16. do that yourself (winks)&lt;/p&gt;

&lt;p&gt;that is all for day 11..Day 12 loading.....&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>cloudcomputing</category>
      <category>120daysofdevops</category>
    </item>
    <item>
      <title>Continuation to Shell Scripting</title>
      <dc:creator>Kenneth Mahon</dc:creator>
      <pubDate>Wed, 28 Jun 2023 23:18:27 +0000</pubDate>
      <link>https://dev.to/kennethstack/continuation-to-shell-scripting-21mf</link>
      <guid>https://dev.to/kennethstack/continuation-to-shell-scripting-21mf</guid>
      <description>&lt;p&gt;&lt;strong&gt;Basic Bash commands (echo, read, etc.)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here is a list of some of the most commonly used bash commands:&lt;/p&gt;

&lt;p&gt;cd: Change the directory to a different location.&lt;br&gt;
ls: List the contents of the current directory.&lt;br&gt;
mkdir: Create a new directory.&lt;br&gt;
touch: Create a new file.&lt;br&gt;
rm: Remove a file or directory.&lt;br&gt;
cp: Copy a file or directory.&lt;br&gt;
mv: Move or rename a file or directory.&lt;br&gt;
echo: Print text to the terminal.&lt;br&gt;
cat: Concatenate and print the contents of a file.&lt;br&gt;
grep: Search for a pattern in a file.&lt;br&gt;
chmod: Change the permissions of a file or directory.&lt;br&gt;
sudo: Run a command with administrative privileges.&lt;br&gt;
df: Display the amount of disk space available.&lt;br&gt;
history: Show a list of previously executed commands.&lt;br&gt;
ps: Display information about running processes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reading user input&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;We can read the user input using the read command.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;read -p* where the p stands for prompt&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faijypakn9wr6wd68ikwj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faijypakn9wr6wd68ikwj.png" alt="reading user input" width="800" height="121"&gt;&lt;/a&gt;&lt;br&gt;
when you run this command on the terminal, it gives the user the option to input his name into it before it echo the last command given to it.&lt;br&gt;
 we will have something like this below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frun40bnt9nly62ww0g72.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frun40bnt9nly62ww0g72.png" alt="Output" width="800" height="122"&gt;&lt;/a&gt;&lt;br&gt;
amazing right? let's try out some more commands "using the reading user input"&lt;br&gt;
let's add more options to where users can input more details.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw78yxxtnjzcp4l3ll0kd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw78yxxtnjzcp4l3ll0kd.png" alt="Input" width="800" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiudzjg124pqnukrfsc0a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiudzjg124pqnukrfsc0a.png" alt="Output" width="800" height="160"&gt;&lt;/a&gt;&lt;br&gt;
you can play with more examples.&lt;/p&gt;

&lt;p&gt;i Tired something different, lets assume you work in an organization, and you are ask to write a script that will ask for a user name and also create a directory for the user, how do you go about it? here it is:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn03t38pufs63kiz0pfer.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn03t38pufs63kiz0pfer.png" alt="Input" width="800" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmkhvd6h2gbu7ei5z66t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmkhvd6h2gbu7ei5z66t.png" alt="Output" width="800" height="165"&gt;&lt;/a&gt;&lt;br&gt;
just follow the prompt "ls" to check the folder/directory created.&lt;/p&gt;

&lt;p&gt;easy and interesting right? &lt;br&gt;
now let create files in that same directory/folders created for the users. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiq7um6qi7jos2i5j5k7i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiq7um6qi7jos2i5j5k7i.png" alt="Input" width="800" height="210"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fysbk7rthj4x2ogc35iyt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fysbk7rthj4x2ogc35iyt.png" alt="Output" width="800" height="220"&gt;&lt;/a&gt;&lt;br&gt;
That is how to create a directory and a file to a user using the name provided.&lt;/p&gt;

&lt;p&gt;thanks guys for following through; Day 11 loading very soon&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>cloudcomputing</category>
      <category>120daysofdevops</category>
    </item>
    <item>
      <title>Continuation to Shell Scripting: Variables and Their Scope (Day 9)</title>
      <dc:creator>Kenneth Mahon</dc:creator>
      <pubDate>Mon, 26 Jun 2023 22:38:43 +0000</pubDate>
      <link>https://dev.to/kennethstack/continuation-to-shell-scripting-variables-and-their-scope-day-9-4pip</link>
      <guid>https://dev.to/kennethstack/continuation-to-shell-scripting-variables-and-their-scope-day-9-4pip</guid>
      <description>&lt;p&gt;Bash variables provide temporary storage for information. You can use them to store words/phrases (strings), decimals or integers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Variables&lt;/strong&gt;&lt;br&gt;
To assign a variable, we use the = symbol&lt;br&gt;
&lt;strong&gt;NOTE:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When you assign a value to a variable, there should not be any spaces on either side of the = symbol.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When we want to access a variable, we need to use the $ symbol to reference it&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;name="Kenneth"&lt;br&gt;
echo $name&lt;/p&gt;

&lt;p&gt;let's add variables to bash script&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwqh6hk47o8lhhentqzyq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwqh6hk47o8lhhentqzyq.png" alt="variables added to our bash script" width="800" height="141"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7b3xc02hhley8s1ybcbk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7b3xc02hhley8s1ybcbk.png" alt="Result of the added variables" width="800" height="122"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Because our variables may contain whitespace which gets interpreted by bash, it’s good practice to wrap the variable name in curly brackets and encase it in double quotes just like the way we represented it in our diagram above&lt;/p&gt;

&lt;p&gt;In Bash, if you try to access a variable that doesn’t exist, you won’t see an error, just a blank value. For Example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tnvunl6f55cvr7zxd5f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tnvunl6f55cvr7zxd5f.png" alt="variables" width="800" height="121"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fidkppulb7yko00ytz4kb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fidkppulb7yko00ytz4kb.png" alt="Result" width="800" height="141"&gt;&lt;/a&gt;&lt;br&gt;
You can see variable 1 value was left blank because the variable was not declared&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Variable scope&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are two types of variable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Local variables&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Global variables&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Local variables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Local variables are only accessible within the section of code in which they are declared. For example, if we declare a variable inside our Bash script, it will not be accessible outside of that script. using the example we used before, let try to call "var2" outside of the script, directly in our terminal&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrjegszwu02h79z3e9io.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrjegszwu02h79z3e9io.png" alt="Result" width="800" height="121"&gt;&lt;/a&gt;&lt;br&gt;
you can see after calling var2 directly on the terminal, it gave us a blank result and this is due to the fact that the scope of our variable was constrained to the script itself and its value is not accessible outside of that script.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Global variables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can create your own global variables by using the export command. First let’s declare a variable directly on our Terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptenp4rqlu52wp5inzmc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptenp4rqlu52wp5inzmc.png" alt="Result" width="800" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, let’s create a script that tries to access this variable:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7o9bdfca54q2baxrfuyo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7o9bdfca54q2baxrfuyo.png" alt="Output" width="800" height="150"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we run this script, our result will be blank. variable we created was only a local variable and therefore not accessible within our script.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzs7mr02dzpgtx2mdocv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzs7mr02dzpgtx2mdocv.png" alt="Output" width="800" height="122"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, if we use the export command, we can declare MY_NAME as a global variable which is accessible in our script and when we run it, we will have the value assigned to it .&lt;br&gt;
Here we go:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft5igaw6h0infzyh3omxr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft5igaw6h0infzyh3omxr.png" alt="Result" width="800" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is it for Day 9. time to practices more on this. see you all tomorrow for Day 10&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>cloud</category>
      <category>120daysofdevops</category>
    </item>
    <item>
      <title>Introduction to Shell Scripting (Day 8)</title>
      <dc:creator>Kenneth Mahon</dc:creator>
      <pubDate>Fri, 23 Jun 2023 22:22:03 +0000</pubDate>
      <link>https://dev.to/kennethstack/introduction-to-shell-scripting-day-8-2bm5</link>
      <guid>https://dev.to/kennethstack/introduction-to-shell-scripting-day-8-2bm5</guid>
      <description>&lt;p&gt;Still on this journey of becoming a DevOps Engineer in 120Days, i  bring to you my Day 8 learning process. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;what is shell scripting?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shell scripting refers to writing scripts or programs in a shell language, such as Bash (Bourne Again SHell) on Linux or Unix-based systems. Shell scripting allows you to automate and execute a series of commands, perform complex tasks, and create scripts to streamline repetitive tasks.&lt;/p&gt;

&lt;p&gt;Shell scripts are plain text files containing a sequence of commands and instructions that are interpreted by the shell. They can include control structures (such as loops and conditionals), variables, functions, and more, providing powerful capabilities for scripting and automation. Shell programming can be accomplished by directly executing shell commands at the shell prompt or by storing them in the order of execution, in a text file, called a shell script, and then executing the shell script. To execute, simply write the shell script file name, once the file has execute permission (chmod +x filename).&lt;br&gt;
shell and bash terms are often used interchangeable. Bash is a shell programing language in which we can write shell command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use cases of Shell Scripting&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some common use cases for shell scripting include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Automation: Shell scripts are often used to automate repetitive tasks or complex workflows, such as system administration tasks, backups, log analysis, and software deployments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;System Configuration: Shell scripts can be used to configure and customize the settings of a system or application. For example, you can write a shell script to set up environment variables, install software packages, or modify system configurations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Processing: Shell scripts can process and manipulate data, such as parsing log files, extracting information from text files, performing calculations, or generating reports.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Task Sequencing: Shell scripts can be used to define the order and dependencies of multiple commands or scripts, allowing you to create more sophisticated workflows.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Shell scripting provides a flexible and efficient way to automate tasks and create custom solutions in a command-line environment. It leverages the power of the shell and its built-in utilities to accomplish various tasks, making it a fundamental skill for Linux and Unix system administrators, developers, and power users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Different shell implementation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first line of the shell script file begins with a "sha-bang" (#!).&lt;/p&gt;

&lt;h1&gt;
  
  
  : in musical notation called "sharp"
&lt;/h1&gt;

&lt;p&gt;!: also called "bang"&lt;/p&gt;

&lt;p&gt;#! is not read as a comment, followed by the full path where the shell interpreter is located. This path, tells the operating system that this file is a set of commands to be fed into the interpreter indicated.  The first line may look like this:&lt;/p&gt;

&lt;h1&gt;
  
  
  !/bin/bash
&lt;/h1&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;h1&gt;
  
  
  !/usr/bin/bash
&lt;/h1&gt;

&lt;p&gt;depends on your path&lt;/p&gt;

&lt;p&gt;Adding comments: any text following the "#" is considered a comment&lt;/p&gt;

&lt;p&gt;To find out what is currently active shell, and what is its path, type the below command&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ps | grep $$&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fffwc0ligca159kb2ci4z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fffwc0ligca159kb2ci4z.png" alt="Response" width="800" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This response shows that the shell you are using is of type 'bash'.&lt;/p&gt;

&lt;p&gt;next find out the full path of the shell interpreter&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;which bash&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1juq0s2bieinl9m2h2dq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1juq0s2bieinl9m2h2dq.png" alt="output" width="800" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This response shows the full execution path of the shell interpreter. Make sure that the "sha-bang" line at the beginning of your script, matches this same execution path.&lt;/p&gt;

&lt;p&gt;All shell files have the same .sh file extention&lt;br&gt;
&lt;strong&gt;Take Note&lt;/strong&gt;&lt;br&gt;
file.sh ==== shell script&lt;br&gt;
file.py ==== python&lt;br&gt;
file.js ==== javascript&lt;br&gt;
we will be using our text editor a lot here. remember the "vim editor and Echo command" we spoke about when dealing with Linus commands, we will making use of it a lot&lt;/p&gt;

&lt;p&gt;let me share the little practices i did today&lt;/p&gt;

&lt;p&gt;firstly, use the vim editor to create a file&lt;br&gt;
"vim class.sh"&lt;br&gt;
Now let print "Hello World" using the vim editor and echo command&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdm8993qs46r8337k5kr2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdm8993qs46r8337k5kr2.png" width="800" height="124"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;./name of file is use to execute script&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftifq3gjlotxlsxkl647j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftifq3gjlotxlsxkl647j.png" alt="output" width="800" height="139"&gt;&lt;/a&gt;&lt;br&gt;
 if you notice, i got a bash error that says "ACESS DENIED". this is because newly created files don't have the ability to be executed. so what do we do? we will give user access to be able to execute the file  by using the "sudo chmod" we learnt days ago. now process to execute the script.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdxfwjprw3abzycw3v9q4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdxfwjprw3abzycw3v9q4.png" alt="Output" width="800" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yes we have "Hello world" printed. simple right???&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1yhmz8x6x9ra2jfw4tzq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1yhmz8x6x9ra2jfw4tzq.png" alt="Input" width="800" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo2urr79coy4k926iowbd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo2urr79coy4k926iowbd.png" alt="output" width="800" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Day 9 loading .....&lt;/p&gt;

&lt;p&gt;Resources:&lt;br&gt;
&lt;a href="https://www.learnshell.org/en/Hello,_World!"&gt;basic shell scripting&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=cQepf9fY6cE&amp;amp;list=PLS1QulWo1RIYmaxcEqw5JhK3b-6rgdWO_"&gt;shell scripting tutorial&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>cloud</category>
      <category>120daysofdevops</category>
    </item>
    <item>
      <title>Practical Lab Questions on Linux(Day 7)</title>
      <dc:creator>Kenneth Mahon</dc:creator>
      <pubDate>Thu, 22 Jun 2023 05:10:04 +0000</pubDate>
      <link>https://dev.to/kennethstack/practical-lab-questions-on-linuxday-7-5a4p</link>
      <guid>https://dev.to/kennethstack/practical-lab-questions-on-linuxday-7-5a4p</guid>
      <description>&lt;p&gt;Hello guys!!! How did we find the Lab questions? interesting right?? we still have more to chechk out which i will be sharing but before i share it, i will like to share a link to a free course on linux where you will be given certificate on completing the course. Here is mine below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx2mx975wlaqm83h0af0r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx2mx975wlaqm83h0af0r.png" alt="free course on linux" width="800" height="548"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;link:&lt;/strong&gt; &lt;a href="https://olympus.mygreatlearning.com/courses/52823"&gt;free course on Linux&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;let's look at some practical questions i played with&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Practical Questions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Using the grep command, search for the word "error" in a file called "system.log".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using the pwd command, display the full path of your current working directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How would you rename a file called "old_name.txt" to "new_name.txt" using the mv command?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How would you create a new alias called "c" to be a shortcut for the clear command?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using the date command, display the current date and time on the terminal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How would you use the df command to display the available disk space on your computer?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using the whereis command, find the location of the executable file for the grep command.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using the history command, display a list of the commands you have previously executed in this session.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How would you switch to the root user using the sudo command?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using the uname command, display information about your system's kernel and operating system.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*&lt;em&gt;SECTION 2 LINUX FILE REDIRECTION &amp;amp; PERMISSIONS. &lt;br&gt;
*&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Can you explain how file permissions work in Linux?&lt;/li&gt;
&lt;li&gt;What is the difference between the "chmod" and "chown" commands in Linux?&lt;/li&gt;
&lt;li&gt;How can you use file permissions to enhance security on a multi-user system?&lt;/li&gt;
&lt;li&gt;What does the setuid permission do on an executable file?&lt;/li&gt;
&lt;li&gt;How do you recursively change file permissions for a directory and its contents?&lt;/li&gt;
&lt;li&gt;Can you explain what the numbers in octal notation represent when setting file permissions?&lt;/li&gt;
&lt;li&gt;How can you view the current file permissions for a file or directory in Linux?&lt;/li&gt;
&lt;li&gt;What is the difference between read, write, and execute permissions for files and directories?&lt;/li&gt;
&lt;li&gt;Can you explain how to revoke permissions for a user or group on a file or directory?&lt;/li&gt;
&lt;li&gt;What are some best practices around file permissions that you would recommend for managing Linux systems?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is all for Day 7...Day 8 loading&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>cloud</category>
      <category>120daysofdevops</category>
    </item>
    <item>
      <title>Practical lab Questions On Linux(Day 6)</title>
      <dc:creator>Kenneth Mahon</dc:creator>
      <pubDate>Tue, 20 Jun 2023 21:23:45 +0000</pubDate>
      <link>https://dev.to/kennethstack/practical-lab-questions-on-linuxday-6-5d91</link>
      <guid>https://dev.to/kennethstack/practical-lab-questions-on-linuxday-6-5d91</guid>
      <description>&lt;p&gt;It has been an interesting 5 days of learning devOps and you guys have been so wonderful with the Encouragement; Thanks guys!!!&lt;br&gt;
So i decided to test myself on all i have learnt so far by participating in a practical lab questions set by my Teammate and senior, motivator and mentor in Tech. He is also a member of this platform; His name is &lt;strong&gt;UWABOR COLLINS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;i will be sharing the questions as well, so you all can also play with with them. Enjoy guys!!&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    LAB QUESTIONS 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;How do you check the current working directory?&lt;/li&gt;
&lt;li&gt;How do you create a new directory?&lt;/li&gt;
&lt;li&gt;How do you navigate to a directory?&lt;/li&gt;
&lt;li&gt;How do you list all files and directories in a directory?&lt;/li&gt;
&lt;li&gt;How do you display the contents of a file?&lt;/li&gt;
&lt;li&gt;How do you create a new file?&lt;/li&gt;
&lt;li&gt;How do you rename a file?&lt;/li&gt;
&lt;li&gt;How do you delete a file?&lt;/li&gt;
&lt;li&gt;How do you copy a file to a new location?&lt;/li&gt;
&lt;li&gt;How do you move a file to a new location?&lt;/li&gt;
&lt;li&gt;How do you create a symbolic link to a file?&lt;/li&gt;
&lt;li&gt;How do you search for a file by name or content?&lt;/li&gt;
&lt;li&gt;How do you change the owner of a file?&lt;/li&gt;
&lt;li&gt;How do you change the permissions of a file?&lt;/li&gt;
&lt;li&gt;How do you create a new user account?&lt;/li&gt;
&lt;li&gt;How do you change the password for a user account?&lt;/li&gt;
&lt;li&gt;How do you switch to a different user account?&lt;/li&gt;
&lt;li&gt;How do you log out of a user account?&lt;/li&gt;
&lt;li&gt;How do you view the system's IP address?&lt;/li&gt;
&lt;li&gt;How do you view the details of network interfaces?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;PROJECT BASED QUESTIONS&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How would you use the ls command to display only the files in a directory (not directories)?&lt;/li&gt;
&lt;li&gt;Using the mkdir command, create a new directory called "my_folder" within your home directory.&lt;/li&gt;
&lt;li&gt;How would you move a file called "file1.txt" from your current directory to "my_folder"? Use the mv command.
4.How would you copy all files in a directory called "my_files" to a new directory called "backup_files"? Use the cp command.&lt;/li&gt;
&lt;li&gt;Using the rm command, delete a file called "old_file.txt" from your home directory.&lt;/li&gt;
&lt;li&gt;How would you create an empty file called "new_file.txt" in your current directory? Use the touch command.&lt;/li&gt;
&lt;li&gt;Using the echo command, write the message "Hello, world!" to a new file called "greeting.txt".&lt;/li&gt;
&lt;li&gt;How would you use the cat command to display the contents of a file called "notes.txt" on the terminal?&lt;/li&gt;
&lt;li&gt;How would you use the tail command to display the last 10 lines of a file called "log.txt"?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;okay guys; that is all for day 6. You can share your answers with me. Day 7 loading &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>cloud</category>
      <category>devops</category>
      <category>120daysofdevops</category>
    </item>
    <item>
      <title>Still on Exploring Linux Command(Day 5)</title>
      <dc:creator>Kenneth Mahon</dc:creator>
      <pubDate>Mon, 19 Jun 2023 22:02:30 +0000</pubDate>
      <link>https://dev.to/kennethstack/still-on-exploring-linux-commandday-5-3l1b</link>
      <guid>https://dev.to/kennethstack/still-on-exploring-linux-commandday-5-3l1b</guid>
      <description>&lt;p&gt;welcome back guys!!! still on Exploring Linux; today i learnt new things which i'm sharing right away. let's ride on &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Different Group and Group commands&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cat /etc/passwd: is use to check the added users &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkqw5js9qyw0ky14ztj56.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkqw5js9qyw0ky14ztj56.png" alt="output of the command" width="800" height="337"&gt;&lt;/a&gt;&lt;br&gt;
looking at the image well, you will find kmoni and anointed_ken at the bottom. those are the two(2) users available. each carrying different id&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo adduser (new username): is use to add a new user&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0vqpv1q75l2ltmjlp0va.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0vqpv1q75l2ltmjlp0va.png" alt="output of the command" width="800" height="266"&gt;&lt;/a&gt;&lt;br&gt;
You are required to set a new password for the added user &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo groupadd (group name): use to create new group&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2agerv8gnjgzc9da4igv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2agerv8gnjgzc9da4igv.png" alt="output of the command" width="800" height="122"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo passwd (user name): use to change a user password&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxkopj681uysopjumq916.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxkopj681uysopjumq916.png" alt="output" width="800" height="127"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cat /etc/group: use to view the groups created&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhfinzhxb5u3z21ory75r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhfinzhxb5u3z21ory75r.png" alt="output" width="800" height="421"&gt;&lt;/a&gt;&lt;br&gt;
you caan see the group "computing" created is just at the last line of the output of the command&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo usermod -g (groupname)(username): use to add a user to a group and u can confirm using "groups (username).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcodtlxv5pcnybfa3a1pg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcodtlxv5pcnybfa3a1pg.png" alt="output" width="800" height="122"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Users and Permission&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ls -l: prints files in a long listing format&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp941swhsljlne9bhunw3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp941swhsljlne9bhunw3.png" alt="output" width="800" height="358"&gt;&lt;/a&gt;&lt;br&gt;
The details shows permission on the folders and files.&lt;br&gt;
let's look into the output of the command and get to know what each details means. i will use the first line to explain the details&lt;br&gt;
 "drwxrwxr-x 1 kmoni   kmoni   512 Jun 16 08:16 Example"&lt;br&gt;
you will notice the name "kmoni" appears twice. the first "kmoni" stands for the user name while the second "kmoni" stands for the group name.&lt;br&gt;
"d" stands for directory i.e we are dealing with a directory here and "Example" is a directory&lt;br&gt;
"rwx" the first 3 letters after "d" is the permission given to the user "kmoni". the next "rwx" is the permission given to the group "kmoni". while the last "r-x" is the permission given to "others"&lt;br&gt;
"r" stands for read&lt;br&gt;
"w" stands for write&lt;br&gt;
"x" stands foe execute&lt;br&gt;
with this i believe we can decode the rest details from the output of the command we did ealier&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo chown (new username):(new group name)(file name): use to change ownership completely
from the details we had earlier, let change the ownership of the file name "greting.txt" line 13&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcoa8jduunijuic76rtfd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcoa8jduunijuic76rtfd.png" alt="output" width="800" height="356"&gt;&lt;/a&gt;&lt;br&gt;
Did you notice the changes??&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo chown (new username)(file name): use to change the user ownership&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgkjjgqlmxzxmf147o8jh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgkjjgqlmxzxmf147o8jh.png" alt="output" width="800" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;sudo chgrp (group name)(filename): use to change the group owner&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;sudo chmod -permission filename: use to remove a particular permission from a file. let remove the read(r) permission from data.csv &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxi5wqk962kj39p0i3s9l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxi5wqk962kj39p0i3s9l.png" alt="output" width="800" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo chmod g- (permission)(filename): use to remove a permission from the group user. let's remove the read(r) from the group user of document.pdf&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9uk3gfst6q9gv0zupvnf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9uk3gfst6q9gv0zupvnf.png" alt="output" width="777" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;sudo chmod u-(permission)(filename): use to remove a permission from the user. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;sudo chmod g+(permission)(filename): use to add permission to a group user.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flnx738rti49mjwxufmbk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flnx738rti49mjwxufmbk.png" alt="Image description" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is it for today. DAY 6 LOADING. THANKS GUYS!!!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>cloud</category>
      <category>devops</category>
      <category>120days</category>
    </item>
    <item>
      <title>Exploring More Concept Of Linux Administration Techniques</title>
      <dc:creator>Kenneth Mahon</dc:creator>
      <pubDate>Sat, 17 Jun 2023 23:44:43 +0000</pubDate>
      <link>https://dev.to/kennethstack/exploring-more-concept-of-linux-administration-techniques-11kc</link>
      <guid>https://dev.to/kennethstack/exploring-more-concept-of-linux-administration-techniques-11kc</guid>
      <description>&lt;p&gt;Hey guys!! I'm back as i promised. So far in this journey we have gained valuable insights into Linux and DevOps. lets dive more into Linux. ride me with guys. Let's Gooooo &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to Check Os version&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ls /etc/&lt;em&gt;release&lt;/em&gt;: This is use to check the current Os the user is operation on&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnuqry88c78vtzetqgo0g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnuqry88c78vtzetqgo0g.png" alt="the result shows the user in on /etc/lsb-release " width="800" height="123"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cat /etc/&lt;em&gt;release&lt;/em&gt; : To View More details&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3vx1xdc7eot0jqw6de2e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3vx1xdc7eot0jqw6de2e.png" alt="outcome of the command" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Download Files&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Curl (url) -O : use to download file and save it. then use the "ls" command to check for the file you downloaded&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F75d43uaemz97xy5hicvu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F75d43uaemz97xy5hicvu.png" alt="document.pdf downloaded" width="800" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;wget (url) -O name of file : also use to download file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Vi and Vim&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Vi is a built-in text Editor in Linux while Vim is an improved version of Vi. This Text Editor edit a file and can also create a file. let's take a look at how to use it&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;vim filename : this is use to open a file and make it available for editing. it could be a new file or already existing file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7i56g9o09l89czzcpk5x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7i56g9o09l89czzcpk5x.png" alt="Input command" width="800" height="122"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fldk86vcq386bhgdic4f6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fldk86vcq386bhgdic4f6.png" alt="output" width="800" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;now, let now input words into the opened file. so how do we go about it?&lt;br&gt;
"press i" to be able to edit the opened file&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57zjv3d5xbci6xb11kgn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57zjv3d5xbci6xb11kgn.png" alt="Edited file" width="800" height="376"&gt;&lt;/a&gt;&lt;br&gt;
looking at the image well, you will discover that "insert" shows at the left bottom of the opened file when you press "i". it shows you are in the editing mode&lt;/p&gt;

&lt;p&gt;"press esc" on your keyboard to return back to command mode&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdddaxhdl29dxu7rrj2t5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdddaxhdl29dxu7rrj2t5.png" alt="output" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;notice you can no longer see "insert" at the let bottom of the opened file. when in command mode, the following commands are useful&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;:wq is use to save the changes made on the file and quit the vim&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;:q is use to quit vim without making changes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;dd is use to delete a line&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;x is use to delete words one after the other&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: use the cat command to check the changes done on the file&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvk1rtmwr9oogqcgh7ixz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvk1rtmwr9oogqcgh7ixz.png" alt="output" width="800" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing Software on Linux&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Package Manager tools are mostly used when installing software on linux such as the "Advance Package Tool". Let's get our hands busy&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sudo apt search (package name) : is use to search for a give package&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3428zy6e9i9fsdbzqdds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3428zy6e9i9fsdbzqdds.png" alt="searching for figlet" width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo apt install (package name) : it is use to install given package&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7yjc5nf89bavr7yosbrn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7yjc5nf89bavr7yosbrn.png" alt="Installation in progress" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxr0c4nuqmbkl4edzxrt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxr0c4nuqmbkl4edzxrt.png" alt="Installation successful" width="800" height="419"&gt;&lt;/a&gt;&lt;br&gt;
we have successfully installed java.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;sudo apt (package name1)(package name2) : is use to install multiple packages with one command&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;package name --version : is use to check the version&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F23qfa5jbb4bup7i4wfqp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F23qfa5jbb4bup7i4wfqp.png" alt="Image description" width="800" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo apt remove (package name) : is use to remove a given package&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;thanks Guys for following up and sharing in my DevOps journey. day 5 loading...........&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>cloud</category>
      <category>120days</category>
    </item>
  </channel>
</rss>
