Last active
November 9, 2023 00:27
Revisions
-
dev01d revised this gist
Nov 9, 2023 . 1 changed file with 20 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,26 @@ #!/usr/bin/env bash # ## ### Fix file pemissions ### dirs 755 files 644 ## # CWD="$(pwd)" echo -e "\e[1;25;33m\nFixes file and dir perms in current working directory\e[0m\n" read -p "Include hidden files (Y/n)? " answer case ${answer:-y} in y|* ) echo -e "\e[1;25;32m\nFixing Files (755)\e[0m" find $CWD -type d -exec chmod 755 {} \; echo -e "\e[1;25;32mFixing Files (644)\e[0m" find $CWD -type f -exec chmod 644 {} \; ;; n|N ) echo -e "\e[1;25;32m\nFixing Files (755)\e[0m" find $CWD -not -path '*/.*' -type d -exec chmod 755 {} \; echo -e "\e[1;25;32mFixing Files (644)\e[0m" find $CWD -not -path '*/.*' -type f -exec chmod 644 {} \; ;; esac -
Jason revised this gist
Aug 1, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ # ## ### Fix file pemissions ### dirs 755 files 644 and does not ignore dot files ## # echo -e "\e[1;25;91m\nThis includes dotfiles.\e[0m\n" -
Jason revised this gist
Aug 1, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ #!/usr/bin/env bash # ## ### Fix file pemissions -
Jason created this gist
Nov 30, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ #!/bin/bash # ## ### Fix file pemissions ### dirs 755 files 644 and ignores dot files ## # echo -e "\e[1;25;91m\nThis includes dotfiles.\e[0m\n" read -r -p "Are you sure? [Y/n] " response response=${response,,} # tolower if [[ $response =~ ^(yes|y| ) ]] || [[ -z $response ]]; then if [ "$1" == "" ] ; then echo -e "\e[1;25;91m\nPlease enter a valid directory path\e[0m\n" ; exit 1 else find $1 -type d -exec chmod 755 {} \; find $1 -type f -exec chmod 644 {} \; echo -e "\e[1;25;32m\nProbably good now.\e[0m\n" fi fi