Reference

Reference Command Line

Command Line

OtherEvergreenPublic

ack tree

Find

find /var/www -name \*.gif -name \*.jpg
find /var/www -name \*.gif -o -name \*.jpg
find /var/www -name \*.gif -size +5k -size -10k -ctime +90 -ctime -180 -printf "%10s  %c  %p\n"
find /var/www -name \*.gif -o -name \*.jpg
find /var/www -cmin -10 -printf "%c %p\n"
find /var/www -cmin -10 -type f -printf "%c %p\n"
find / -name *.gif
find / -iname *.gif

cd /var/www/vhosts/myserver.com/httpdocs/
grep "<div id=\"left\">" *.php
grep -r "<div id=\"left\">" .
grep "<div id=\"left\">" `find . -name \*.php -ctime -14`


cd /var/www/vhosts/myserver.com/httpdocs/
tar czf /tmp/backup.tgz .

tar cfz /tmp/backup.tgz `find . -type f -ctime -1`

tar tfz /tmp/backup.tgz

tar xfz /tmp/backup.tgz ./index.php ./test.php
tar xfz /tmp/backup.tgz

cd /var/www/vhosts/myserver.com/httpdocs/
zip -r /tmp/backup.zip .
zip -r /tmp/backup.zip `find . -type f -ctime -1`
unzip -l /tmp/backup.zip
unzip /tmp/backup.zip test.php
unzip /tmp/backup.zip


mysqldump --user="username" --password="password" --add-drop-table database > /tmp/db.sql

cat /tmp/db.sql | mysql --user="username" --password="password" dbname
mysqlimport


tar czf /tmp/backup.tgz . /tmp/db.sql

df -h
du -h –max-depth=1

tail -f /srv/www/{web1,web2}/logs/access.log
# will tail both /srv/www/web1/logs/access.log and /srv/www/web2/logs/access.log