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 ...
随机推荐
- python ORM框架:SqlAlchemy
ORM,对象关系映射,即Object Relational Mapping的简称,通过ORM框架将编程语言中的对象模型与数据库的关系模型建立映射关系,这样做的目的:简化sql语言操作数据库的繁琐过程( ...
- Android开发 retrofit入门讲解
前言 retrofit基于okhttp封装的网络请求框架,网络请求的工作本质上是 OkHttp 完成,而 retrofit 仅负责网络请求接口的封装.如果你不了解OKhttp建议你还是先了解它在来学习 ...
- CSS——用户界面样式
所谓的界面样式, 就是更改一些用户操作样式, 比如 更改用户的鼠标样式, 表单轮廓等.但是比如滚动条的样式改动受到了很多浏览器的抵制,因此我们就放弃了. 防止表单域拖拽 鼠标样式cursor 设置或检 ...
- Swig c++=>C#
1.下载swig https://sourceforge.net/projects/swig/files/ 2.配置环境变量 path 添加你的swig路径 3.创建项目解决方案和一个win32 dl ...
- VS2010-MFC(图形图像:CDC类及其屏幕绘图函数)
转自:http://www.jizhuomi.com/software/244.html 上一节讲了文本输出的知识,本节的主要内容是CDC类及其屏幕绘图函数. CDC类简介 CDC类是一个设备上下文类 ...
- hdu-4893
http://acm.hdu.edu.cn/showproblem.php?pid=1394 题意: 给定一个数组a,一开始数组里面的元素都是0,现在有三个操作: 操作1:给第k个数字加上d. 操作2 ...
- layui表格监听开关并获取改行id
,{field:'sex', title:'性别', width:85, templet: '#switchTpl', unresize: true} <script type="te ...
- springboot新手脱坑之无法下载依赖包
1. Apache maven 3.39配置 1.环境变量自己配置, 2.配置阿里云镜像和本地仓库 <localRepository>D:\Apache\maven\repository& ...
- [NOIP2019模拟赛]夹缝
夹缝 问题描述: 二维空间内有两面相对放置的,向无限远延伸的镜子,以镜子的方向及其法向量建立坐标系,我们选定一个法向量方向下面称“上”.在镜子上的整数位置,存在着一些传感器,传感器不影响光线的反射,光 ...
- mysql主从复制linux配置(二进制日志文件)
安装mysql,两台机器一主(192.168.131.153),一从(192.168.131.154) 主机配置 修改主/etc/my.cnf文件 添加 #server_id=153 ###服务器id ...