$ ls -lsa 4 -rw-r--r-- 1 denis 404 Jul 16 18:36 pgadmin.log
cmd+click on pgadmin.log
Sublime opens pgadmin.log (if path is 'pgadmin.log:12', it opens it and sets cursor to 12th line).
How to change the App, which opens the file?
I've checked my suggestion and it worked: if you try to open a file in Finder, this file will be opened with default Application, assigned to its extension. So, if you change default App for this file, you'll get it while opening file from Terminal by click.