Showing posts with label command line. Show all posts
Showing posts with label command line. Show all posts

Wednesday, September 23, 2009

Ping doesn't cut it for connectivity testing

A failed ping only means that the ping failed, doesn't tell you much about the connectivity.

On some twitter discussion today I was reminded of how often people use the ping command to test for connectivity, what a lot of people don't know, is that ping is just another service, and can be disabled or blocked, -as it has become more frequent these days-, rendering this method useless, on top of that, more often than not you need to test connectivity to a specific service; a much better approach is to use telnet. Using telnet you can actually test not only that there is connectivity, but that you can reach the desired port.

Some frequently used ports:

20, 21 Standard FTP
23 Telnet default
25 SMTP
80 Standard web
115 SFTP
443 Standard secure web
139 NETBIOS (file and printer sharing in Windows)
143 IMAP
445 SMB (to connect to Windows from other OSs)


an example of testing if you can access the web on some ip:
telnet 192.168.1.2 80

when the connection succeeds, you usually just get a black screen, with the cursor staring at you, if the connection fails, you will get an error message

As a final note, in case the connection fails, you might want to use tracert -d [ip address] to get more details of why the connection fails

Tuesday, July 29, 2008

Recursively delete .svn folders the easy way

you can really use this to delete any given folder that you need to delete recursively, but I needed this today, and google only gives me the answer for linux, and some strange solutions to do the same in windows.

here's a simple solution that works from the command line (the easy way, right?):

for /f "usebackq" %d in (`"dir *.svn /ad/b/s"`) do rd /s/q "%d"

more than anything I know I will need this in the future, so here it is for me, hoping that it can help someone else out there J