How to ping and test for a specific port from Linux or Unix command line
Use telnet command
The syntax is:telnet {host} {port}
telnet www.cyberciti.biz 80
telnet 192.168.2.254 80
Sample outputs:
Trying 192.168.2.254...
Connected to router.
Escape character is '^]'.
^]
telnet> q
Connection closed.
To close your session, press Ctrl+]+q.
Use nc command
The syntax is:nc -vz {host} {port}
nc -vz 192.168.2.254 80
nc -vz www.cyberciti.biz 443
Sample outputs:
found 0 associations
found 1 connections:
1: flags=82<connected,preferred>
outif utun1
src 10.8.0.2 port 54997
dst 104.20.187.5 port 443
rank info not available
TCP aux info available
Connection to www.cyberciti.biz port 443 [tcp/https] succeeded!
Use nmap command
The syntax is:nmap -PNp {port} {host}
nmap -p {port} {host}
nmap -p 22 www.cyberciti.biz
nmap -p 443 192.168.2.254
Sample outputs:
Starting Nmap 7.40 ( https://nmap.org ) at 2017-05-24 01:00 IST
Nmap scan report for router (192.168.2.254)
Host is up (0.00034s latency).
PORT STATE SERVICE
443/tcp open https
Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds
See “Top 32 Nmap Command Examples For Sys/Network Admins” for more info.
Use bash shell
## check for tcp port ## |
Sample outputs:
Close 22
Open 443
Use nping command
Nping is an open-source tool for network packet generation, response analysis and response time measurement. Nping allows users to generate network packets of a wide range of protocols, letting them tunevirtually any field of the protocol headers. While Nping can be used as a simple ping utility to detect active hosts, it can also be used as a raw packet generator. The syntax is:sudo nping --tcp -p {port} {host}
sudo nping --tcp -p 443 www.cyberciti.biz
Sample outputs:

Fig.01: nping just pinged www.cyberciti.biz host at port 443
How to ping and test for a specific port from Linux or Unix command line的更多相关文章
- Linux和Windows下ping命令详解(转:http://linux.chinaitlab.com/command/829332.html)
一.Linux下的ping参数 用途 发送一个回送信号请求给网络主机. 语法 ping [ -d] [ -D ] [ -n ] [ -q ] [ -r] [ -v] [ \ -R ] [ -a add ...
- DOS cmd - how to ping a remote host with specified port
You can use ping to test whether you can connect to a remote host: ping baidu.com ping 125.6.45.88 ( ...
- 系统盘的消耗 谨慎的日志存储到系统盘+日志级别!! 569 error_log = /usr/local/php7/logs/php-error.log 26 error_log = /usr/local/php7/logs/fpm_error_log
案例: 系统盘一夜之间骤增近20G nginx + php-fpm cat /usr/local/nginx/conf/nginx.conf 查看对请求的处理 4个配置文件 /usr/local/n ...
- sublime text 3插件
Package Control Messages Emmet emmet插件 Thank you for installing Emmet -- a toolkit that can greatly ...
- <转>boost 1.53 and STLPort build binary for windows
1.编译STLPort: 1.1 .开始菜单运行vs2008的命令行工具 1.2.进入E:\00.CODE.SDK\STLport-5.2.1\ 1.2.运行configure ...
- Watch out for these 10 common pitfalls of experienced Java developers & architects--转
原文地址:http://zeroturnaround.com/rebellabs/watch-out-for-these-10-common-pitfalls-of-experienced-java- ...
- The Daligner Overlap Library
/************************************************************************************\ * * * Copyrig ...
- bedtools 每天都会用到的工具
详细的使用说明:http://bedtools.readthedocs.org/en/latest/ Collectively, the bedtools utilities are a swiss- ...
- 计算机视觉code与软件
Research Code A rational methodology for lossy compression - REWIC is a software-based implementatio ...
随机推荐
- Word 多级节标题设置和图表章节号自动生成
写文章的时候,正文.图表.节标题,通过“样式”可以进行统一设置,这里我记录了几点小技巧: 1.多级标题如何设置 假设我要设置三级标题,下面以图的形式记录方式: 设置完之后,应用即可. 章节设定之后,可 ...
- Activiti学习笔记1 — 下载与开发环境的配置
一.下载 JDK下载URL: Tomcat下载URL:http://tomcat.apache.org/ Eclipse下载URL:http://www.oracle.com/technetwork/ ...
- Django form组件 与 cookie/session
目录 一.form组件 二.cookie.session 返回Django 组件 一.form组件 1.1 以注册功能为例 注册功能 1.渲染前端标签获取用户输入 --> 渲染标签 2.获取用户 ...
- JS函数 返回值的函数 return sum;或者result = add2(3,4);
返回值的函数 思考:上一节函数中,通过"document.write"把结果输出来,如果想对函数的结果进行处理怎么办呢? 我们只要把"document.write(sum ...
- canvas像素的操作
###在canvas中的像素操作 到目前为止,我们尚未深入了解Canvas画布真实像素的原理,事实上, 你可以直接通过ImageData对象操纵像素数据,直接读取或将数据数组写入该对象中 ###得到场 ...
- js清空input file值
项目进行导入操作,如果第一次导入某个文件会触发导入操作,但是第二次导入重复该文件,不会触发操作. 分析了原因,是因为上一次file里选择的文件路径值与本次选择的文件路径值是一样的,值没有改变所以导致f ...
- Appium 微信 webview 的自动化技术
Appium 微信 webview 的自动化技术 最近好多人问微信webview自动化的事情, 碰巧我也在追微信webview的自动化和性能分析方法. 先发出来一点我的进展给大家参考下. 此方法用 ...
- 【JZOJ6287】扭动的树
description analysis 区间\(DP\),首先按照键值排个序,这样保证树的中序遍历就为原序列 设\(f[0][i][j]\)表示\([i..j]\)区间作为\([unknown..i ...
- day31 类的组合及继承,文件目录规范
Python之路,Day18 = Python基础18-面向对象继承与组合 类的继承 def talk(): print("I am come from talk..a") cla ...
- 「题解」:$e$
问题 B: $e$ 时间限制: 2 Sec 内存限制: 512 MB 题面 题面谢绝公开. 题解 话说一天考两个主席树这回事…… 正解可以叫树上主席树??(脸哥说也叫主席树上树???) 对于树上的每 ...