5 Shell Scripts for Linux Newbies to Learn Shell Programming – Part II

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

89 Responses

  1. mithran says:

    Hi, what does cut -d % -f1 represent?

  2. Just_A_Newbie says:

    Hi! Thanks for this article. It is very useful. However, I have found that for Centos6 or Centos7, you have to add "\" into the command for the Colourful Script to activate the -e command.

  3. Amit Alone says:

    ### Below is the decryption script####

    echo "Welcome, I am ready to decrypt a file/folder for you"
    echo "currently I have a limitation, Place me to the same folder, 
    where a file to be decrypt is present"
    echo "Enter the Exact File Name with extension"
    read file;
    gpg -d $file > decpt.txt
    echo "I have decrypt the file successfully..."
    echo "Please confirm should we remove the original file. Please answer in Y or N"
    read answer
    if [ "$answer" == Y ];
     rm -rf $file
     echo " We have removed the file successfully..."
     echo "Thank You."
  4. qazi abid says:


    Actually I tried file encrypt script but when I execute the code it gives me error. Can you please send me how to do it will really appreciate your help.

    Thank you

  5. Petterock says:

    You can try this.

    #Creador Alfredo Pettengill – Rollout-IT

    df=”$(df -hP | egrep ‘^/dev/’ | awk ‘{ print $6 “_:_” $5 }’ )”
    CPU=”$(top -bn1 | grep load)”
    free=”$(free -mt | grep Mem: )”
    if [[ “$df” > “$THRESHOLD” ]]

    mail -s ‘Disk Alert ‘$hostname’ ‘ [email protected] << EOF
    Server Disk Space $hostname. Usado:


    —Server RAM Memory—

    Total Used Free Shared Buffer Cache

    —Server CPU usage—


    —Loggin Users—


  6. Francesco says:

    Hi, good article. Perhaps when you are searching for OOM messages it is better to search the string “Out of memory” as with “kill” you would find more output then required.

  7. Dede says:

    A friend show me a website named UsiScript (http://www.usiscript.com). It’s a tool that help you to create a bash script, even you don’t know the syntax. It’s simple and fast.

  8. mandeep says:

    You all guys are the best….
    One request to all of you pls explain every field in script for more understanding to the readers.
    Thank you all.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.