Monday, January 18, 2010

System tools in Linux and Unix

These keep changing over the years, but here's a quick run down

Hardware related:

ethtool, mii-tool: view / set ethernet device settings and the MII settings

lspci: show PCI devices

lshw: show hardware

lscpu, lshal, lsusb: show CPU, HAL and USB information. Note the USB information is often the USB controllers on your M/B, not the devices actually hooked up.

Linux Kernel

lsmod , rmmod, modprobe: manage Linux kernel modules (which how most device drivers are loaded)

lsof, fuser: show processes using files/directories/file systems. Very useful if you want to unmount a disk, say a removable drive, and you are told the device is still in use. Note that if you run the samba SMB/CIFS file server, it will continue to use a filesystem if at anytime in the past a client used that file system. I restart samba in this case.

mount, umount: mount and unmount filesystems. A trick I often use is to remount a filesystem as read-only or read-write via
mount -o remount,ro /dev/... 
or 
mount -o remount,rw /dev/...
which is much faster than unmounting and remounting.

No comments: