![](https://img-blog.csdnimg.cn/20190927151043371.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Linux常用命令
文章平均质量分 60
Linux常用命令
weixing100200
这个作者很懒,什么都没留下…
展开
-
cat&head&tail&grep&sed&awk组合用法
sed、grep,打印显示139.198.40.94的行。原创 2022-09-21 21:03:23 · 491 阅读 · 1 评论 -
grep命令用法
n显示匹配行时,与文件行号一起显示。(显示结果所在的行号)R递归的读取每个目录下的所有文件,遵循所有符合链接。i忽略字符大小写的差别-E 可以传递多个内容,使用|来分割多个pattern ,以此实现OR操作[root@i-3pedyvud ~]# grep -Rn "LoadModule" /etc/httpd*/etc/httpd/conf/httpd.conf:48:# have to place corresponding `LoadModule' lines at this location so原创 2022-06-23 00:39:51 · 1954 阅读 · 0 评论 -
Centos7/8卸载软件
yum/dnf history #可以看到你的安装记录,然后有个IDyum/dnf history undo ID #会将当时安装的所有软件、依赖以及本地文件 全部卸载干净yum/dnf remove #只会卸载软件本身,软件所安装的依赖、本地文件都不会删除......原创 2022-06-22 23:56:26 · 1183 阅读 · 0 评论 -
cat <<EOF
cat原创 2022-06-09 23:43:32 · 670 阅读 · 0 评论 -
Linux系统管理
创建一个用户,-d指定家目录,-s指定shell -e用户过期时间 -c用户描述 -m如果家目录不存在创建家目录[root@i-3pedyvud dispatcher.d]# useradd -d /home/rootbak -s /bin/bash -e '2099-01-01' -K PASS_MAX_DAYS=-1 -c 'User rootbak' -m rootbakuseradd:用户“rootbak”已存在[root@i-3pedyvud dispatcher.d]# chage -.原创 2022-02-04 18:57:32 · 650 阅读 · 0 评论 -
vim技巧
1,删除以#号开头的行::g/^#/d:%s/^#.*\n2,删除以空格开头的行::g/^\s/d “\s代表空格”:%s/^\s.*\n3,删除以空格#开头的注释行::g/^\ .*#/d “(.*)代表若干”:%s/^\s.*#.*\n//g4,删除空白行::g/^$/d:g/^\s*$/d “删除由空格组成的行”:g/^...原创 2022-01-15 00:41:57 · 252 阅读 · 0 评论 -
echo hello 1>&2 |grep aaa echo hello 2>&1 |grep aaa
下面两条命令分别会有怎样的输出echo hello 1>&2 |grep aaaecho hello 2>&1 |grep aaa答:第一个输出hello,第二个无输出,解析如下1>&2 将正确输出重定向到标准错误2通道2>&1 将错误输出重定向到标准输出1通道echo hello 1>&2 后面跟了一个 |grep aaa| 是管道,意思就是将第一条指令的结果放到第二条指令中,管道命令右边只处理左...转载 2022-01-12 22:30:49 · 449 阅读 · 1 评论 -
netstat 、lsof、SS
lsof -i列出,列出建立连接的连接数[root@i-3pedyvud ~]# lsof -i|grep "ESTABLISHED"dockerd 683 root 19u IPv4 26054 0t0 TCP i-3pedyvud:44964->i-3pedyvud:2377 (ESTABLISHED)dockerd 683 root 21u IPv6 26055 0t0 TCP i-3pedyvud:2377->i-3pedy...原创 2022-01-03 16:44:22 · 2557 阅读 · 1 评论 -
crontab 定时任务
[root@i-3pedyvud cron]# crontab -lno crontab for root原创 2022-01-02 01:41:35 · 202 阅读 · 0 评论 -
strings命令
[root@i-3pedyvud ~]# strings /etc/httpd/conf.d/nextcloud.conf |grep 2b# ServerName 2b.gkmang.cn# ServerAdmin admin@2b.gkmang.cn ServerName 2b.gkmang.cn ServerAdmin admin@2b.gkmang.cn SSLCertificateFile /etc/pki/tls/certs/abcgkmangcn/2b.g...原创 2022-01-02 10:05:08 · 991 阅读 · 0 评论 -
find命令总结
查找排查/usr、/proc、/sys、/etc、/var、/boot 、/run的文件[root@i-3pedyvud ~]# find / \( -path "/usr/*" -o -path "/proc/*" -o -path "/sys/*" -o -path "/etc/*" -o -path "/var/*" -o -path "/boot/*" -o -path "/run/*" \) -prune -o -type f -print...............原创 2022-01-01 23:11:44 · 629 阅读 · 0 评论 -
SNI参数引发的握手失败
[root@i-3pedyvud ~]# gnutls-cli --disable-sni -p 8999 cde.gkmang.cnProcessed 147 CA certificate(s).Resolving 'cde.gkmang.cn'...Connecting to '36.41.188.74:8999'...- Certificate type: X.509- Got a certificate list of 2 certificates.- Certificate[0] ..原创 2021-12-31 01:28:32 · 390 阅读 · 0 评论 -
openssl 命令
测试加密套件 -cipher[root@i-3pedyvud ~]# openssl s_client -connect jinke.innovkids.com:443 -tls1_2 -cipher 3DES原创 2021-12-30 19:20:59 · 1223 阅读 · 0 评论 -
gnutls-cli命令模拟客户端无SNI请求
https://www.gnutls.org/documentation.html原创 2021-12-26 19:22:09 · 325 阅读 · 0 评论 -
curl命令总结
D:\Users\Administrator\Desktop\curl-7.80.0-win64-mingw\bin>curl -Iv https://abc.gkmang.cn:8999 --resolve "abc.gkmang.cn:8999:36.41.188.74"* Added abc.gkmang.cn:8999:36.41.188.74 to DNS cache* Hostname abc.gkmang.cn was found in DNS cache* Trying 36.原创 2021-12-26 17:57:40 · 2682 阅读 · 0 评论 -
TOP命令
先输入top然后按P – 以 CPU 占用率大小的顺序排列进程列表按M – 以内存占用率大小的顺序排列进程列表[root@i-3pedyvud usr]# top -d1 -ctop - 16:11:49 up 10 days, 4:09, 3 users, load average: 0.00, 0.01, 0.05Tasks: 99 total, 1 running, 98 sleeping, 0 stopped, 0 zombie%Cpu(s): 1....原创 2021-12-26 16:12:19 · 1189 阅读 · 0 评论 -
tree命令
-L显示目录级别(depth),-a 显示目录下所有内容,-d 只显示目录 -f 只显示文件[root@i-3pedyvud ~]# tree -L 1 //├── bin -> usr/bin├── boot├── certificate├── csr├── csr1├── dev├── etc├── home├── key├── lib -> usr/lib├── lib64 -> usr/lib64├── media├── mnt├── opt..原创 2021-12-26 12:57:10 · 85 阅读 · 0 评论 -
env命令 & .bash_history 、 .bash_logout 、 .bash_profile 、 .bashrc
[root@i-3pedyvud ~]# ps $$ PID TTY STAT TIME COMMAND21677 pts/2 Ss 0:00 -bash[root@i-3pedyvud ~]# envXDG_SESSION_ID=242HOSTNAME=i-3pedyvudTERM=xtermSHELL=/bin/bashHISTSIZE=1000SSH_CLIENT=XX.XX.88.74 7091 22SSH_TTY=/dev/pts/2USER=r...原创 2021-12-26 10:58:26 · 520 阅读 · 0 评论 -
PS常见命令
[root@i-3pedyvud ~]# ps -axjf|grep mutual1303 580 580 1303 pts/0 1303 S 72 0:15 | \_ tcpdump -i eth0 host 10.140.19.9 -nn -w mutual1303 669 669 1303 pts/0 1303 S 72 0:15 | \_ tcpdump -i eth0 host 10.140.1...原创 2021-12-25 23:47:12 · 1199 阅读 · 0 评论 -
Linux文件大小排序--ls
root@i-3pedyvud ~]# ls -l | sort -n -k5total 2189336drwxr-xr-x 5 root root 94 Jun 17 2021 app_publisher-rw-r--r-- 1 root root 230 Dec 14 09:59 eccabcgkmangcn.key-rwxr-xr-x 1 root root 610 Dec 14 09:58 make-dummy...原创 2021-12-25 23:04:44 · 4014 阅读 · 0 评论