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 ...
随机推荐
- Vue.js小游戏:测试CF打狙速度
此项目只测试反应速度,即手点击鼠标的反应速度 html代码 <div id="top">请等待图片变颜色,颜色便的那一刻即可点击测手速</div> < ...
- vue-router如何参数传递
1.我们用<router-link>标签中的to属性进行传参,需要您注意的是这里的to要进行一个绑定,写成:to 先来看一下这种传参方法的基本语法: <router-link :to ...
- 利用VS 性能探查器 解决代码性能不高问题
VS2017 分析-性能探查器 选择你想分析的项目,选择你的分析工具,我这边是遇到了一个cpu爆满的问题 启动后需要点击一下记录cpu,否则会没有后续的分析忘了截图了,下面是出的分析报告,分析时间比较 ...
- 初识STL
原生指针 泛型指针 智能指针 都是什么? iterator迭代器和指针的区别 C++标准模板库(STL)迭代器的原理与实现 [C++]STL常用容器总结之一:容器与迭代器 C++内置数组和array的 ...
- vue+Iview+gulp 生成文档说明
1.安装npm gulp相关插件 比如:gulp.gulp-concat.gulp-htmlmin.gulp-cssmin.gulp-cheerio.gulp-clean 2. 编写gulpfile. ...
- CentOS 7.2部署NTP服务器实现时间同步
CentOS 7.2部署NTP服务器实现时间同步 [日期:2017-12-18] 来源:Linux社区 作者:梁明远 [字体:大 中 小] 1. 前言 对于容器编排系统,前段时间主要研究kube ...
- (转)[视频压制/转换技术] I帧 B帧 P帧 IDR帧 等帧用途详细说明
转:http://www.u2game.net/bbs/thread-46116-1-1.html 在视频压制.转换中,经常会看到:I帧 B帧 P帧 IDR帧 等名词,这里就是通用的解释一下这些帧的用 ...
- P1977 出租车拼车
P1977 出租车拼车 题目背景 话说小 x 有一次去参加比赛,虽然学校离比赛地点不太远,但小 x 还是想坐 出租车去.大学城的出租车总是比较另类,有“拼车”一说,也就是说,你一个人 坐车去,还是一堆 ...
- Docker系列(八):Kubernetes横空出世背后的秘密
Docker与CoreOS的恩怨情仇 2013年2月,Docker建立了一个网站发布它的首个演示版本, 3月,美国加州Alex Polvi正在自己的车库开始 他的 第二次创业 有了第一桶金的Alex这 ...
- Date、DateFormat、Calendar、System、Math类总结
java.util.Date: 构造方法 public Date() 空参构造,返回当前时间 public Date(long 毫秒值) 指定毫秒值的时间 普通方法 long getTime() 获取 ...