pkg command

I‘m a new FreeBSD Unix system user. How can I find out the process/programs names listing on a certain port on a FreeBSD Unix systems using command line? How do I lookup the process which is currently bound to the given network port on a FreeBSD server?


I need to send a few reports everyday as a mail attachment. I’m using FreeBSD 6.2 server. How do I send mail from a command line or a shell script?