Useful Linux commands

Display the program and owner of process that is running on the specified port.
Example showing what process is running on tcp port 22
[root]# fuser -v -n tcp 22

                     USER        PID ACCESS COMMAND
22/tcp               root       3155 f....  sshd
                     root      23414 f....  sshd
                     root      23416 f....  sshd

Do a recursive string replace in all files of a given extension
Example replace all instances of old.gif to new.gif in all the .html files
perl -pi -e "s/old.gif/new.gif/g;" *.html 

Show all shared directories that you can mount via samba on a windows machine.
smbclient -U [username] -L [windows box ip address]