Using iostat you can monitor disk load on a specific device.
iostat -dx {device name} 2 10
Examples:
iostat -dx /dev/sdc 2 10
The 2 is the interval and the 10 is the number of iterations. So you will see stats every 2 seconds for 10 iterations.
Using iostat you can monitor disk load on a specific device.
iostat -dx {device name} 2 10
Examples:
iostat -dx /dev/sdc 2 10
The 2 is the interval and the 10 is the number of iterations. So you will see stats every 2 seconds for 10 iterations.
The following is handy if you need to delete files older than X on a Linux server. I like to run the find command first before actually moving or deleting the files. Just to make sure the files I want to remove are returned from the find command.
find /fullpath -mtime +4 -ls
The -ls flag will list out the details of the file so you can verify that the mtime parameter returns the right files.
find /fullpath -mtime +4 -ls -exec mv {} /destination ;After you verify that the find command returns the files you want then you are ready to use the -exec flag on the find command to actually execute the move/delete. I also like to use full path here on the find command, just to make sure I move the right files.
So that took longer than it should. There is a command called whatis that gives you a single line description of a command:
whatis grep
grep (1) - print lines matching a pattern
grep (1p) - search a file for a pattern
grep (rpm) - The GNU versions of grep pattern matching utilities
A nice little tool to use. I just installed CentOS 5 in a VM and noticed that all my whatis commands were returning nothing appopriate…I quickly found the makewhatis command on some articles but could not locate it for CentOS 5 at first. Finally found the location:
/usr/sbin/makewhatis
This command builds the database and now my whatis commands are working.
#Top (X) Memory Consumers
#just change the head command to see more, this will show you top 10
ps -auxf | sort -nr -k 4 | head -10
#Top (X) CPU Consumers
#just change the head command to see more, this will show you top 10
ps -auxf | sort -nr -k 3 | head -10
#uptime:
uptime
output: current time, how long system has been running, how many users are logged in, system load averages for past 1, 5, and 15 minutes
#Version info
uname -a
cat /etc/redhat-release
cat /etc/issue