Skip to content

Instantly share code, notes, and snippets.

@sidanand67
Created September 29, 2021 03:13
Show Gist options
  • Save sidanand67/0799fa908ff7ae1f44f86cf02aed5e7b to your computer and use it in GitHub Desktop.
Save sidanand67/0799fa908ff7ae1f44f86cf02aed5e7b to your computer and use it in GitHub Desktop.
Script for changing linux file permissions in a directory
#!/bin/bash
echo "Changing permissions..."
for entry in "$search_dir"./*
do
if [[ "$entry" == *.sh ]]; then
continue
elif [[ -d $entry ]]; then
chmod 755 $entry
elif [[ -f $entry ]]; then
chmod 644 $entry
fi
done
echo "...Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment