Skip to content

Instantly share code, notes, and snippets.

@bubbobne
Last active October 4, 2018 08:17
Show Gist options
  • Save bubbobne/5d140393e33975b8a28e51b90383ed98 to your computer and use it in GitHub Desktop.
Save bubbobne/5d140393e33975b8a28e51b90383ed98 to your computer and use it in GitHub Desktop.
bash
//rename
rename 's/pattern/new_string/' <files>
//upper-to-lower
for i in *; do mv $i `echo $i | tr [:upper:] [:lower:]`; done
//get apache user name
APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\ -f1`
//set permission
sudo chmod g+rw "$APACHEUSER allow delete,write,append,file_inherit,directory_inherit" ./logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment