April 4th, 2007 ··· andarius
A few handy tid bits of shell commands to help one allong!
To get the date of yesterday:
date --date='1 day ago' +%d%b%y
To get your IP address for all interfaces (including lo):
/sbin/ifconfig | grep "inet addr" | cut -d ":" -f 2 | cut -d " " -f 1
To get a single interface IP address (replace $interface with the one you want):
/sbin/ifconfig $interface | grep "inet addr" | cut -d ":" -f 2 | cut -d " " -f 1
Take a screen shot:
xwd -root -out screenshot
or
import -window root -quality 100 pic.jpg
If using xwd you can view it with xwud the Gimp and many others. To get a single window try:
xwd -out windowshot
or
import -quality 100 windowshot.jpg
Convert an image from one format to another, replace original and new with the file names and format with the format (.jpg, .bmp or whatever) you want:
convert $original.format $new.format
Get the label from a CD:
dd if=/dev/cdrom bs=1 skip=32808 count=32 2>/dev/null | cut -b -32
Leave a Reply







