Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

linux bash test connection to host and port

## check for tcp port ##
## need bash shell ##
(echo >/dev/tcp/{host}/{port}) &>/dev/null && echo "open" || echo "close"
(echo >/dev/udp/{host}/{port}) &>/dev/null && echo "open" || echo "close"
(echo >/dev/tcp/www.cyberciti.biz/22) &>/dev/null && echo "Open 22" || echo "Close 22"
(echo >/dev/tcp/www.cyberciti.biz/443) &>/dev/null && echo "Open 443" || echo "Close 443"
Comment

PREVIOUS NEXT
Code Example
Shell :: My first git commit 
Shell :: how to remove all files with a certain file type in terminal 
Shell :: git clone vs add remote 
Shell :: how to open a .sh file 
Shell :: sed repeat pattern 
Shell :: Comparing Actual Changes Between Two Branches 
Shell :: linux os upgrade 
Shell :: create a new repository on the command line 
Shell :: delete list of packages linux 
Shell :: composer install -- 
Shell :: ubuntu command line change line in file 
Shell :: how to move files that begine with uppercase in linux 
Shell :: add my current project to an already existing GitHub repository 
Shell :: openssl install linux 
Shell :: git undo 
Shell :: or push an existing repository from the command line 
Shell :: command to hit url in linux 
Shell :: git commit with message 
Shell :: git ultiple branch delete 
Shell :: extracting tar.gz 
Shell :: zsh shell in linux 
Shell :: create a branch from old commit 
Shell :: install dvc in ubuntu 
Shell :: linux edit crontab via script 
Shell :: how to delete local master branch in git 
Shell :: save command output to file in powershell 
Shell :: How to use alias in Linux bash 
Shell :: install font in react native 
Shell :: uncommit the last commit 
Shell :: page rank example 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =