Useful Linux Commands

vi /etc/sysconfig/network  :: change the network name of a server

vi /etc/resdv.conf :: add in dns servers

rm -rf <dir> :: remove a directory, regardless if it has stuff in it

dmesg :: display hard drive / volume info

df -h :: get mount point info / usage

/usr/bin/system-config-network :: configure network IP/subnet

iostat -d -x :: get IO usage information

iostat %tm_act <mount point> <seconds> <intervals> (example iostat %tm_act 1 10) : show useful IO information, such as wait time, usage, idle time and so on.

ps -eo pcpu,pid,user,args | sort -k 1 -r -h | head -10 :: show me the 10 top resource hogs

mpstat -P ALL :: get cpu usage

fdisk -l :: volumes

du -ch :: display folder sizes from current location

ln <real file> shortcut :: create a hard link, ln -s makes a soft link

cp -p <file> <destination> :: copy a file, preserve permissions

rpm -ivh <package> :: install a package

rpm -qa :: show all installed packages, add --last for last installed packages

rpm -qi <package> :: get more info on a package

rpm -Uvh <package> :: upgrade a package

rpm -ev <package> :: uninstall a package

fuser -m /dev/mount :: find out who/what is using a particular drive

cat /proc/cpuinfo :: what cpu's are installed

lspci -v :: list pci devices

sar :: show me IO history

tar -cf <filename> <items to tar> :: create tar archive (does not compress)

gzip <filename.tar> :: create gzip -- use -1 for fastest or -9 for best.

mount -o remount / <enter> vi /etc/fstab :: if you boot linux without something it expects, you get a "superblock" error ...this allows you to fix that.

mount - l /location :: device busy?  try the -l

Network Goodies

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Like the description says, at my core, I'm a scientist and engineer.  I came from humble beginnings on a 486DX2 Packard Hell playing doom2 on IPX to in a small time retail shop and got into hardware (ISO layers FTW!) and it was all downhill from there.  I'm infinitely curious about almost everything and always wanting to know.

According to personality tests (real ones) I classify under "Rational" more specifically, a Fieldmarshal.  I think there's something to that.

Some of the stuff I'm currently into/researching...

Sitefinity

Ninject

Subsonic 

Currently working on ...
i did the hundred


and some extra stuff

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's, their brother, their dog, cat, ferret nor gold fish's view in anyway.  At all.  Ever.

© Copyright 2007-2009