Linux Workshop
Lab 9 Troubleshoot tools and locate files Requirements
Quick Reference Objectives to learn
➢ Running Linux ➢ findutils-locate package
Troubleshooting & Status tools
To Do
top
#Continuous cpuinfo, memory (M), tasks
watch cat /proc/meminfo
#Show memory every 2 sec. See free
vmstat
#Virtual memory statistics
cd /var/log; tail -f messages ...
#Show continuous logfile(s)
dmesg
#Show kernel ring buffer
less /var/log/dmesg
#Show bootlog messages (q for quit)
cat /var/log/boot.log
#Show bootlog messages
ps -aux ¦ less
#Show process status including PID's
watch df
#Show disk free space every 2 sec
fsck. /dev/sda1
#File system check
ps -aux ¦ less
#Show process status including PID's
ps -ef
1. Only for the Quick Reference commands which you are unfamiliar with:
pstree ¦ less
#Show process status tree using names
kill [-15] PID
#Kill process using a PID nr and signal: #1 HUP (hangup, reread config file)
Execute the Quick Reference commands to see the results.
#2 INT () #3 QUIT (core dump) #9 absolute KILL #15 TERM (default, close normally) killall [-15] processname
#Kill process using a processname
grub-install /dev/hda
#Inst. bootldr in MBR of master IDE-dsk
Locate files locate namepart
#findutils-locate package needed
updatedb
#Runs every night (cron job for locate)
find . -name *namepart*
#Find filenames with namepart in it #Starting in . (current directory)
find . -perm +6000 -uid 0
#Find any (+) 4000¦2000 perm. for root
find . -perm -2
#Find only (-) 'world writable bit'
Theory Modules LPIC 1 Certification Bible, isbn 0-7645-4772-0 ➢ p. 77-82 Managing processes (ps, top, nice) ➢ p. 248-251 Locating files ➢ p. 212-216 Checking the File System (fsck, df, du)
Extra References ➢ www.tldp.org
© October 2, 2005, wiki.novell.com/index.php/Roberts_Quick_References, author of Foundations of Linux networking