Monday, May 18, 2009

change mac address

ifconfig eth0 hw ether 00:11:22:33:44:55


changes are valid until system is rebooted.

change file extension of all files in a dir of a certain type to another type

for f in *.jpg; do mv "$f" "${f%.jpg}.bmp"; done

Make a directory named with the current date

mkdir `date --iso`

yank argument from previous command

alt + 3 .
yank 3rd argument from previous command

write function for bash

function anyfunction() { ls && cd /home; }

List all system users

$~

List top ten files/directories sorted by size

du -sb *|sort -nr|head|awk '{print $2}'|xargs du -sh

for full list

du -s *|sort -nr|cut -f2|xargs du -sh