netstat -an |grep :80 |wc -l

Show how many active connections there are to apache (httpd runs on port 80)

mysqladmin processlist |wc -l
Show how many current open connections there are to mysql

grep User /usr/local/apache/conf/httpd.conf |more
This will dump all lines that match User from the httpd.conf, then print the results to your screen one page at a time.

last -a > /root/lastlogins.tmp
This will print all the current login history to a file called lastlogins.tmp in /root/

tail -10000 /var/log/exim_mainlog |grep domain.com |more
This will grab the last 10,000 lines from /var/log/exim_mainlog, find all occurances of
domain.com (the period represents ‘anything’,
– comment it out with a so it will be interpretted literally), then send it to your screen
page by page.

history|awk ‘{print $2}’|awk ‘BEGIN {FS=”|”} {print $1}’|sort|uniq -c|sort -rn|head -10
This will show you the 10 most used commands. (Exp: ls, cd, etc)

scp /my/file myaccount@anothermachine:/path/to/where/i/want/the/file

To send a local file to a remote machine. To receive one:

scp myaccount@anothermachine:/file/i/want /my/file
And we should have successfully received the file.

httpd -v
Outputs the build date and version of the Apache server.

httpd -l

Lists compiled in Apache modules

httpd status

Only works if mod_status is enabled and shows a page of active connections

service httpd restart
Restarted Apache web server

mysqladmin processlist
Shows active mysql connections and queries

mysqladmin drop database
Drops/deletes the selected database

mysqladmin create database
Creates a mysql database

mysql -u username -p password databasename < data.sql
Restores a MySQL database from data.sql

mysqldump -u username -p password database > data.sql

Backup MySQL database to data.sql

echo “show databases” | mysql -u root -p password|grep -v Database
Show all databases in MySQL server.

mysqldump -u root -p password database > /tmp/database.exp

Dump database including all data and structure into /tmp/database.exp