/my-shell-scripts

Collection of shell scripts and templates for quick reference

Primary LanguageShell

My-Shell-Scripts

Collection of shell scripts and templates for quick reference

Few Real life scenarios where shell scripts can be used :

  1. Write a shell script to find and kill all the zombie processes
  2. Find the first 10 biggest files in the filesystems and write the output to a file
  3. Shell script to gracefully unmount a disk
  4. Shell script to send email
  5. Shell script to monitor CPU, Memory and Disk Usage and send the output to a file in table format
  6. Shell script to find the files created and its sizes. It should accept the number of days as input, or a from and to date formats as inputs.
  7. Shell script to get a list of users logged in by date and write it to an output file
  8. Shell script to copy files recursively to remote hosts
  9. Shell script that displays the number of failed login attempts by IP address and location
  10. Shell script to parse a log file and forward a specific value with a timestamp to an output file

Some others from DevOps perspective

  1. Shell script to reverse a string
  2. Parse a login desired format and find all occurence of a word
  3. Shell script to send first ten lines of a file to another file
  4. Merge two files and write the output to the third file
  5. Find all duplicate strings in a file and replace it with another string
  6. Find all the IP address from a log file and write it to another file
  7. Get a list of apis from the text file, ping each api. If 200 OK, move on. Otherwise catch any error and move on (See if this is possible in shell scripting)