文章目錄
未掛載的分區如何查看分區格式
[root@test ~]# blkid /dev/vdb1
/dev/vdb1: UUID="5c0bd53d-85b3-43dc-84cf-722aa48ee776" TYPE="xfs"
[root@test ~]# parted
(parted) print list
ls -l 命令顯示完整時間格式: --full-time
[root@test01 ~]# ls --full-time
drwxr-xr-x 3 root root 4096 2018-12-07 10:59:55.086686741 +0800 shgj_script
端口狀態檢測
[root@xxx ~]# nmap -sV -p 80,443 192.168.60.111
UDP端口連通測試
[root@localhost ~]# nmap -sU ntp1.aliyun.com -p 123
Starting Nmap 6.40 ( http://nmap.org ) at 2018-10-11 16:41 CST
Nmap scan report for ntp1.aliyun.com (120.25.115.20)
Host is up (0.0058s latency).
PORT STATE SERVICE
123/udp open ntp
Nmap done: 1 IP address (1 host up) scanned in 0.17 seconds
查看TCP連接數
# netstat -antp | grep 62722 | grep ESTABLISHED -c
抓包並生成cap格式日誌
目的地址是10.18.186.114,端口是9988,100個包
[root@xxx ~]# tcpdump tcp -i eth0 -t -s 0 -c 100 and dst host 10.18.186.114 and port 9988 -w xxx.cap
獲取當前主機的外網出口IP
curl ip.cn
curl ipinfo.io
curl cip.cc
curl ifconfig.me
curl myip.ipip.net
開機時間點查看: uptime -s
[root@test01 ~]# uptime -s
2018-12-09 12:56:34
不帶特殊符號的時間格式輸出
date +%Y%m%d_%H%M%S
查詢域名解析時間
dig +trace @114.114.114.114 www.bing.cn
查看文件時間戳
ls -l xxx
#在默認的情況下,ls顯示的是該文件的mtime
ls -l --time=atime xxx
ls -l --time=ctime xxx
有sudo權限下的vim保存
:w !sudo tee %
添加sudoer
vim /etc/sudoers.d/user
xxx ALL=(ALL) NOPASSWD:ALL
CentOS7修改runlevel(重啓生效)
#systemctl set-default graphical.target
systemctl set-default multi-user.target