Mittwoch, 17. Juli 2013

Mercurial: recursively remove all class files

Assuming you have erroneously added some .class files to your hg repo and want to get rid of them:

  hg rm "glob:**/*.class"

(as always, StackOverflow provided the answer - see http://stackoverflow.com/questions/4828211/how-do-i-recursively-remove-folders-from-mercurial-tracking-system )

Finding the process belonging to a given TCP/IP port

Finding the process that listens on a given TCP/IP port isn't too hard, but of course, each O/S insists on doing it differently.
Some possible approaches for different operating systems (examples for local GWT server listening on port 8888):

Mac OS X
sudo lsof -i TCP:8888

Windows
netstat -ano | findstr 8888

Linux
netstat -ano | grep 8888

I'm sure there exist more elegant solutions, but these work for me :-)