Bash Useful Examples

A collection of simple Bash scripts.

Getting Started

  1. Hello.sharrow-up-right: get a simple output

  2. Process.sharrow-up-right: execute more than one command in a script

  3. Interactive.sharrow-up-right: a simple but very much interactive script

  4. Special-Pattern.sharrow-up-right: draw a diamond pattern with dots(.)

  5. While-Read.sharrow-up-right: read lines from a file using while loop

  6. Read-Menu.sharrow-up-right: display a menu for system information

  7. While-Menu.sharrow-up-right: a repeated menu for system information

  8. Affect.sharrow-up-right: print a spinner loader

  9. Colorful.sharrow-up-right: provide you with the output of several colours

  10. Convertlowercase.sharrow-up-right: convert data either from the file or standard input to lowercase

  11. up.sharrow-up-right: move up a directory in shell script

  12. List-dir.sharrow-up-right: list files in a directory

  13. Count-lines.sharrow-up-right: print out the line number of each file in current directory

  14. Randomfile.sharrow-up-right: create unique file/folder automatically with date and time stamp

  15. Random-emoji.sharrow-up-right: print ramdom emojis

  16. pomodoro.sharrow-up-right: a simple pomodoro app written in bash

Programming

  1. VersionCompare.sharrow-up-right: compare two version number

Utility

  1. Encrypt.sharrow-up-right: encrypt a file/folder with password

  2. Archive-and-encrypt.sharrow-up-right: archive a path into a file and encrypt the file

  3. weather.sharrow-up-right: check the weather in a specified location or using the geolocation of the ip address by default.

  4. WhereIP.sharrow-up-right: Get location of an IP address.

System Administration

  1. DirectorySize.sharrow-up-right: output a specified directory's size

  2. Test-File.sharrow-up-right: evaluate the status of a file/directory

  3. Server-Health.sharrow-up-right: report server related information

  4. CPU.sharrow-up-right: report if CPU usage exceeds the threshold

  5. Disk-Space.sharrow-up-right: check if the disk space crosses the limit

  6. CollectNetworkInfo.sharrow-up-right: gather information related to server

  7. RemoteBackup.sharrow-up-right: backup a local file into a remote server

  8. HardwareInfo.sharrow-up-right: show hardware information for systems Linux

  9. Get-Temperature.sharrow-up-right: show CPU temperature

Math

  1. Addition.sharrow-up-right: perform addition of two numbers

  2. Subtraction.sharrow-up-right: perform subtraction of two numbers

  3. Multiplication.sharrow-up-right: perform multiplication of two numbers

  4. Division.sharrow-up-right: perform division of two numbers

  5. Simplecacl.sharrow-up-right: a simple calculator

  6. Table.sharrow-up-right: print table of any number

  7. EvenOdd.sharrow-up-right: check if a number input from standard input is odd or even

  8. Factorial.sharrow-up-right: generate the factorial of a number

  9. Armstrong.sharrow-up-right: check if a provided number is Armstrong or not

  10. Prime.sharrow-up-right: check if a number is prime or not

  11. Fibonacci.sharrow-up-right: test if a number being entered is a Fibonacci or not

  12. Decimal2Binary.sharrow-up-right: convert Decimal Number to Binary

  13. Binary2Decimal.sharrow-up-right: convert Binary Number back to decimal

  14. Decimal2Hex.sharrow-up-right: convert Decimal Number to Hex

  15. Hex2Decimalarrow-up-right: convert Hex number back to Decimal

Image manipulation

  1. thumbnail.sharrow-up-right: create 400px thumbnails from images in a folder

Last updated

Was this helpful?