Linux Fun Stuff

Finding Files

grep -l "test" /usr/bin/work* This finds all files in /usr/bin/work* that have the word "test" in the file

grep -d recurse -l "workm" /* This finds all files in the hard drive that have the word "workm" in the file.

find / -name "b-edge.???" -print This finds all files starting at / that are named "b-edge" and have a 3 digit file extension

Network Setup Files

/etc/sysconfig/network-scripts/ifcfg-eth0 or /etc/sysconfig/network-scripts/ifcfg-eth1
/etc/sysconfig/network

Finding Network Information

nmap -sP 192.168.100.0/24 - This finds all network addresses on the 192.168.100 subnet using ping

nmap -sT 192.168.100.0/24 -p 9100 - This finds all network addresses with port 9100 open on the 192.168.100 subnet.

Web Based Commands

nslookup -sil www.ci-inc.com returns the DNS server that you used to lookup the address and the actual IP address of the server.

dig www.ci-inc.com DNS Lookup Utility- returns CNAME and A records

host www.ci-inc.com DNS Lookup Utility - returns IP address and alias.

Hard Drive Usage

du -h --max-depth=1 | more This returns the size of each folder (and it's contents) in this directory. Useful for finding where all that hard-drive space is going.

List installed packages

rpm -qa
rpm -qa | grep libjpeg-devel

All things cron, stop & start service and list items:

service crond stop
service crond start
crontab -l
0 20 * * 1,2,3,4,5 workm "-k"

Restarting Print Queue

/etc/init.d/cups stop
/etc/init.d/cups start