Forget / forgot / cannot remember root password

On a FreeBSD server 1. reboot server 2. choose to boot into single user mode 3. mount -o rw <root partition> e.g. mount -o rw / 4. passwd <root account> e.g. passwd root 5. mount -o ro <root partition> e.g….

sed with multiple criteria

sed -e 1d -e 50d -e ‘/junks/d’ would remove first and 50th line & any line(s) with the word “junks”. update 20080821 : sed -e ‘/^$/d’ would remove every empty line