Mysql Connecting to Any Arbitrary Port

I am on Linux virtual machine. My my.cnf file has port=3306 but I can connect mysql server from the command line using any port like
mysql -u root -p --port=3307 works fine
mysql -u root -p --port=5555 even works
I am really confused.

Popular White Paper On This Topic

I think the way you address the database - from a unix prompt - does not use ports since the database is on the local system, not on a remote one. You can monitor using "netstat -n" ... from another unix prompt on the same machine.