// you’re reading...

tech

Unix Shortcuts

Copy files with tar:

tar cf - * | ( cd /target; tar xfp -)

Backup and a restore a mySql database:

mysqldump -u username -ppassword database_name > FILE.sql
mysql -u username -ppassword database_name < FILE.sql

Figure out which process is “grabbing” a drive you want to unmount (from Donncha):

# umount /media/disk/  <br/>
umount: /media/disk: device is busy  <br/>
# fuser -m /dev/sdc1  <br/>
/dev/sdc1: 538  <br/>
# ps auxw|grep 538  <br/>
donncha 538 0.4 2.7 219212 56792 ? SLl Feb11 11:25 rhythmbox  <br/>

Sometimes when pasting code in vi, it over-indents. Vim.org has the answer for this:

All you need to do is “set paste”, then paste your stuff, and then “set nopaste” again.

Discussion

No comments for “Unix Shortcuts”

Post a comment