<?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: Mahbub Ferdous Bijoy</title>
    <description>The latest articles on DEV Community by Mahbub Ferdous Bijoy (@mahhbubferdous).</description>
    <link>https://dev.to/mahhbubferdous</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%2F675685%2F56bb9b23-f780-401d-9f8a-24bd400a17f1.jpeg</url>
      <title>DEV Community: Mahbub Ferdous Bijoy</title>
      <link>https://dev.to/mahhbubferdous</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mahhbubferdous"/>
    <language>en</language>
    <item>
      <title>YAML Syntax And So More</title>
      <dc:creator>Mahbub Ferdous Bijoy</dc:creator>
      <pubDate>Mon, 07 Oct 2024 20:25:18 +0000</pubDate>
      <link>https://dev.to/mahhbubferdous/yaml-syntax-and-so-more-p61</link>
      <guid>https://dev.to/mahhbubferdous/yaml-syntax-and-so-more-p61</guid>
      <description>&lt;h3&gt;
  
  
  here is key : value
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;key : value
app : user-authentication


#this all about key value just remember to put indentation 

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  there is all variable in YAML.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#string
app : user-authentication

#integer 
port : 8000

#float
version : 1.7

#boolean
deployed : true 

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  here is all objects YAML
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;microservices : 
  app : payment-app
  port : 9001
  version : 1.9
  deployed : false

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  here is list
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fruits : 
  - apple
  - kiwi
  - banana
  - orange
  - nuts : 
    - almond
    - cashew

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  here is all multiline yaml, list with objects
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
microservices : 
  - name : user-authentication
    port : 9001
    version : 1.9
    deployed : true
  - name : payment-app
    port : 9002
    version : 1.8
    deployed : false
  - name : db-app
    port : 9003
    version : 1.8
    deployed : true 

---

## schools --&amp;gt; name, principal --&amp;gt; students --&amp;gt; name,rollnumber,parents,number

schools:
- name : MHS
  principal : Gius
  students :
  - name: Mahbub
    roolnumber : 7
    parents : 
    - father : rahim
    - mother : josna
    number: 460

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>YAML - YAML Ain't Markup Language</title>
      <dc:creator>Mahbub Ferdous Bijoy</dc:creator>
      <pubDate>Mon, 07 Oct 2024 20:19:44 +0000</pubDate>
      <link>https://dev.to/mahhbubferdous/yaml-yaml-aint-markup-language-2e8a</link>
      <guid>https://dev.to/mahhbubferdous/yaml-yaml-aint-markup-language-2e8a</guid>
      <description>&lt;h3&gt;
  
  
  What is YAML?
&lt;/h3&gt;

&lt;p&gt;YAML is a human-readable data serialization language that is often used for writing configuration files. Depending on whom you ask, YAML stands for yet another markup language or YAML ain’t markup language (a recursive acronym), which emphasizes that YAML is for data, not documents. &lt;/p&gt;

&lt;p&gt;YAML is a popular programming language because it is designed to be easy to read and understand. It can also be used in conjunction with other programming languages. Because of its flexibility, and accessibility, YAML is used for Docker-compose,Kubernetes,Ansible &lt;/p&gt;

&lt;h3&gt;
  
  
  YAML syntax
&lt;/h3&gt;

&lt;p&gt;YAML files use a &lt;code&gt;.yml&lt;/code&gt; or &lt;code&gt;.yaml&lt;/code&gt; extension, and follow specific syntax rules. &lt;/p&gt;

&lt;p&gt;YAML has features that come from Perl, C, XML, HTML, and other programming languages. YAML is also a superset of JSON, so JSON files are valid in YAML.&lt;/p&gt;

&lt;p&gt;There are no usual format symbols, such as braces, square brackets, closing tags, or quotation marks. And YAML files are simpler to read as they use Python-style indentation to determine the structure and indicate nesting. Tab characters are not allowed by design, to maintain portability across systems, so whitespaces—literal space characters—are used instead. &lt;/p&gt;

