Find Large Files Nov 8, 2012 Find Large Files find /var/www -type f -size +10240k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }' Find top 50 largest directories du -x
Create Swap File Nov 8, 2012 Create Swap File #!/bin/bash -e # Set default variable values : ${SWAP_SIZE_MEGABYTES:=1024} : ${SWAP_FILE_LOCATION:=/var/swap.space} if (( $SWAP_SIZE_MEGABYTES <= 0 )); then echo
Find Directories & Add Group Sticky Bit Nov 8, 2012 Find Directories & Add Group Sticky Bit Probably make another post explaining what a sticky bit is and how itβs used, but for now Iβm giving you just the code
Output Directories to Shell Nov 8, 2012 Output Directories to Shell find . -maxdepth 99 -mindepth 1 -type d -printf %P\\n ls -1l | grep '^d' | awk '{print $8}' find ./ -type d find
CHMOD Directories Only Nov 8, 2012 CHMOD Directories Only Change UNIX permissions on directories only. find . -type d -print0 | xargs -0 chmod 755