du -smch * | sort -h | tail
find ./ -type f -exec md5sum {} + | grep '^checksum' | cut -d '/' -f2
find ./ -type f -exec md5sum {} + | grep '^checksum' | cut -d '/' -f2 | xargs rm
find ./ -type f -size 0
find ./ -type f -size 0 -delete
... directories of zero size find ./ -type d -empty
echo $?
echo -n "WHat is your name"
read -e NAME
echo "Your name is $NAME"
if [ $NAME = "php" ]
then
php -i
fi
http://wiki.bash-hackers.org/howto/conffile
for d in */ ; do
echo "$d"
done
for ((n=0;n<10;n++)); do some_command; done
foldername=$(date +%Y%m%d)
check=$(date +"%Y-%m-%d-%H:%M:%S")
Note mac sed is not the same as Linux - install gnu-sed with Brw
sed -i "s/pattern/replace/" filename
if using mac
gsed -i "s/pattern/replace/" filename
brew install gnu-sed
brew install wget
edit /root/.bashrc
add:
PS1='\[\e[1;31m\][\u@\h \W]\$\[\e[0m\] '