#! /bin/bash help() { echo "Resets permissions of a directory. Make sure you know what you're doing first." echo "" echo "These are the commands it runs:" echo `color 3 'sudo chmod -RN && sudo chown -R && sudo chmod -R 755 '` echo "" echo "`color 2 Usage:` reset-permissions " echo "" } if [[ "$2" == '' ]]; then help else USERNAME=$1 DIR=$2 sudo chmod -RN "${DIR}" && sudo chown -R ${USERNAME} "${DIR}" && sudo chmod -R 755 "${DIR}" fi