Shell script to find difference in folders in Linux Directories
Here is a sample code to find the difference of folders between two directories in linux.
Example, consider that we have synched set of folder is /home and /backup, but old folders wont be deleted from backup when its deleted in home.
So find the folders that are in /backup and not in /home
for arg in $(ls /backup)
if [ ! -d /home/$arg ]
if [ -d /backup/$arg ]
echo "the folder $arg is not in /home "