Usefull linux commands (ongoing)

These are just commnads i had to hunt for in linux and want to remember for possible later use.

this will show the last 10 lines of a file (messages in this example) and monitor the file for changes, press ctrl-c to exit

tail -f /var/log/messages

create a loop file (replace 1024 with the size in MB)

dd if=/dev/zero of=loop_filename bs=1M count=1024

mkfs.ext3 -F loop_filename

Check fragmentation of XFS filesystem (50% is not bad really, change sda6 to your xfs partition)

xfs_db -c frag -r /dev/sda6

Kill a stubborn process, #### is the process id (PID)

kill -9 ####

Leave a Reply