The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can we launch a shell script automatically upon ssh login? rockysfr UNIX for Advanced & Expert Users 1 07-02-2007 11:48 PM
How can my unix shell script automatically connect to remote host? digdarshan Shell Programming and Scripting 8 06-30-2007 12:44 AM
check in unix shell script so that no one is able to run the script manually adi_bang76 Shell Programming and Scripting 1 11-16-2006 10:43 AM
need help to write script to check the process health and automatically restart it dragondad Shell Programming and Scripting 1 10-31-2006 06:16 PM
Check open ports every ... MorchiuS Shell Programming and Scripting 2 08-03-2005 05:17 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-12-2008
arsonist arsonist is offline
Registered User
  
 

Join Date: May 2008
Posts: 7
Script to automatically check ports in shell?

Good day,

I'm new to linux environment...Is there any scripts available for me to check ports (lets say port 80 and 21) through shell with just a single commandline?

Any response is very much appreciated..
thanks
  #2 (permalink)  
Old 05-12-2008
DukeNuke2's Avatar
DukeNuke2 DukeNuke2 is offline Forum Staff  
Soulman
  
 

Join Date: Jul 2006
Location: Germany, Berlin
Posts: 3,018
check for what?
  #3 (permalink)  
Old 05-12-2008
yongitz yongitz is offline
Registered User
  
 

Join Date: Apr 2008
Location: Philippines
Posts: 68
Are you trying to say that you wanted to check for open ports on a certain machine? If that's the case you can use the nmap utility. Check it's manual.

Hope this helps.
  #4 (permalink)  
Old 05-13-2008
arsonist arsonist is offline
Registered User
  
 

Join Date: May 2008
Posts: 7
@DukeNuke2
check if the port connection of a particular ip/domain is okay or not...


@yongitz
i'll take alook on that...


tanx 4 ur response...
  #5 (permalink)  
Old 05-13-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
Another easy way, to check port 80 for example:


Code:
if telnet hostname 80 < /dev/null 2>&1 | grep -q Connected
then
    echo its fine
else
    echo port 80 is down!
fi

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:21 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0