&lt;p&gt;Comments can be identified with a pound or hash symbol &lt;code&gt;(#)&lt;/code&gt;. It’s always a best practice to use comments, as they describe the intention of the code. YAML does not support multi-line comment, each line needs to be suffixed with the pound character.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A common question for YAML beginners is “What do the 3 dashes mean?” 3 dashes (---) are used to signal the start of a document, while each document ends with three dots (...).  

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

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;indentation is more important for YAML&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Comment: This is a supermarket list using YAML
#Note that - character represents the list
---
food: 
  - vegetables: tomatoes #first list item
  - fruits: #second list item
      citrics: oranges 
      tropical: bananas
      nuts: peanuts
      sweets: raisins

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

&lt;/div&gt;



&lt;p&gt;Note that the structure of a YAML file is a map or a list, and it follows a hierarchy depending on the indentation, and how you define your key values. Maps allow you to associate key-value pairs. Each key must be unique, and the order doesn't matter. Think of a Python dictionary or a variable assignment in a Bash script.&lt;/p&gt;

&lt;p&gt;A map in YAML needs to be resolved before it can be closed, and a new map is created. A new map can be created by either increasing the indentation level or by resolving the previous map and starting an adjacent map.&lt;/p&gt;

&lt;p&gt;A list includes values listed in a specific order and may contain any number of items needed. A list sequence starts with a dash &lt;code&gt;(-)&lt;/code&gt; and a space, while indentation separates it from the parent. You can think of a sequence as a Python list or an array in Bash or Perl. A list can be embedded into a map.&lt;/p&gt;

&lt;p&gt;In the example provided above “vegetables” and “fruits” represent items that are part of the list named “food”.&lt;/p&gt;

&lt;p&gt;YAML also contains scalars, which are arbitrary data (encoded in Unicode) that can be used as values such as strings, integers, dates, numbers, or booleans.&lt;/p&gt;

&lt;p&gt;When creating a YAML file, you’ll need to ensure that you follow these syntax rules and that your file is valid. To achieve it, you can use a linter—an application that verifies the syntax of a file. The yamllint command can help to ensure you’ve created a valid YAML file before you hand it over to an application.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is YAML used for?
&lt;/h3&gt;

&lt;p&gt;One of the most common uses for YAML is to create configuration files. It's recommended that configuration files be written in YAML rather than JSON, even though they can be used interchangeably in most cases, because YAML has better readability and is more user-friendly.  &lt;/p&gt;

&lt;p&gt;In addition to its use in Ansible, YAML is used for Kubernetes resources and deployments. &lt;/p&gt;

&lt;p&gt;A benefit of using YAML is that YAML files can be added to source control, such as Github, so that changes can be tracked and audited.&lt;/p&gt;

&lt;h3&gt;
  
  
  YAML in Ansible
&lt;/h3&gt;

&lt;p&gt;Ansible Playbooks are used to orchestrate IT processes. A playbook is a YAML file containing 1 or more plays, and is used to define the desired state of a system. &lt;/p&gt;

&lt;p&gt;Each play can run one or more tasks, and each task invokes an Ansible module. Modules are used to accomplish automation tasks in Ansible. Ansible modules can be written in any language that can return JSON, such as Ruby, Python, or bash.&lt;/p&gt;

&lt;p&gt;An Ansible Playbook consists of maps and lists. To create a playbook, start a YAML list that names the play, and then lists tasks in a sequence. Remember that indentation is not an indication of logical inheritance. Think of each line as a YAML data type (a list or a map).&lt;/p&gt;

&lt;p&gt;By using YAML templates, Ansible users can program repetitive tasks to happen automatically without having to learn an advanced programming language. Developers can also use the ansible-lint command, a YAML linter for Ansible Playbooks, to identify mistakes so errors don't occur during a critical stage of operation.&lt;/p&gt;

&lt;p&gt;With the introduction of Ansible Lightspeed with IBM Watson Code Assistant, a generative AI service, developers can create Ansible automation content more efficiently. Users can enter a task request in plain English and get clean and compliant YAML code recommendations for automation tasks that are then used to create Ansible Playbooks.&lt;/p&gt;

&lt;h3&gt;
  
  
  YAML for Kubernetes
&lt;/h3&gt;

&lt;p&gt;Kubernetes works based on defined state and actual state. Kubernetes objects represent the state of a cluster and tell Kubernetes what you want the workload to look like. Kubernetes resources, such as pods, objects, and deployments can be created using YAML files. &lt;/p&gt;

&lt;p&gt;When creating a Kubernetes object, you’ll need to include specifications to define the object's desired state. The Kubernetes API can be used to create the object. The request to the API will include the object specifications in JSON, but most often you’ll provide the required information to kubectl as a YAML file. Kubectl will convert the file into YAML for you when it makes the API request.&lt;/p&gt;

&lt;p&gt;Once an object has been created and defined, Kubernetes works to make sure that the object always exists. &lt;/p&gt;

&lt;p&gt;Developers or sysadmins specify the defined state using the YAML or JSON files they submit to the Kubernetes API. Kubernetes uses a controller to analyze the difference between the new defined state and the actual state in the cluster.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;you can check your YAML indentation by using yamllint.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;or you can install yamllint in your system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo dnf install -y yamllint

Use yamllint command to validate your YAML file:

$ yamllint --strict dummy.yaml || echo “Fail”

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

&lt;/div&gt;



&lt;p&gt;the output will be JSON file .&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Corn-jobs with some custom script</title>
      <dc:creator>Mahbub Ferdous Bijoy</dc:creator>
      <pubDate>Fri, 04 Oct 2024 17:53:38 +0000</pubDate>
      <link>https://dev.to/mahhbubferdous/corn-jobs-with-some-custom-script-m13</link>
      <guid>https://dev.to/mahhbubferdous/corn-jobs-with-some-custom-script-m13</guid>
      <description>&lt;h2&gt;
  
  
  How to Automate Scripts by Scheduling via cron Jobs:
&lt;/h2&gt;

&lt;p&gt;Cron is a job scheduling utility present in Unix like systems. You can schedule jobs to execute daily, weekly, monthly or in a specific time of the day. Automation in Linux heavily relies on cron jobs like network troubleshooting, process managment,cpu and memory management day to day same time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Below is the syntax to schedule crons:
&lt;/h2&gt;



&lt;p&gt;&lt;code&gt;* * * * * sh /path/to/script.sh&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sh&lt;/code&gt; represents that the script is a bash script and should be run from &lt;code&gt;/bin/bash&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;/path/to/script.sh&lt;/code&gt; specifies the path to script&lt;/p&gt;

&lt;p&gt;Here, (*) represents minute(s) hour(s) day(s) month(s) weekday(s), respectively.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;1th (*) for : minutes -&amp;gt; 0-59&lt;/li&gt;
&lt;li&gt;2nd (*) for : hour    -&amp;gt; 0-24&lt;/li&gt;
&lt;li&gt;3rd (*) for : date    -&amp;gt; 1-31&lt;/li&gt;
&lt;li&gt;4th (*) for : month   -&amp;gt; 1-12&lt;/li&gt;
&lt;li&gt;5th (*) for : days    -&amp;gt; 0-6 &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;5 0 8 : at 00.05 in august&lt;/code&gt;&lt;br&gt;
&lt;code&gt;5 4 6 : at 4.05 on sunday&lt;/code&gt;&lt;br&gt;
&lt;code&gt;0 22 1-5 : At 22:00 on every day-of-week from Monday through Friday.&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  most important crontab command:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;edits crontab entries to add, delete, or edit cron jobs:
&lt;code&gt;$ crontab -e&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;list all the cron jobs for the current user:
&lt;code&gt;$ crontab -l&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;list another user's crons:
&lt;code&gt;crontab -u userName -l&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;edit another user's crons:
&lt;code&gt;crontab -u username -e&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#! /bin/bash

#make a date-script.sh file 

echo date &amp;gt;&amp;gt; date-output.txt

# make this file executabel:

chmod 774 date-script.sh

# add this in crontab for every minutes:

crontab -e 

#and paste this line:
*/1 * * * * sh date-script.shFilePath
#now do cat in date-output.txt you will see all the output

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  nodeHealth.sh
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

#####################################################

# Author : Mahbub 
# Date : 04/10/24
# Tags: Check node health
# Description: This script outputs the node health
# Version : v1

######################################################

#debug mode for know which output which command:
set -x 

#print the disk space
df -h

#print the memory 
free -g

#print the resources like cpu
nproc

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  check_process_running.sh:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

#####################################################

# Author : Mahbub 
# Date : 07/10/24
# Tags: Check all processes
# Description: This script outputs the all runing process
# Version : v1

######################################################

#set debug mode for human readable
set -x
#when script get an error :
set -e    # exit the script when there is an error
set -o pipefail  # if we use pipe operator and its have problem without this line command will executed


#check process command:
ps -ef

# check human readable:
ps -h

#if you want to know selected PID(processID) using querythan we can use pipe(|) and (grep)

#ps -ef | grep "processName"
ps -ef | grep "zsh"
#or we can get output in a txt file: here we use backtic for commands 

# echo ps -h | grep "processId" &amp;gt;&amp;gt; ps-output.txt
echo ps -h | grep "zsh" &amp;gt;&amp;gt; zsh-output.txt
#must use backtick after echo command
# awk command for get info column by column :

ps -ef | grep zsh | awk -F" " '{print $2}'   # here $2 means 2nd column

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  get_error_from_logfile.sh:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

#####################################################

# Author : Mahbub 
# Date : 09/10/24
# Tags: Find ERROR in logfile from remote storage 
# Description: This script helps to get error log from remote logfile 
# Version : v1

######################################################

#add debug mode
set -x
set -e
set -o pipefail

# in general logfile are big and also important thats why every company put it on amazon s3 or google drive or github. i mean any remote storage service they use 

# to get error from remote log file we use curl :

curl https://www.ibm.com/docs/en/zos/2.4.0?topic=problems-example-log-file | grep WARNING

# here after grep we can use INFO,WARNING,ERROR,TRACE

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Shell -If/elif/else and loops</title>
      <dc:creator>Mahbub Ferdous Bijoy</dc:creator>
      <pubDate>Fri, 04 Oct 2024 17:38:07 +0000</pubDate>
      <link>https://dev.to/mahhbubferdous/shell-ifelifelse-and-loops-34o9</link>
      <guid>https://dev.to/mahhbubferdous/shell-ifelifelse-and-loops-34o9</guid>
      <description>&lt;h2&gt;
  
  
  Numeric Comparison logical operators:
&lt;/h2&gt;

&lt;p&gt;Comparison is used to check if statements evaluate to true or false. We can use the below shown operators to compare two statements:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Equality             :num1 &lt;code&gt;-eq&lt;/code&gt; num2 --------&amp;gt; is num1 equal to num2&lt;/li&gt;
&lt;li&gt;Greater than equal to:num1 &lt;code&gt;-ge&lt;/code&gt; num2 --------&amp;gt; is num1 greater than equal to num2&lt;/li&gt;
&lt;li&gt;Greater than         :num1 &lt;code&gt;-gt&lt;/code&gt; num2 --------&amp;gt; is num1 greater than num2&lt;/li&gt;
&lt;li&gt;Less than equal to   :num1 &lt;code&gt;-le&lt;/code&gt; num2 --------&amp;gt; is num1 less than equal to num2&lt;/li&gt;
&lt;li&gt;Less than            :num1 &lt;code&gt;-lt&lt;/code&gt; num2 --------&amp;gt; is num1 less than num2&lt;/li&gt;
&lt;li&gt;Not Equal to         :num1 &lt;code&gt;-ne&lt;/code&gt; num2 --------&amp;gt; is num1 not equal to num2&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  if code structure:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if [ conditions ]
    then
         commands
fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  if else code structure:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if [[ condition ]]
then
    statement
elif [[ condition ]]; then
    statement 
fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  if elif else code structure:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if [[ condition ]]
then
    statement
elif [[ condition ]]; then
    statement 
else
    statement
fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we can use AND &lt;code&gt;-a&lt;/code&gt; and OR &lt;code&gt;-o&lt;/code&gt; as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#! /bin/bash

read a
read b
read c


# if statement :

if [$a -e $b]
than
    echo a is equal to b
elif [$a -gt $b]
    than
    echo a is greater than b
else [$a -lt $b]
    than
    echo a is less than b
fi 



# we can use AND (-a) and OR (-o) as well.

if [$a -ne $b -o $a -e $b]
    than 
        echo "true"
    elif [$a -gt $b -a $b -ge $c]
        than 
            echo "elif true"
        else
            than
                echo "false"
fi


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

&lt;/div&gt;



&lt;h2&gt;
  
  
  shell script for...while loops:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#! /bin/bash

# For loops allow you to execute statements a specific number of times:

for i in 0 1 2 3 4 5 6 7 8 9 
    do
        echo $i
done

# for loop for os file system :


for FILE in $HOME/.bash*
do
   echo $FILE
done

# for loop for strings :

for X in cyan magenta yellow  
do
    echo $X
done

# while loop :

i=1
while [[ $i -le 10 ]] ; do
   echo "$i"
  (( i += 1 ))
done

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Shell - Variable,Arithmetic Operator, Input</title>
      <dc:creator>Mahbub Ferdous Bijoy</dc:creator>
      <pubDate>Fri, 04 Oct 2024 16:50:42 +0000</pubDate>
      <link>https://dev.to/mahhbubferdous/variablearithmetic-operator-input-19m0</link>
      <guid>https://dev.to/mahhbubferdous/variablearithmetic-operator-input-19m0</guid>
      <description>&lt;h2&gt;
  
  
  How to define variables
&lt;/h2&gt;

&lt;p&gt;We can define a variable by using the syntax variable_name=value. To get the value of the variable, add &lt;code&gt;$&lt;/code&gt; before the variable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;shebang added 
#! /bin/bash

#here our variable example

greetings1=Hello
echo "ENTER YOUR NAME: "
read name
greetings2="How are you?"
echo "$greetings1 $name.$greetings2"

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Arithmetic Expressions
&lt;/h2&gt;

&lt;p&gt;Below are the operators supported by bash for mathematical calculations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. +    = addition
2. -    = subtraction
3. /    = division
4. *    = exponentiation
5. %    = modulus
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;p&gt;&lt;code&gt;for arithmetic operations always make a variable like this:-  varName=$((operations))&amp;gt;&amp;gt;&amp;gt; additons=$((10+20))&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;when you echo all arethmetic operations at a time its work first modulus than division than multiply than subtraction last it will works addition&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  For decimal calculations:
&lt;/h2&gt;

&lt;p&gt;we can use &lt;code&gt;bc&lt;/code&gt; command to get the output to a particular number of decimal places. &lt;code&gt;bc (Bash Calculator)&lt;/code&gt; is a command line calculator that supports calculation up to a certain number of decimal points.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo "scale=2;22/7" | bc&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Where &lt;code&gt;scale&lt;/code&gt; defines the number of decimal places required in the output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#! /bin/bash

#for arithmetic operations always make a variable like this:-  varName=$((operations))&amp;gt;&amp;gt;&amp;gt; additons=$((10+20))

addition=$((10+10))
subtraction=$((10-8))
division=$((16/4))
exponentiation=$((10*2))
modulus=$((11%2))

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#here all arithmetic answer:

echo $addition      
#ans is 20
echo $subtraction   
#ans is 2
echo $division      
#ans is 4
echo $exponentiation  
#ans is 20
echo $modulus         
#ans is 1

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

&lt;/div&gt;



&lt;p&gt;here is all functionalities addition:&lt;/p&gt;

&lt;p&gt;when you echo all arithmetic operations at a time its work first modulus than division than multiply than subtraction last it will works addition&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo $(($addition - $subtraction + $modulus * $exponentiation))&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Ans is 38 &amp;gt;&amp;gt; 1st(*) than (-) than (+)&lt;/p&gt;

&lt;h2&gt;
  
  
  for decimal calculations:
&lt;/h2&gt;

&lt;p&gt;we can use &lt;code&gt;bc&lt;/code&gt; command to get the output to a particular number of decimal places. &lt;code&gt;bc (Bash Calculator)&lt;/code&gt; is a command line calculator that supports calculation up to a certain number of decimal points.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo "scale=2;22/7" | bc&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Ans will be - 3.14&lt;/p&gt;

&lt;p&gt;Where &lt;code&gt;scale&lt;/code&gt; defines the number of decimal places required in the output.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to read user input:
&lt;/h2&gt;

&lt;p&gt;Sometimes you'll need to gather user input and perform relevant operations.&lt;/p&gt;

&lt;p&gt;In bash, we can take user input using the &lt;code&gt;read&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;read variable_name&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To prompt the user with a custom message, use the &lt;code&gt;-p&lt;/code&gt; flag.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;read -p "Enter your age" variable_name&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#! /bin/bash

read -p "ENTER YOUR NAME: " name
read -p "ENTER YOUR AGE: " age

echo "Your Name is : $name and your age : $age."

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Introduction to shell scripts</title>
      <dc:creator>Mahbub Ferdous Bijoy</dc:creator>
      <pubDate>Fri, 04 Oct 2024 16:42:38 +0000</pubDate>
      <link>https://dev.to/mahhbubferdous/introduction-to-shell-scripts-18mn</link>
      <guid>https://dev.to/mahhbubferdous/introduction-to-shell-scripts-18mn</guid>
      <description>&lt;h2&gt;
  
  
  Introduction to Shell and shell scripting:
&lt;/h2&gt;

&lt;p&gt;If we are using any major operating system, we are indirectly interacting with the shell. While running Ubuntu, Linux Mint, or any other Linux distribution, we are interacting with the shell by using the terminal. In this article we will discuss Linux shells and shell scripting so before understanding shell scripting we have to get familiar with the following terminologies:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Kernel&lt;/li&gt;
&lt;li&gt;Shell&lt;/li&gt;
&lt;li&gt;Terminal&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What is Kernel?
&lt;/h2&gt;

&lt;p&gt;The kernel is a computer program that is the core of a computer’s operating system, with complete control over everything in the system. It manages the following resources of the Linux system –&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;File management&lt;/li&gt;
&lt;li&gt;Process management&lt;/li&gt;
&lt;li&gt;I/O management&lt;/li&gt;
&lt;li&gt;Memory management&lt;/li&gt;
&lt;li&gt;Device management etc.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It is often mistaken that Linus Torvalds has developed Linux OS, but actually, he is only responsible for the development of the Linux kernel.&lt;/p&gt;

&lt;p&gt;Complete Linux system = Kernel + GNU system utilities and libraries + other management scripts + installation scripts.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Shell?
&lt;/h2&gt;

&lt;p&gt;A shell is a special user program that provides an interface for the user to use operating system services. Shell accepts human-readable commands from users and converts them into something which the kernel can understand. It is a command language interpreter that executes commands read from input devices such as keyboards or from files. The shell gets started when the user logs in or starts the terminal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shell is broadly classified into two categories –
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Command Line Shell&lt;/li&gt;
&lt;li&gt;Graphical shell&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Command Line Shell
&lt;/h2&gt;

&lt;p&gt;Shell can be accessed by users using a command line interface. A special program called Terminal in Linux/macOS, or Command Prompt in Windows OS is provided to type in the human-readable commands such as “cat”, “ls” etc. and then it is being executed. The result is then displayed on the terminal to the user.&lt;/p&gt;

&lt;h2&gt;
  
  
  Graphical Shells
&lt;/h2&gt;

&lt;p&gt;Graphical shells provide means for manipulating programs based on the graphical user interface (GUI), by allowing for operations such as opening, closing, moving, and resizing windows, as well as switching focus between windows. Window OS or Ubuntu OS can be considered as a good example which provides GUI to the user for interacting with the program. Users do not need to type in commands for every action.&lt;/p&gt;

&lt;h2&gt;
  
  
  There are several shells are available for Linux systems like –
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;BASH (Bourne Again SHell) – It is the most widely used shell in Linux systems. It is used as default login shell in Linux systems and in macOS. It can also be installed on Windows OS.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CSH (C SHell) – The C shell’s syntax and its usage are very similar to the C programming language.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;KSH (Korn SHell) – The Korn Shell was also the base for the POSIX Shell standard specifications etc.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each shell does the same job but understands different commands and provides different built-in functions.&lt;/p&gt;

&lt;p&gt;The Linux command line is provided by a program called the shell. Over the years, the shell program has evolved to cater to various options.&lt;/p&gt;

&lt;p&gt;Different users can be configured to use different shells. But most users prefer to stick with the current default shell. The default shell for many Linux distros is the GNU Bourne-Again Shell (bash). Bash is succeeded by Bourne shell &lt;code&gt;(sh)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;When you first launch the shell, it uses a startup script located in the &lt;code&gt;.bashrc&lt;/code&gt; or &lt;code&gt;.bash_profile&lt;/code&gt; file which allows you to customize the behavior of the shell.&lt;/p&gt;

&lt;p&gt;When a shell is used interactively, it displays a &lt;code&gt;$&lt;/code&gt; when it is waiting for a command from the user. This is called the shell prompt.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[username@host ~]$&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If shell is running as root, the prompt is changed to #. The superuser shell prompt looks like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[root@host ~]#&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Bash is very powerful as it can simplify certain operations that are hard to accomplish efficiently with a GUI. Remember that most servers do not have a GUI, and it is best to learn to use the powers of a command line interface (CLI).&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Bash Script?
&lt;/h2&gt;

&lt;p&gt;A bash script is a series of commands written in a file. These are read and executed by the bash program. The program executes line by line.&lt;/p&gt;

&lt;p&gt;For example, you can navigate to a certain path, create a folder and spawn a process inside it using the command line.&lt;/p&gt;

&lt;p&gt;You can do the same sequence of steps by saving the commands in a bash script and running it. You can run the script any number of times.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Do You Identify a Bash Script?
&lt;/h2&gt;

&lt;p&gt;File extension of &lt;code&gt;.sh.&lt;/code&gt;&lt;br&gt;
By naming conventions, bash scripts end with a &lt;code&gt;.sh&lt;/code&gt;. However, bash scripts can run perfectly fine without the sh extension.&lt;/p&gt;
&lt;h2&gt;
  
  
  Scripts start with a bash bang.
&lt;/h2&gt;

&lt;p&gt;Scripts are also identified with a &lt;code&gt;shebang&lt;/code&gt;. &lt;code&gt;Shebang&lt;/code&gt; is a combination of bash &lt;code&gt;#&lt;/code&gt; and bang &lt;code&gt;!&lt;/code&gt; followed the the bash shell path. This is the first line of the script. Shebang tells the shell to execute it via bash shell. Shebang is simply an absolute path to the bash interpreter.&lt;/p&gt;

&lt;p&gt;Below is an example of the shebang statement.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#! /bin/bash&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The path of the bash program can vary. We will see later how to identify it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Execution rights
&lt;/h2&gt;

&lt;p&gt;Scripts have execution rights for the user executing them.&lt;/p&gt;

&lt;p&gt;An execution right is represented by &lt;code&gt;x&lt;/code&gt;. &lt;code&gt;rwx&lt;/code&gt;(read, write, execute) &lt;/p&gt;

&lt;h2&gt;
  
  
  File colour
&lt;/h2&gt;

&lt;p&gt;Executable scripts appear in a different colour from rest of the files and folders.&lt;/p&gt;

&lt;p&gt;In my case, the scripts with execution rights appear as green.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Create Your First Bash Script
&lt;/h2&gt;

&lt;p&gt;Let's create a simple script in bash that outputs &lt;code&gt;Hello World&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Create a file named hello_world.sh&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;touch hello_world.sh&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Find the path to your bash shell.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;which bash&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;In my case, the path is /bin/bash and I will include this in the &lt;code&gt;shebang&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Write the command.
&lt;/h2&gt;

&lt;p&gt;We will &lt;code&gt;echo&lt;/code&gt; "hello world" to the console.&lt;/p&gt;

&lt;p&gt;Our script will look something like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#! /usr/bin/bash&lt;/code&gt;&lt;br&gt;
&lt;code&gt;echo "Hello World"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Edit the file hello_world.sh using a text editor of your choice it is vim&lt;/p&gt;

&lt;h2&gt;
  
  
  Provide execution rights to your user.
&lt;/h2&gt;

&lt;p&gt;Modify the file permissions and allow execution of the script by using the command below:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chmod u+x hello_world.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;chmod modifies the existing rights of a file for a particular user. We are adding &lt;code&gt;+x&lt;/code&gt; to user &lt;code&gt;u&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run the script.
&lt;/h2&gt;

&lt;p&gt;You can run the script in the following ways:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./hello_world.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bash hello_world.sh.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and see the output&lt;/p&gt;

&lt;p&gt;Two ways to run scripts&lt;/p&gt;

&lt;h2&gt;
  
  
  examples:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;##### added shebang #####
#! /bin/bash               
### write our commands or scripts here:
echo "hello world"
echo "Enter your Name: "
read name
echo "$name"
pwd
ls
whoami

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Day-6: Network Troubleshooting, Network config, Dns</title>
      <dc:creator>Mahbub Ferdous Bijoy</dc:creator>
      <pubDate>Mon, 30 Sep 2024 16:52:21 +0000</pubDate>
      <link>https://dev.to/mahhbubferdous/day-6-network-troubleshooting-network-config-dns-4g3m</link>
      <guid>https://dev.to/mahhbubferdous/day-6-network-troubleshooting-network-config-dns-4g3m</guid>
      <description>&lt;h2&gt;
  
  
  copy and rsync command:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;To copy a file over from local host to a remote host:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ $ scp myfile.txt username@remotehost.com:/remote/directory

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;To copy a file from a remote host to your local host:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ scp username@remotehost.com:/remote/directory/myfile.txt /local/directory

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;To copy over a directory from your local host to a remote host:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ scp -r mydir username@remotehost.com:/remote/directory

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;rsync files on the same host:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rsync -zvr /my/local/directory/one /my/local/directory/two

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;rsync files to local host from a remote host:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rsync /local/directory username@remotehost.com:/remote/directory

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;rsync files to a remote host from a local host:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rsync username@remotehost.com:/remote/directory /local/directory

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  simple server command :
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;run simple python server command :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ python -m SimpleHTTPServer

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  here is network routing comamnd:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Look at your machine's routing table:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ route -n

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Gateway

If we are sending a packet that is not on the same network, it will be sent to this Gateway address. Which is aptly named as being a Gateway to another network.

Genmask

This is the subnet mask, used to figure out what IP addresses match what destination.

Flags

UG - Network is Up and is a Gateway
U - Network is Up
Iface

This is the interface that our packet will be going out of, eth0 usually stands for the first Ethernet device on your system.

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;add a new route :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo route add -net ip_address/cidr gw ip_addresss
$ ip route add ip_address via ip_address

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;delete any route :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo route del -net 192.168.2.1/23 
$ ip route delete 192.168.2.1/23

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  network config command:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;network config command :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ifconfig 
$ ipconfig
$ ifconfig -a              [to see more details] 

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;To create an interface and bring it up:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ifconfig eth0 192.168.2.1 netmask 255.255.255.0 up

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;To bring up or down an interface:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ifup eth0
$ ifdown eth0

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;To show interface information for all interfaces:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ip link show

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;To show the statistics of an interface:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ip -s link show eth0

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;To show ip addresses allocated to interfaces:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ip address show

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;To bring interfaces up and down:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ip link set eth0 up
$ ip link set eth0 down

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;To add an IP address to an interface:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ip address add 192.168.1.1/24 dev eth0

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;To obtain a fresh IP:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo dhclient

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  network manager command :
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;There are also command-line tools to interact with NetworkManager:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ nm-tool

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;The nmcli command allows you to control and modify NetworkManage:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;we lookup a MAC address with ARP command:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;You can also view your arp cache via the ip command::
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ip neighbour show

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  network troubleshoting command :
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;One of the most simplest networking tools is  &lt;code&gt;ping&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ping hostName or ip_address
$ ping google.com
$ ping -c google.com

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;The &lt;code&gt;traceroute&lt;/code&gt; command is used to see how packets are getting routed. It works by sending packets with increasing TTL values, starting with 1:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ traceroute hostName or Ip_address or google.com

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;An extremely useful tool to get detailed information about your network is netstat. Netstat displays various network related information such network connections, routing tables, information about network interfaces and more:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ netstat
$ netstat -at

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;utility to debug TCP/UDP sockets:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;we can be used to test remote connectivity on ports by using &lt;code&gt;telnet&lt;/code&gt; command:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;mtr&lt;/code&gt; is a mix of ping and traceroute. It also provides additional information like intermediate hosts and responsiveness:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  here all DNS related linux command:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The /etc/hosts file contains mappings of some hostnames to IP addresses:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;The "name server lookup" tool is used to query name servers to find information about resource records:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ nslookup DNSname or ip_address

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Dig (domain information groper) is a powerful tool for getting information about DNS name servers:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ dig DNSname or ip_address

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Day-5: Processes Utilization, Devices, and Logging</title>
      <dc:creator>Mahbub Ferdous Bijoy</dc:creator>
      <pubDate>Mon, 30 Sep 2024 16:51:36 +0000</pubDate>
      <link>https://dev.to/mahhbubferdous/day-5-processes-utilization-devices-and-logging-gn</link>
      <guid>https://dev.to/mahhbubferdous/day-5-processes-utilization-devices-and-logging-gn</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Go ahead and run the ps command to see a list of running processes:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PID: Process ID
TTY: Controlling terminal associated with the process (we'll go in detail about this later)
STAT: Process status code
TIME: Total CPU usage time
CMD: Name of executable/command

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;another details process running command :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ps aux

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;USER: The effective user (the one whose access we are using)
PID: Process ID
%CPU: CPU time used divided by the time the process has been running
%MEM: Ratio of the process's resident set size to the physical memory on the machine
VSZ: Virtual memory usage of the entire process
RSS: Resident set size, the non-swapped physical memory that a task has used
TTY: Controlling terminal associated with the process
STAT: Process status code
START: Start time of the process
TIME: Total CPU usage time
COMMAND: Name of executable/command

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;more details if we see the running process command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ps l

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;what processes are taking up a lot of your resources command niceness level of process:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1st line: This is the same information you would see if you ran the uptime command (more to come)

The fields are from left to right:

Current time
How long the system has been running
How many users are currently logged on
System load average (more to come)

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2nd line: Tasks that are running, sleeping, stopped and zombied

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3rd line: Cpu information

us: user CPU time - Percentage of CPU time spent running users’ processes that aren’t niced.
sy: system CPU time - Percentage of CPU time spent running the kernel and kernel processes
ni: nice CPU time - Percentage of CPU time spent running niced processes
id: CPU idle time - Percentage of CPU time that is spent idle
wa: I/O wait - Percentage of CPU time that is spent waiting for I/O. If this value is low, the problem probably isn’t disk or network I/O
hi: hardware interrupts - Percentage of CPU time spent serving hardware interrupts
si: software interrupts - Percentage of CPU time spent serving software interrupts
st: steal time - If you are running virtual machines, this is the percentage of CPU time that was stolen from you for other tasks

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;4th and 5th line: Memory Usage and Swap Usage

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Processes List that are Currently in Use

PID: Id of the process
USER: user that is the owner of the process
PR: Priority of process
NI: The nice value
VIRT: Virtual memory used by the process
RES: Physical memory used from the process
SHR: Shared memory of the process
S: Indicates the status of the process: S=sleep, R=running, Z=zombie,D=uninterruptible,T=stopped
%CPU - this is the percent of CPU used by this process
%MEM - percentage of RAM used by this process
TIME+ - total time of activity of this process
COMMAND - name of the process


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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;you can kill some process by using kill command, first you run top than get the PID:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ kill PID         [PID - process ID get when you run top command]

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;sending a job to background :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sleep 1000 &amp;amp;
$ jobs                     [to see the job id what you make before]
$ bg                       [too see all job in background]

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;a list of all the open files and their associated process:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;To view process threads, you can use:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ps m

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;CPU monitoring command :
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;we can see CPU details with I/O command :
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tps - Indicate the number of transfers per second that were issued to the device. A transfer is an I/O request to the device. Multiple logical requests can be combined into a single I/O request to the device. A transfer is of indeterminate size.
kB_read/s - Indicate the amount of data read from the device expressed in kilobytes per second.
kB_wrtn/s - Indicate the amount of data written to the device expressed in kilobytes per second.
kB_read - The total number of kilobytes read.
kB_wrtn - The total number of kilobytes written.

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;memory monitoring command :
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;procs

r - Number of processes for run time
b - Number of processes in uninterruptible sleep


memory

swpd - Amount of virtual memory used
free - Amount of free memory
buff - Amount of memory used as buffers
cache - Amount of memory used as cache


swap

si - Amount of memory swapped in from disk
so - Amount of memory swapped out to disk

io

bi - Amount of blocks received in from a block device
bo - Amount of blocks sent out to a block device

system

in - Number of interrupts per second
cs - Number of context switches per second

cpu

us - Time spent in user time
sy - Time spent in kernel time
id - Time spent idle
wa - Time spent waiting for IO

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;make a cronjob every day :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ 00 08 * * * home/mahbub/script/change_wallpaper.sh   [here is my script path]

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;here three * means everyday in every month and 00 means min and 08 means 08 am

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to create a cronjobs just edit a crontab:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ crontab -e

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

&lt;/div&gt;



&lt;h1&gt;
  
  
  here is all device command :
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;listing usb devices:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Listing PCI Devices:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Listing SCSI Devices:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;h1&gt;
  
  
  here some monitoring command :
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;if you want to see background task:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Gives free hard disk space on your system:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ df
$ df -h         [ -h gives you a human readable file]
# du -h        [This shows you the disk usage of the current directory you are in]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Gives free RAM on your system:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;this for cpu and ram yoou can use :
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Day-4: Server management, download, checkOS and services</title>
      <dc:creator>Mahbub Ferdous Bijoy</dc:creator>
      <pubDate>Mon, 30 Sep 2024 16:50:41 +0000</pubDate>
      <link>https://dev.to/mahhbubferdous/day-4-server-management-download-checkos-and-services-1m54</link>
      <guid>https://dev.to/mahhbubferdous/day-4-server-management-download-checkos-and-services-1m54</guid>
      <description>&lt;ol&gt;
&lt;li&gt;to start any service in linux there have 2 ways &lt;code&gt;service&lt;/code&gt; and &lt;code&gt;systemctl&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo service SERVICENAME start         [service name like httpd,mySQL etc]
$ sudo systemctl start SERVICENAME

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to stop any service in linux :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo service SERVICENAME stop
# sudo systemctl stop SERVICENAME

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;restart any stop service again :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo service SERVICENAME restart
$ sudo systemctl restart SERVICENAME 

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to check any service up and running or not :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo service SERVICENAME status
$ sudo systemctl status SERVICENAME
$ sudo systemctl is-active SERVICENAME 
$ sudo systemctl show SERVICENAME

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

&lt;/div&gt;



&lt;h1&gt;
  
  
  here is all download related linux command :
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;install some software we use &lt;code&gt;apt&lt;/code&gt; and &lt;code&gt;yum&lt;/code&gt; here &lt;code&gt;all yum command for RPM like centOS, alpine etc&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo apt install AppName
$ sudo yum install appName

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;remove any app from your local linux machine :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo apt remove appName
$ sudo yum erase appName

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;get update and upgrade:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo apt update 
$ sudo apt upgrade
$ sudo yum update 

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;get any install package info:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo apt show appName
$ sudo yum info appName

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;download something from remote server or internet we use &lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;wget&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ curl downloadLink        [curl https://www.baeldung.com/] {curl show output in console}
$ wget downloadLink        [wget https://www.baeldung.com/] {wget download it into a file}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to compress a file in linux by .gz extention:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ gzip myCompressFile

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to decompress a file in linux from .gz extended file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ gunzip myfileName.gz

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;tar file with .tar extention :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ tar cvf mytarFile.tar myDestinyFile      [here cvf's c stand for create]
$ tar xvf mytarFile.tar                    [here xvf's x stand for extract]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;dpkg and rpm:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ dpkg -i some_deb_ubuntu_package.deb   [for install debian and ubuntu package file]
$ rpm -i some_centOs_alpine_rpm_package.rpm    [for install redhat package file]
$ dpkg -r some_deb_ubuntu_package.deb    [remove file]
$ rpm -e some_centOs_alpine_rpm_package.rpm   [remove file]

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;list install packages in ubuntu debian and redhat:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ dpkg -l       [for ubuntu and debian]
$ rpm -qa       [for red hat centOS,alpine ]

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Day-3: Linux user management and permissions</title>
      <dc:creator>Mahbub Ferdous Bijoy</dc:creator>
      <pubDate>Mon, 30 Sep 2024 16:48:59 +0000</pubDate>
      <link>https://dev.to/mahhbubferdous/day-3-linux-user-management-and-permissions-22ee</link>
      <guid>https://dev.to/mahhbubferdous/day-3-linux-user-management-and-permissions-22ee</guid>
      <description>&lt;ol&gt;
&lt;li&gt;use sudo command to see some confidential or root user access file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cat /var/etc/shadow         [you cant see access denied]
$ sudo cat /var/etc/shadow        [noew you can see]
$ sudo cat /var/etc/passwd
$ sudo cat /var/etc/group

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;add some user by using useradd command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo useradd userName

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;delete some user by using userdel command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo userdel userName

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;cahnging some user password :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo passwd userName

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;if we want to know our ssh key :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cat ~/.ssh/id_rsa.pub

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;connect your machine with remote machine via ssh :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ssh -i "key-pair_fileName_PATH ubuntu@ip_address    [ubuntu or any os]

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;something copy from remote server:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ scp -i &amp;lt;keypair_PATH&amp;gt; &amp;lt; keypair_PATH&amp;gt; &amp;lt;user@ip_address&amp;gt;: filePath 

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

&lt;/div&gt;



&lt;h1&gt;
  
  
  here all linux permission command:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;check file permission:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to change any file permission by using chmod(rwx):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ chmod +x fileName            [make executable file]
$ chmod +rwx fileName          [ make permission read,write, executable]
$ chmod -rwx fileName          [ remove all permission]
$ chmod -x fileName            [remove executable permission]

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;we can give permission by using numaric command like 777:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Description: for read - 4, write - 2, execute -1. all together 7. for 777 means 1st 7 for user, 2nd for group and 3rd for all user

$ chmod 777 fileName    [all permission for user,group and all]
$ chmod 742 fileName    [all permission for user, read for group, write for all]
$ chmod 124 fileName    [execute permission for user, write for group, read for all]
$ chmod 711 fileName    [ all permission for user, execute for groups and all]

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;modifying ownership permission :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo chown userName fileName    [it will change files user ownership]
$ sudo chgrp groupName fileName    [it will change files group ownership]
$ sudo chmod userName:groupName fileName     [it will change both user &amp;amp; group ownership]

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;if you want to change your user password:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to see our system name :
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to see our system name and details:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ uname -a
$ uname -r     [to check only version numaric ]

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;add a user to a group :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo usermod -a -g groupName userName

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;remove a user from a group:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo deluser userName groupName

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Shows information of all the users logged in:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;show information of a particular user:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ finger userName

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Day-2: Linux Text manipulation</title>
      <dc:creator>Mahbub Ferdous Bijoy</dc:creator>
      <pubDate>Mon, 30 Sep 2024 16:48:00 +0000</pubDate>
      <link>https://dev.to/mahhbubferdous/day-2-linux-text-manipulation-b70</link>
      <guid>https://dev.to/mahhbubferdous/day-2-linux-text-manipulation-b70</guid>
      <description>&lt;ol&gt;
&lt;li&gt;write something on a text file using echo directly:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ echo hello world &amp;gt; my_File.txt

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;you can copy a text file from another file using echo command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ echo &amp;lt; my_file.txt &amp;gt; &amp;gt; my_File2.txt

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;: environment variable by echo:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ echo $VARIABLE
$ echo $USER
$ echo $HOME
$ env 
$ echo $PATH
$ VARIABLE_NAME = variable_value
$ unset                           [remove a variable]
$ export Variable = value         [set value of an environment variable]

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;cut something from text cut command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cut -c 5-10 fileName.txt    [5-10 word index number mention]

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;using paste command to concatenate text file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ paste -s fileName.txt
$ paste -d ' ' -s fileName.txt [for space indentation]

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to show any log file or file from head or sorting use head command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ head /var/logs/keybagd.log.0   [you see only the head part of the log file]
$ head -n 10 /var/logs/keybagd.log.0    [you can see exact 10th number of line just sorting by using -n]

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to show any log file or file from tail or sorting use tail command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ tail /var/logs/keybagd.log.0   [you see only the tail part of the log file]
$ tail -n 10 /var/logs/keybagd.log.0    [you can see exact 10th number of line just sorting by using -n]
$ tail -f /var/logs/keybagd.log.0 

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;make two file join by join command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ vim file1.txt
$ vim file2.txt
$ join file1.txt file2.txt

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;sorting some text file by using sort:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sort fileName.txt
$ sort -r fileName.txt   [ reverse sorting ]

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;upercase to lower case by using tr command :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ tr A-Z a-z

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;sorting by using uniq command for unique word:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ uniq fileNAme.txt

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;word and line count from a log or text file by using wc and nl command :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ wc fileName.txt or PATH 
$ nl fileName.txt or PATH

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to sort anything in any file or directory we use &lt;code&gt;grep&lt;/code&gt; command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ grep fox sampole.txt   [grep find fox from this file]
$ grep -i FOX sample.txt   [ this -i is getting for case insensitive result]
$ env | grep -i Users         [you can use grep with pipe(|) for more sorting] [you get only User info]

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

&lt;/div&gt;



&lt;h1&gt;
  
  
  here is all command and shortcuts for text editor vim:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;go and write file with vim editor:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ vi fileName.extention
$ vim fileName.extention

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to write file in vim do insert mode by uing &lt;code&gt;i&lt;/code&gt; in the keyboard:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ press i button

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;if you search something unique just use &lt;code&gt;/&lt;/code&gt; :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ /searchWordName
$ go up to down press n
$ down to up press N

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;vim short cuts :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ O -- for insert text on previous line
$ o -- for insert text on the next lien 
$ a -- for append text after the cursor 
$ A -- for append text at the end oif the line
$ x -- for cut the selected text also for deleting characters 
$ dd - for delete the current line 
$ y -- copy whatever is selected 
$ yy - copy the current line 
$ p -- paste the copied text before the cursor
$ :w - write and save file
$ :wq - write save and quite from vim
$ :q -- quite from vim
$ :q! - quite out from vim without saving
$ u -- undo your last action
$ ZZ - for :wq but more faster
$ Ctrl+r - redo your last action

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Day-1.Linux Basic CLI(Command line interface)</title>
      <dc:creator>Mahbub Ferdous Bijoy</dc:creator>
      <pubDate>Mon, 30 Sep 2024 16:46:53 +0000</pubDate>
      <link>https://dev.to/mahhbubferdous/linux-basic-clicommand-line-interface-196d</link>
      <guid>https://dev.to/mahhbubferdous/linux-basic-clicommand-line-interface-196d</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Present working directory(pwd):
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;change directory(cd):
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;back one step directory(cd):
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;back root directory(cd):
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;from user to direct jump to the file (cd~):
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;List file (ls):
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;List file with hidden (ls):
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;List file with file permission details (ls):
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;List file with permission and hidden files (ls):
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Make directory(mkdir):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mkdir "dirName"

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;create subdirectory at a time(mkdir):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mkdir -p dirM/2ndDir/lastDir

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;make any file(touch):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ touch fileName.txt 

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to check description of a file(file):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ file fileName.jpg 

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;show the content of a file(cat,less):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cat fileName
$ less fileName

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;show any long file with head part or tail part(head,tail):
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;clear terminal (clear):
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to see last command you write(history):
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;copying file (cp):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cp fileNmae pathwithFilename
$ cp *.jpg /user/desktop/picture 

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;rename file and directory (mv):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mv oldFile newFile
$ mv oldDir newDir

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;move file(mv):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mv fileName /home/desktop/files
$ mv file1 file2 /files

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;remove file and directory(rm):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rm fileName
$ rmdir dirName
$ rm -r dirName
$ rm *.text 

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;know any commands manual(man):
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;find some file(find):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ find /home -name fileName

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;see date and time:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ date 
$ time 

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;want to see my ssh key:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cat ~/.ssh/id_rsa.pub

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;to show a short description about your desire command(whatis):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ whatis cat

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;for exit from terminal(exit):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ exit 
$ logout

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;locate a program file from Users file using which command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ which bash 

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;who is in the system to check by using whoami command:
&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
