Nitche bash commands to use

I use a lot of scripting for my daily stuffs. I had listed a collection of commands that are useful to me and guess is useful to everyone else reading this blog.
The stuffs below are collected from different sources but i have tested them for working conditions.
If there are any other ways of doing the same thing, please comment.

1. Connect via ssh using mac address
    ssh root@'for ((i=100; i<=110; i++));do arp -a 192.168.1.$i; done | grep 00:35:cf:56:b2:2g |
    awk '{print $2}' | sed -e 's/(//' -e 's/)//

2. Show directories in the PATH, one each line
    echo $PATH | tr \: \\n

3. Check your unred yahoo mail with wget
    wget -q -O - --load-cookies=cookies.txt "http://uk.mc267.mail.yahoo.com/mc/showFolder?
    fid=Inbox&order=down&pSize=25" | sed 's/<[^>]*>/\n/g' | grep '.' | awk '/^Unread$/,/KB$/' |
    grep -v '&nbsp' | sed 's/^Unread$/===============/'

4. Rip VCD
    cdrdao read-cd --device ATA:1,1,0 --driver generic-mmc-raw --read-raw image.toc

5. Check your gmail from the command line
    curl -u username --silent "https://mail.google.com/mail/feed/atom" |
    perl -ne 'print "\t" if /<name>/; print "$2\n" if /<(title|name)>(.*)<\/\1>/;'

6. Remove html tags from a file
    sed 's/<[^>]*>//g' index.html
   
7. Make ISO file using the dd command
    dd if=/dev/cdrom of=output.iso

8. Watch the load average of your computer
    watch 'cat /proc/loadavg'

9. List all harddisk partitions
    fdisk -l |grep -e '^/' |awk '{print $1}'|sed -e "s|/dev/||g"

10. Reinstall Grub
    sudo grub-install --recheck /dev/sda1

11. Flash emergency signals from your computer
    while true; do xset dpms force off; sleep 0.3; xset dpms force on; xset s reset; sleep 0.3; done
   
12. Scan all active ip addresses in your network
    arp-scan -l   

Posted via email from Linux fanatic

0 comments:

Copyright © 2008 - nepabuntu - is proudly powered by Blogger
Smashing Magazine - Design Disease - Blog and Web - Dilectio Blogger Template