Skip to content

Instantly share code, notes, and snippets.

@gpspake
Last active September 8, 2015 15:14
Show Gist options
  • Save gpspake/ed5c1aef7cf888c0ee95 to your computer and use it in GitHub Desktop.
Save gpspake/ed5c1aef7cf888c0ee95 to your computer and use it in GitHub Desktop.
Examples and stuff

#ACL's ###Check ACL's getfacl directory ###Set Recursively (And by default) setfacl -Rm u:gpspake:rwx,d:u:gpspake:rwx html

#ls -la on cd

function cd() {
   new_directory="$*";
   if [ $# -eq 0 ]; then
     new_directory=${HOME};
   fi;
   builtin cd "${new_directory}" && ll
}

#Apache ###Check modules (And grep for specific) apachectl -t -D DUMP_MODULES | grep rewrite

###graceful apachectl graceful

###zmv autoload -U zmv

to lowercase
zmv -o-i '(**/)(*)' '$1${2:l}'

replace spaces with hyphens
zmv -Qw '**/*(.)' '$1${(L)2// /-}'

###find stuff write directory contents paths to file recursively
find . > list.txt
also
find Downloads | xargs -I {} echo "$PWD/{}"
or
find . -exec ls-lh {} \; | awk '{print $5 " : " $9}' > list.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment