Shell Script

How to Write Loop in Bash with Examples

bash for loop

How to make automation with bash for loop under Linux/UNIX operating system? How do I use break, continue and the parameter for loop control expression? How to act on files using for loop? For loop is a very useful tool [...]

Ahmed Abdalhamid 8:07 am

What is the Function of Shebang in Linux?

bash shebang linux

The #! characters form a magic number. We embed these magic number in any scripts under UNIX / Linux operating systems to tell the kernel what interpreter to execute, to read our script. Like Linux shell, Python, Perl and R [...]

Ahmed Abdalhamid 8:01 am

Shell Script to Backup Files / Directories Using rsync

rsync script

This article we bring shell scripts to backup your files / directories from you local linux machine to a remote linux server using rsync command. This would be an interactive way to perform backup , where you need to provide [...]

Yevhen Duma 5:00 am

First Step Guide to Learn Shell Scripting

myfirstshellscript screenshot

Usually when people say "shell scripting" they have on mind bash, ksh, sh, ash or similar Linux/UNIX scripting language. Scripting is another way to communicate with the computer. Using graphical windows interface (not matter windows or Linux) the user can [...]

Petras Liumparas 9:28 am

How to Show Dialog Box using Shell Script with Examples

This tutorial will give couple of examples on how to use utilities like zenity and whiptail in your Bash shell script to provide message / dialog box . With these utilities your script will be able to inform user about [...]

Ilija Lazarevic 6:00 am

How to Backup MySQL Database using Bash Script

Regular backup of mysql databases are also as important as backing up your code. So I wrote this script to backup all of my databases on local disk. I then added gzip to compress the sql file to save disk [...]

Deep 4:46 am

How to Delete Empty Directories using Script

This article we show how to search for search empty directories and delete them using shell scripting. If the system administrator doesn't want to keep empty directories, this script can quickly remove all of them. You can input the path where you need [...]

Bobbin Zachariah 9:11 am

How to Check File Exists under Directory Path using Script

This Shell script helps to check if the specified file exists under a given path. The script will prompt you to provide file name and directory path. Check File Exists - Shell Script #!/bin/bash #We tell user that he need to [...]

Bobbin Zachariah 6:25 pm

How to Find and Delete Duplicate Files using Script

This shell script will look for duplicate file names within sub directories and prompt to delete. If md5sum of the files same then we conclude its duplicated. This helps system administrator to delete unnecessary copy to reduce used space. The script will [...]

Bobbin Zachariah 10:00 pm

How to Find Largest Directories using Shell Script

This script is very useful if a user needs to quickly clean up space and it helps to check which directories take most of space and the delete according to your wish. Below shell script shows X number of directories that [...]

Bobbin Zachariah 7:37 am

Shell Script : Backup MySql Databases In Compressed Format

This shell script will create dump of all databases from mysql server. Allow system administrator to have backups of all databases. The output would be in a tar.gz zipped format. Script is using mysqldump and tar command for this purpose. [...]

Bobbin Zachariah 9:14 am

How find IP Address using Bash Script from Linux Servers

This shell script can used to find ethernet interface details and ip address /subnet mask assigned from multiple servers. Script will also display interface name even if no ip address is set. Make sure you have authorized keys set so [...]

Bobbin Zachariah 8:41 am

How to Create Mysql User in Interactive Way using Script

This shell script helps user to create a user in mysql database, when someone doesn't know about mysql, but need quickly add new user. The user should have passwordless access to mysql to run this script Add Mysql user via [...]

Bobbin Zachariah 9:49 am

Linux Shell Script To Monitor Ftp Server Connection

Main goal of this script is to monitor ftp server. This script is example of how to use ftp command in bash shell. System administrator can use this script to check if ftp server alive and upload there any data/backups. [...]

Bobbin Zachariah 8:21 pm