Welcome to my cheat sheet

You will find here things that don't have a place yet in this wiki.

As always in a wiki everybody can add some valuable knowledge.

simple commands

copy a file and keep the rigths

cp -pfr

size of an egg

where egg is a file or a directory

du -sh egg

uuid

Universally Unique Identifier

ls -l /dev/disk/by-uuid/

(for reference, blkid -s UUID and blkid -s UUID -o value /dev/sda1 would be the canonical way).

other commands

hard disk check

touch /forcefsck
reboot

hard disk capacity

fdisk -l | grep -iE 'mb|gb|tb' 

find . -name "*" -exec grep -Hn "spam" {} \; | grep -v svn 

This doesn't display all the svn revisions

(or just use grep . "spam" -R)

¿Cómo ejecutar un script como root al inicio?

Found on a wikipage I have deleted.

I will try to put it back in a more appropriate page

    Escribe el script que quieres que se ejecute en el /etc/init.d
    cambias los permisos a 755 como root:
    chmod 755 /etc/init.d/script
    Luego con el comando update-rc.d haces lo siguiente como root:
    update-rc.d /etc/init.d/script start 20 2 3 4 5 . stop 20 0 1 6 .

note: any script in /etc/init.d should be an init script (!), see /etc/init.d/README. The proper way to execute a script when the system is started is to call that script from /etc/rc.local