Useful Terminal Commands

you have to keep the database up to date though, which becomes tedious
 
updatedb && locate whatever

If you do this every once in a while it should take less than a second. You can alias it in .bashrc
alias locate='sudo updatedb && locate'
 
think i read this somewhere on these forums, but lazy unmount is awesome

umount -l /mnt/durp

Im too lazy to google, what does lazy unmount do?

Code:
top
For process list and to see whats wasting process`s.

Code:
iptraf

To see the bandwidth ho`s on your network

Code:
rsync

For backups

Code:
ssh -C2qTnN -D 8080 username@remote_machine.com
Create a socks5 local proxy to bypass most corporate and country firewalling restrictions :D
 
Im too lazy to google, what does lazy unmount do?

Code:
top
For process list and to see whats wasting process`s.
umount -l = Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4.11 or later.)

Basically if you are in a mounted dir for example you will not be able to unmount that device until you cd out of that dir. Lazy umount unmounts anyway and if you close that session in the future it just cleans up after you, ie, it does not wait on the device or references to the device to be ready, it unmounts immediately and cleans up later.

You should replace top with htop, top on steroids, try it out.
:)
 
ps ax | grep screen | grep -v grep

removes the grep process from the grep-ed process list. Helps to check if process are still running and restart them if they arent.

in this case im looking if screen is running
 
Last edited:
ps ax | grep screen | grep -v grep

removes the grep process from the grep-ed process list. Helps to check if process are still running and restart them if they arent.

in this case im looking if screen is running
I don't know exactly why, but this will do the same:
Code:
ps ax | grep [s]creen
 
updatedb && locate whatever

If you do this every once in a while it should take less than a second. You can alias it in .bashrc
alias locate='sudo updatedb && locate'

Or set up a daily cron job. Ubuntu does it by default methinks. :)
 
Top
Sign up to the MyBroadband newsletter
X