Bash - Geek went Freak!

# Record memory and processor usage of a particular process using top

This small snippet of code will help you monitor the memory and processor usage of a process over time in the background and redirect the output to a file. You can later use the file to analyze its behaviour.

nohup top -d 180 -p 1310 -b > top-firefox.rec &


# Simple one-line script to convert toolchain prefix(ex: arm-linux- to arm-elf-)

This simple script helps you create symbolic links of your tool chain binaries with different prefix. For example, from arm-linux- to arm-elf-, etc.

for file in ls arm-linux-*; do new=echo $file | sed -e "s/arm-linux-/arm-elf-/"; ln -s$file \$new ; done;


Naturally, it only creates symbolic links. So your binaries with original prefix still exist! This simple one-line script always saves a lot of time, each time I install a new tool chain.