Sort by file size in Unix

October 16th, 2006

Sort by the 5th field, numeric, descending:

ls -l |sort -k5rn,5

Live Update Repair

October 11th, 2006

Search/replace in files using perl command line

August 15th, 2006

Here's a method for using a single perl command to search and replace for regular expressions in a file or multiple files

perl -pi -e s#orig text#replace text#g [filenames]

sshfs fstab entry

August 7th, 2006

Here's an example of a fstab entry for a sshfs mount.


# sshfs filesystems
# <file system> <mount point> <type> <options> <dump> <pass>
sshfs#username@remotesystem:/pub /mnt/pub fuse defaults 0 0

Ports - SSH Port Forwarding

August 7th, 2006

Here's some port numbers to remember:

VNC - 5900
Remote Desktop - 3389

ssh -l [remote user] -N -L [local port]:[target network machine name]:[target machine port] [target ssh machine]