lsdev lsdev, lsusb, lspci cat /proc/devices cat /proc/scsci/scsi ls -lah /proc/kcore cat /proc/kcore ‘cat /proc/interrupts’ for which device is using which interrupt, also try ‘fdisk -l /dev/?d?’ for hard drive info, the ls /dev’
Category: Linux/Unix Tips and Tricks
Creating a YUM Repo
Install the create repo package # yum install createrepo Make a directory for your repo mkdir -p /local/mrepo/RedHat5_X64_09_2014 Copy your rpms in to the new directory cp -p *.rpm /local/mrepo/RedHat5_X64_09_2014 Run the createrepo command to make the repo. createrepo /local/mrepo/RedHat5_X64_09_2014…
Working with files names that have spaces and special characters
Sometimes you need to work with multiple files that have spaces in their names. To do this you can backslash the special characters (\) or put quotes around their names..If you use filename completion, it should backslash the characters for…
Finding deleted logs
Often people will delete log files that are still open. Sometimes it is necessary to look at the logs that have been deleted. It takes a little investigation, but can done. The first thing to do is to…
Adding swap file to Linux
If there are no free partitions on a disk, you can create a swap file. Here is how you add a 12GB file. # Check what you have for swap. We have one 4GB swap partition. server# swapon -s Filename …
Identifing Linux disks
Identify scsi disk paths – Mapping Devices for disk in ‘/dev/sd*[a-z]’; do printf “%s %s\n” “$(basename $disk)” “$(scsi_id -p 0x83 -gs /block/$(basename $disk))” done
Truncating file name at – or .
HOST=bob-n.fsprings.com echo ${HOST%%[-\.]*}
better df formating
df -P will provide 1 line per mount-point df -h -P will give human readable sizes (MB, GB, …) df -hP|column -t Will allign the output in columns