回顾

sort

sort [选项] 文件
在这里插入图片描述
-u:唯一,去除重复
-r:按数字大小,倒序排序,大到小
-o:输出文件
-n:按数字大小,顺序排序,小到大
-t: -t后加分割符,按分割符为标准,进行筛选
-k:k后加数字,第k列
-R:随机排序
-b:

uniq

uniq [选项] 文件
去除连续的重复行
在这里插入图片描述
-i:忽略大小写
-c:统计重复行次数

[root@web ~]# uniq 1.txt
uniq: 1.txt: 没有那个文件或目录
您在 /var/spool/mail/root 中有新邮件
[root@web ~]# cd /tmp
[root@web tmp]# uniq 1.txt
112:2223:333213
12:3:2:1:312:3123
123123213123:123
2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
213123::::!@#@!#:@!#213:@!#12
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
123213
2
3213123
21
32
312
3
12312312312
3
12312312321312312321
312312312
123123
[root@web tmp]# uniq -c 1.txt1 112:2223:3332131 12:3:2:1:312:31231 123123213123:1231 2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:1 21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@1 12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!1 213123::::!@#@!#:@!#213:@!#121 123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!31231 213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@31 1232131 21 32131231 211 321 3121 31 123123123121 31 12312312321311 123123211 3123123121 123123
[root@web tmp]# uniq -i 1.txt
112:2223:333213
12:3:2:1:312:3123
123123213123:123
2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
213123::::!@#@!#:@!#213:@!#12
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
123213
2
3213123
21
32
312
3
12312312312
3
12312312321312312321
312312312
123123

tee

双重覆盖重定向
命令 | tee 文件
-a:双重追加重定向
cat 1.txt |tee 4.txt
echo hello world | tee file5

[root@web tmp]# echo hello world | tee file5
hello world
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# cat file5
hello world
[root@web tmp]#

diff

逐行比较文件不同
-u:
在这里插入图片描述
-u:合并格式显示
-c:上下文格式显示

[root@web tmp]# diff 1.txt 2.txt
1c1,4
< 112:2223:333213
---
>
> 2
> 3
> 3
3c6,9
< 123123213123:123
---
> 21
> 32
> 112:2223:333213
> 312
5,7c11
< 21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
< 12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
< 213123::::!@#@!#:@!#213:@!#12
---
> 123123
9d12
< 213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
11c14,15
< 2
---
> 213123::::!@#@!#:@!#213:@!#12
> 213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
13,20d16
< 21
< 32
< 312
< 3
< 12312312312
< 3
< 123123123213
<
21a18
> 21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
23c20,23
< 123123
---
> 12312312312
> 123123123213
> 123123213123:123
> 12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
[root@web tmp]# diff 2.txt 3.txt
1,23c1,27
<
< 2
< 3
< 3
< 12:3:2:1:312:3123
< 21
< 32
< 112:2223:333213
< 312
< 2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
< 123123
< 123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
< 123213
< 213123::::!@#@!#:@!#213:@!#12
< 213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
< 3213123
< 12312321
< 21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
< 312312312
< 12312312312
< 123123123213
< 123123213123:123
< 12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
---
> root:x:0:0:root:/root:/bin/bash
> bin:x:1:1:bin:/bin:/sbin/nologin
> daemon:x:2:2:daemon:/sbin:/sbin/nologin
> adm:x:3:4:adm:/var/adm:/sbin/nologin
> lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
> sync:x:5:0:sync:/sbin:/bin/sync
> shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
> halt:x:7:0:halt:/sbin:/sbin/halt
> mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
> operator:x:11:0:operator:/root:/sbin/nologin
> games:x:12:100:games:/usr/games:/sbin/nologin
> ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
> nobody:x:99:99:Nobody:/:/sbin/nologin
> systemd-network:x:192:192:systemd Network Management:/:/sbin/nologin
> dbus:x:81:81:System message bus:/:/sbin/nologin
> polkitd:x:999:998:User for polkitd:/:/sbin/nologin
> libstoragemgmt:x:998:995:daemon account for libstoragemgmt:/var/run/lsm:/sbin/nologin
> colord:x:997:994:User for colord:/var/lib/colord:/sbin/nologin
> rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
> saned:x:996:993:SANE scanner daemon user:/usr/share/sane:/sbin/nologin
> gluster:x:995:992:GlusterFS daemons:/run/gluster:/sbin/nologin
> aaaaaaaaaaaaaaaaaaaaaa
> bbbbbbbbbbbbbbbbbbbbbbb1111111111222222222333333331cccccccccc
> hello world 888
> 666
> 777
> 999
[root@web tmp]# diff file1 file2
[root@web tmp]# diff -c 1.txt 2.txt
*** 1.txt       2025-07-28 21:46:59.593951441 +0800
--- 2.txt       2025-07-28 21:12:17.477645718 +0800
***************
*** 1,23 ****
! 112:2223:33321312:3:2:1:312:3123
! 123123213123:1232112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
! 21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
! 12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
! 213123::::!@#@!#:@!#213:@!#12123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
- 213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3123213
! 23213123
- 21
- 32
- 312
- 3
- 12312312312
- 3
- 123123123213
-12312321312312312
! 123123
--- 1,23 ----
!
! 2
! 3
! 312:3:2:1:312:3123
! 21
! 32
! 112:2223:333213
! 3122112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
! 123123123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123123213
! 213123::::!@#@!#:@!#213:@!#12
! 213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3321312312312321
+ 21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@312312312
! 12312312312
! 123123123213
! 123123213123:123
! 12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
您在 /var/spool/mail/root 中有邮件
[root@web tmp]#

diff dir1 dr2

[root@web tmp]# diff dir1 dir2
只在 dir1 存在:file1
只在 dir2 存在:file2
您在 /var/spool/mail/root 中有邮件

patch 1.txt file6.patch

diff -uN 1.txt 2.txt > file6.patch
diff -c 1.txt 2.txt
patch 1.txt file6.patch
diff 1.txt 2.txt

[root@web tmp]# diff -uN 5.txt 6.txt
--- 5.txt       2025-07-30 20:05:17.378243112 +0800
+++ 6.txt       2025-07-30 20:05:24.485368451 +0800
@@ -1,23 +1,23 @@
-112:2223:333213
+
+2
+3
+312:3:2:1:312:3123
-123123213123:123
+21
+32
+112:2223:333213
+3122112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
-21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
-12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
-213123::::!@#@!#:@!#213:@!#12
+123123123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
-213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3123213
-2
+213123::::!@#@!#:@!#213:@!#12
+213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@33213123
-21
-32
-312
-3
-12312312312
-3
-123123123213
-12312321
+21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@312312312
-123123
+12312312312
+123123123213
+123123213123:123
+12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
[root@web tmp]# diff -uN 5.txt 6.txt >file6.patch
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# patch 5.txt file6.patch
patching file 5.txt
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# diff 5.txt 6.txt
[root@web tmp]# diff -c 5.txt 6.txt
[root@web tmp]# diff -u 5.txt 6.txt
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# cat 5.txt2
3
3
12:3:2:1:312:3123
21
32
112:2223:333213
312
2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
123123
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
123213
213123::::!@#@!#:@!#213:@!#12
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
3213123
12312321
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
312312312
12312312312
123123123213
123123213123:123
12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
[root@web tmp]# cat 6.txt2
3
3
12:3:2:1:312:3123
21
32
112:2223:333213
312
2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
123123
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
123213
213123::::!@#@!#:@!#213:@!#12
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
3213123
12312321
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
312312312
12312312312
123123123213
123123213123:123
12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!

tr

字符的转换、替换、删除
用法1:tr 文件1 文件2 tr ‘string1’ ‘string2’ < filename
用法2:commands | tr file1 file2 ‘string1’ ‘string2’
用法3:tr options ‘string1’ < filename

-d:删除所有字符
-s:删除重复字符序列,只保留第一个
在这里插入图片描述
tr -d ‘[: /]’ < 3.txt 删除3.txt所有的:和/
cat 3.txt |tr -d ‘[: /]’ 删除3.txt 所有的 : 和 /
tr ‘[0-9]’ ‘[@]’ < 3.txt 替换 将3.txt所有的数字替换为@
tr ‘[a-z]’ ‘[A-Z]’ < 3.txt 替换3.txt中所有的小写字母为大写字母
tr -s ‘[a-z0-9]’ < 3.txt 删除3.txt中所有重复的小写字母数字,只保留第一个字母数字
tr -s ‘[a-z]’ < 3.txt 删除3.txt中所有的小写字母
tr -d ‘[:digit:]’ < 3.txt 删除3.txt中所有的数字
tr -d ‘[:blank:]’ < 3.txt 删除3.txt中所有的空格 水平空白
tr -d ‘[:space:]’ < 3.txt 删除3.txt中所有的水平、垂直空白

[root@web tmp]# cat 5.txt2
3
3
12:3:2:1:312:3123
21
32
112:2223:333213
312
2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
123123
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
123213
213123::::!@#@!#:@!#213:@!#12
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
3213123
12312321
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
312312312
12312312312
123123123213
123123213123:123
12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
[root@web tmp]# cat 6.txt2
3
3
12:3:2:1:312:3123
21
32
112:2223:333213
312
2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
123123
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
123213
213123::::!@#@!#:@!#213:@!#12
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
3213123
12312321
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
312312312
12312312312
123123123213
123123213123:123
12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
[root@web tmp]# cat 5.txt | tr -d '[:/]'2
3
3
123213123123
21
32
1122223333213
312
2112123!@#!@#@!!@#!@#!@#!@#!@
123123
123123!@#213!@#123!@#!@#!#!@#123123@!3123
123213
213123!@#@!#@!#213@!#12
21321312312!@#!@!@312!@3123!@312!@#1221321312!23123!@3
3213123
12312321
21312312SADASD!@#!@#@!#!@#!@
312312312
12312312312
123123123213
123123213123123
12312312123122121312312!@#!@#!#ASASDSAD!@#!@#ASDASD!@#@!
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# tr -s [1-9] < 1.txt
12:23:3213
12:3:2:1:312:3123
123123213123:123
212:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
1231231212312121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
213123::::!@#@!#:@!#213:@!#12
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
123213
2
3213123
21
32
312
3
12312312312
3
12312312321312312321
312312312
123123
[root@web tmp]# tr -s [1-9] <5.txt2
3
3
12:3:2:1:312:3123
21
32
12:23:3213
312
212:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
123123
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
123213
213123::::!@#@!#:@!#213:@!#12
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
3213123
12312321
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
312312312
12312312312
123123123213
123123213123:123
1231231212312121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# tr '[1-9]' '[@]' < 5.txt]
]
]
@]:]:]:@:]@]:]@]]
]@
]]
@@]:]]]]:]]]]@]
]@]
]@@]:@]]:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
@]]@]]
@]]@]]:!@#]@]:!@#@]]:!@#!@#:!#!@#:@]]@]]:@!]@]]
@]]]@]
]@]@]]::::!@#@!#:@!#]@]:@!#@]
]@]]@]:@]]@]:!@#!@:!@]@]:!@]@]]:!@]@]:!@#@]:]@]]@]@]:!]]@]]:!@]
]]@]@]]
@]]@]]]@
]@]@]]@]:S:ADAS:D:!@:#!@:#:@!#:!@#!@
]@]]@]]@]
@]]@]]@]]@]
@]]@]]@]]]@]
@]]@]]]@]@]]:@]]
@]]@]]@]@]]@]]@]@]@]]@]:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
[root@web tmp]# tr ''

测试

使用小工具截取当前主机IP;截取NetMask;截取broadcast

ifconfig ens33 | grep ‘broadcast’|tr -d ‘[a-zA-Z]’

 ifconfig ens33|grep 'Bcast'|tr -d '[a-zA-Z]'|cut -d: -f2,3,4

在这里插入图片描述

[root@web tmp]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 192.168.235.20  netmask 255.255.255.0  broadcast 192.168.235.255inet6 fe80::20c:29ff:fe97:845e  prefixlen 64  scopeid 0x20<link>ether 00:0c:29:97:84:5e  txqueuelen 1000  (Ethernet)RX packets 222598  bytes 16375798 (15.6 MiB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 367611  bytes 159710111 (152.3 MiB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0[root@web tmp]# ifconfig ens33|grep 'Bcast'
您在 /var/spool/mail/root 中有邮件
[root@web tmp]#

在这里插入图片描述

[root@web tmp]# ifconfig ens33|grep 'Bcast'
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep -i 'Bcast'
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33 |grep 'broadcast'inet 192.168.235.20  netmask 255.255.255.0  broadcast 192.168.235.255
[root@web tmp]# ifconfig ens33|grep 'broadcast'|tr -d '[a-z]'192.168.235.20   255.255.255.0   192.168.235.255

截取MAC地址

[root@web tmp]# ifconfig ens33 | grep 'ether' |tr -s ' ' |ls
1.txt        file2                sys-20250717.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-bolt.service-LMvltW
2.txt        file3.patch          sys-20250718.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-chronyd.service-UWJorp
3.txt        file5                sys-20250720.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-colord.service-tLvcX3
5.txt        file6.patch          sys-20250721.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-cups.service-LjtpWQ
6.txt        file.patch           sys-20250722.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-rtkit-daemon.service-gttbXa
bak.boot     passwd               sys-20250723.tar.gz  vmware-root_1022-2999133054
dir1         swapfile             sys-20250724.tar.gz  vmware-root_1207-3979642956
dir2         sys-20250714.tar.gz  sys-20250728.tar.gz  vmware-root_845-4021653450
EdP.aunSeOi  sys-20250715.tar.gz  sys-20250729.tar.gz  vmware-root_971-4290232077
file1        sys-20250716.tar.gz  sys-20250730.tar.gz

在这里插入图片描述
为什么 cut -d ’ ’ -f3
ether 00:0c:29:97:84:5e txqueuelen 1000 (Ethernet)
得到MAC地址 为什么是f3
在这里插入图片描述


[root@web tmp]# ifconfig ens33 |grep 'ether' |tr -s ' '|cut -d ' ' -f3
00:0c:29:97:84:5e
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep broadcast|tr -s ' '|cut -d ' ' -f7
192.168.235.255
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep broadcast|tr -d '[a-zA-Z]'192.168.235.20   255.255.255.0   192.168.235.255
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep broadcast|tr -d '[a-zA-Z]'|tr -s ' '|cut -d ' ' -f4
192.168.235.255
您在 /var/spool/mail/root 中有邮件

将系统中所有普通用户的用户名、密码、shell保存在一个文件中,用户名、密码 shell间用shell连接

grep ‘bash$’ passwd|grep -v ‘root’|cut -d: -f1,2,7|tr ‘:’ ‘\t’|tee ‘abc.txt’

[root@web tmp]# grep 'bash$' passwd
root:x:0:0:root:/root:/bin/bash
caozx26:x:1000:1002:caozx26:/home/caozx26:/bin/bash
XOAP:x:1002:1000::/rhome/XOAP:/bin/bash
cao1:x:1004:1223::/home/cao1:/bin/bash
cao2:x:1005:1005::/home/cao2:/bin/bash
xiaocao:x:1006:1006::/home/xiaocao:/bin/bash
xiao6:x:1007:1007::/home/xiao6:/bin/bash
tom:x:1008:1008::/home/tom:/bin/bash
jack:x:1009:1009::/home/jack:/bin/bash
cw01:x:1010:1224::/home/cw01:/bin/bash
sc01:x:1011:1226::/home/sc01:/bin/bash
rs01:x:1012:1225::/home/rs01:/bin/bash
boss01:x:1013:1004::/home/boss01:/bin/bash
cw02:x:1014:1224::/home/cw02:/bin/bash
sc02:x:1015:1226::/home/sc02:/bin/bash
rs02:x:1016:1225::/home/rs02:/bin/bash
harry:x:1017:1017::/home/mahei/redhat/harry:/bin/bash
netasha:x:1018:1018::/home/netasha:/bin/bash
sarsh:x:1019:1228::/home/sarsh:/bin/bash
OOO:x:1020:1020::/home/OOO:/bin/bash
jerry:x:1021:1229::/home/jerry:/bin/bash
kefu:x:1022:1022::/home/kefu:/bin/bash
kefu2:x:1023:1023::/home/kefu2:/bin/bash
user01:x:1024:1024::/home/user01:/bin/bash
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# grep 'bash$' passwd|grep -v 'root'
caozx26:x:1000:1002:caozx26:/home/caozx26:/bin/bash
XOAP:x:1002:1000::/rhome/XOAP:/bin/bash
cao1:x:1004:1223::/home/cao1:/bin/bash
cao2:x:1005:1005::/home/cao2:/bin/bash
xiaocao:x:1006:1006::/home/xiaocao:/bin/bash
xiao6:x:1007:1007::/home/xiao6:/bin/bash
tom:x:1008:1008::/home/tom:/bin/bash
jack:x:1009:1009::/home/jack:/bin/bash
cw01:x:1010:1224::/home/cw01:/bin/bash
sc01:x:1011:1226::/home/sc01:/bin/bash
rs01:x:1012:1225::/home/rs01:/bin/bash
boss01:x:1013:1004::/home/boss01:/bin/bash
cw02:x:1014:1224::/home/cw02:/bin/bash
sc02:x:1015:1226::/home/sc02:/bin/bash
rs02:x:1016:1225::/home/rs02:/bin/bash
harry:x:1017:1017::/home/mahei/redhat/harry:/bin/bash
netasha:x:1018:1018::/home/netasha:/bin/bash
sarsh:x:1019:1228::/home/sarsh:/bin/bash
OOO:x:1020:1020::/home/OOO:/bin/bash
jerry:x:1021:1229::/home/jerry:/bin/bash
kefu:x:1022:1022::/home/kefu:/bin/bash
kefu2:x:1023:1023::/home/kefu2:/bin/bash
user01:x:1024:1024::/home/user01:/bin/bash
[root@web tmp]# grep 'bash$' passwd|grep -v 'root'|cut -d: -f1,2,7
caozx26:x:/bin/bash
XOAP:x:/bin/bash
cao1:x:/bin/bash
cao2:x:/bin/bash
xiaocao:x:/bin/bash
xiao6:x:/bin/bash
tom:x:/bin/bash
jack:x:/bin/bash
cw01:x:/bin/bash
sc01:x:/bin/bash
rs01:x:/bin/bash
boss01:x:/bin/bash
cw02:x:/bin/bash
sc02:x:/bin/bash
rs02:x:/bin/bash
harry:x:/bin/bash
netasha:x:/bin/bash
sarsh:x:/bin/bash
OOO:x:/bin/bash
jerry:x:/bin/bash
kefu:x:/bin/bash
kefu2:x:/bin/bash
user01:x:/bin/bash
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# grep 'bash$' passwd|grep -v 'root'|cut -d: -f1,2,7|tr ':' '\t'
caozx26 x       /bin/bash
XOAP    x       /bin/bash
cao1    x       /bin/bash
cao2    x       /bin/bash
xiaocao x       /bin/bash
xiao6   x       /bin/bash
tom     x       /bin/bash
jack    x       /bin/bash
cw01    x       /bin/bash
sc01    x       /bin/bash
rs01    x       /bin/bash
boss01  x       /bin/bash
cw02    x       /bin/bash
sc02    x       /bin/bash
rs02    x       /bin/bash
harry   x       /bin/bash
netasha x       /bin/bash
sarsh   x       /bin/bash
OOO     x       /bin/bash
jerry   x       /bin/bash
kefu    x       /bin/bash
kefu2   x       /bin/bash
user01  x       /bin/bash
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# grep 'bash$' passwd|grep -v 'root'|cut -d: -f1,2,7|tr ':' '\t'|tee abc.txt
caozx26 x       /bin/bash
XOAP    x       /bin/bash
cao1    x       /bin/bash
cao2    x       /bin/bash
xiaocao x       /bin/bash
xiao6   x       /bin/bash
tom     x       /bin/bash
jack    x       /bin/bash
cw01    x       /bin/bash
sc01    x       /bin/bash
rs01    x       /bin/bash
boss01  x       /bin/bash
cw02    x       /bin/bash
sc02    x       /bin/bash
rs02    x       /bin/bash
harry   x       /bin/bash
netasha x       /bin/bash
sarsh   x       /bin/bash
OOO     x       /bin/bash
jerry   x       /bin/bash
kefu    x       /bin/bash
kefu2   x       /bin/bash
user01  x       /bin/bash
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# cat abc.txt
caozx26 x       /bin/bash
XOAP    x       /bin/bash
cao1    x       /bin/bash
cao2    x       /bin/bash
xiaocao x       /bin/bash
xiao6   x       /bin/bash
tom     x       /bin/bash
jack    x       /bin/bash
cw01    x       /bin/bash
sc01    x       /bin/bash
rs01    x       /bin/bash
boss01  x       /bin/bash
cw02    x       /bin/bash
sc02    x       /bin/bash
rs02    x       /bin/bash
harry   x       /bin/bash
netasha x       /bin/bash
sarsh   x       /bin/bash
OOO     x       /bin/bash
jerry   x       /bin/bash
kefu    x       /bin/bash
kefu2   x       /bin/bash
user01  x       /bin/bash
您在 /var/spool/mail/root 中有邮件

bash

常见快捷键

ctrl+r 搜索历史命令
ctrl+u 清除光标前字符
ctrl+k 清楚光标后字符
ctrl+a 移动命令最前方
ctrl+e 移动到命令最后端

常用通配符

*匹配0或多个任意字符
?匹配任意单个字符
[list] 匹配[list]中的任意单个字符,或一组单个字符
[!list] 匹配除list的字符
[string1,string2,…] 匹配string1 string2 或更多字符串

bash中的引号

" “:将”"中的内容当成整体来看,允许通过 $ 符号引用其他变量值
’ ’ :将’ '中的内容当成整体来看,禁止引用其他变量值,特殊符号视为普通字符
`` : 命令优先执行,和$()一样。如果存在嵌套,不能用

“” ‘’

echo "(hostname)"echo′(hostname)" echo '(hostname)"echo(hostname)’
echo hostname


[root@web tmp]# echo "$(hostname)"
web.cn
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# echo 'hostname'
hostname
[root@web tmp]# echo "hostname"
hostname
[root@web tmp]# echo '$(hostname)'
$(hostname)
[root@web tmp]# echo "$(hostname)"
web.cn
[root@web tmp]# echo "$(date)"
2025年 07月 30日 星期三 23:27:30 CST
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# echo '$(date)'
$(date)
[root@web tmp]# echo $(date)
2025年 07月 30日 星期三 23:27:56 CST
[root@web tmp]# echo $(hostname)
web.cn
[root@web tmp]# echo $(date +%F)
2025-07-30
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# echo `echo $(date +%F)`
2025-07-30
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# echo `echo $(hostname)`
web.cn
[root@web tmp]# echo `hostname`
web.cn
[root@web tmp]# echo `date+%F`
bash: date+%F: 未找到命令...[root@web tmp]# echo `date +%F`
2025-07-30
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# echo `echo `hostname``
hostname
[root@web tmp]# echo `echo $(hostname)`
web.cn
[root@web tmp]#

记录

root@192.168.235.20's password:┌────────────────────────────────────────────────────────────────────┐│                        • MobaXterm 20.0 •                          ││            (SSH client, X-server and networking tools)             ││                                                                    ││ ➤ SSH session to root@192.168.235.20                               ││   • SSH compression : ✘                                            ││   • SSH-browser     : ✔                                            ││   • X11-forwarding  : ✔  (remote display is forwarded through SSH) ││   • DISPLAY         : ✔  (automatically set on remote server)      ││                                                                    ││ ➤ For more info, ctrl+click on help or visit our website           │└────────────────────────────────────────────────────────────────────┘Last login: Tue Jul 29 19:19:36 2025 from 192.168.235.1
[root@web ~]# uniq 1.txt
uniq: 1.txt: 没有那个文件或目录
您在 /var/spool/mail/root 中有新邮件
[root@web ~]# cd /tmp
[root@web tmp]# uniq 1.txt
112:2223:333213
12:3:2:1:312:3123
123123213123:123
2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
213123::::!@#@!#:@!#213:@!#12
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
123213
2
3213123
21
32
312
3
12312312312
3
12312312321312312321
312312312
123123
[root@web tmp]# uniq -c 1.txt1 112:2223:3332131 12:3:2:1:312:31231 123123213123:1231 2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:1 21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@1 12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!1 213123::::!@#@!#:@!#213:@!#121 123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!31231 213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@31 1232131 21 32131231 211 321 3121 31 123123123121 31 12312312321311 123123211 3123123121 123123
[root@web tmp]# uniq -i 1.txt
112:2223:333213
12:3:2:1:312:3123
123123213123:123
2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
213123::::!@#@!#:@!#213:@!#12
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
123213
2
3213123
21
32
312
3
12312312312
3
12312312321312312321
312312312
123123
[root@web tmp]# echo hello world | tee file5
hello world
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# cat file5
hello world
[root@web tmp]# diff file1 file2
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# diff file2 file3
diff: file3: 没有那个文件或目录
[root@web tmp]# diff text1 text2
diff: text1: 没有那个文件或目录
diff: text2: 没有那个文件或目录
[root@web tmp]# ls
1.txt        file3.patch          sys-20250718.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-bolt.service-LMvltW
2.txt        file5                sys-20250720.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-chronyd.service-UWJorp
3.txt        file.patch           sys-20250721.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-colord.service-tLvcX3
bak.boot     passwd               sys-20250722.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-cups.service-LjtpWQ
dir1         swapfile             sys-20250723.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-rtkit-daemon.service-gttbXa
dir2         sys-20250714.tar.gz  sys-20250724.tar.gz  vmware-root_1022-2999133054
EdP.aunSeOi  sys-20250715.tar.gz  sys-20250728.tar.gz  vmware-root_1207-3979642956
file1        sys-20250716.tar.gz  sys-20250729.tar.gz  vmware-root_845-4021653450
file2        sys-20250717.tar.gz  sys-20250730.tar.gz  vmware-root_971-4290232077
[root@web tmp]# diff 1.txt 2.txt
1c1,4
< 112:2223:333213
---
>
> 2
> 3
> 3
3c6,9
< 123123213123:123
---
> 21
> 32
> 112:2223:333213
> 312
5,7c11
< 21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
< 12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
< 213123::::!@#@!#:@!#213:@!#12
---
> 123123
9d12
< 213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
11c14,15
< 2
---
> 213123::::!@#@!#:@!#213:@!#12
> 213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
13,20d16
< 21
< 32
< 312
< 3
< 12312312312
< 3
< 123123123213
<
21a18
> 21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
23c20,23
< 123123
---
> 12312312312
> 123123123213
> 123123213123:123
> 12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
[root@web tmp]# diff 2.txt 3.txt
1,23c1,27
<
< 2
< 3
< 3
< 12:3:2:1:312:3123
< 21
< 32
< 112:2223:333213
< 312
< 2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
< 123123
< 123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
< 123213
< 213123::::!@#@!#:@!#213:@!#12
< 213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
< 3213123
< 12312321
< 21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
< 312312312
< 12312312312
< 123123123213
< 123123213123:123
< 12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
---
> root:x:0:0:root:/root:/bin/bash
> bin:x:1:1:bin:/bin:/sbin/nologin
> daemon:x:2:2:daemon:/sbin:/sbin/nologin
> adm:x:3:4:adm:/var/adm:/sbin/nologin
> lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
> sync:x:5:0:sync:/sbin:/bin/sync
> shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
> halt:x:7:0:halt:/sbin:/sbin/halt
> mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
> operator:x:11:0:operator:/root:/sbin/nologin
> games:x:12:100:games:/usr/games:/sbin/nologin
> ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
> nobody:x:99:99:Nobody:/:/sbin/nologin
> systemd-network:x:192:192:systemd Network Management:/:/sbin/nologin
> dbus:x:81:81:System message bus:/:/sbin/nologin
> polkitd:x:999:998:User for polkitd:/:/sbin/nologin
> libstoragemgmt:x:998:995:daemon account for libstoragemgmt:/var/run/lsm:/sbin/nologin
> colord:x:997:994:User for colord:/var/lib/colord:/sbin/nologin
> rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
> saned:x:996:993:SANE scanner daemon user:/usr/share/sane:/sbin/nologin
> gluster:x:995:992:GlusterFS daemons:/run/gluster:/sbin/nologin
> aaaaaaaaaaaaaaaaaaaaaa
> bbbbbbbbbbbbbbbbbbbbbbb1111111111222222222333333331cccccccccc
> hello world 888
> 666
> 777
> 999
[root@web tmp]# diff file1 file2
[root@web tmp]# diff -c 1.txt 2.txt
*** 1.txt       2025-07-28 21:46:59.593951441 +0800
--- 2.txt       2025-07-28 21:12:17.477645718 +0800
***************
*** 1,23 ****
! 112:2223:33321312:3:2:1:312:3123
! 123123213123:1232112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
! 21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
! 12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
! 213123::::!@#@!#:@!#213:@!#12123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
- 213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3123213
! 23213123
- 21
- 32
- 312
- 3
- 12312312312
- 3
- 123123123213
-12312321312312312
! 123123
--- 1,23 ----
!
! 2
! 3
! 312:3:2:1:312:3123
! 21
! 32
! 112:2223:333213
! 3122112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
! 123123123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123123213
! 213123::::!@#@!#:@!#213:@!#12
! 213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3321312312312321
+ 21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@312312312
! 12312312312
! 123123123213
! 123123213123:123
! 12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# diff dir1 dir2
只在 dir1 存在:file1
只在 dir2 存在:file2
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# copy 1.txt 5.txt
bash: copy: 未找到命令...
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# cp 1.txt 5.txt
[root@web tmp]# cp 2.txt 6.txt
[root@web tmp]# diff -uN 5.txt 6.txt
--- 5.txt       2025-07-30 20:05:17.378243112 +0800
+++ 6.txt       2025-07-30 20:05:24.485368451 +0800
@@ -1,23 +1,23 @@
-112:2223:333213
+
+2
+3
+312:3:2:1:312:3123
-123123213123:123
+21
+32
+112:2223:333213
+3122112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
-21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
-12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
-213123::::!@#@!#:@!#213:@!#12
+123123123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
-213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3123213
-2
+213123::::!@#@!#:@!#213:@!#12
+213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@33213123
-21
-32
-312
-3
-12312312312
-3
-123123123213
-12312321
+21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@312312312
-123123
+12312312312
+123123123213
+123123213123:123
+12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
[root@web tmp]# diff -uN 5.txt 6.txt >file6.patch
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# patch 5.txt file6.patch
patching file 5.txt
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# diff 5.txt 6.txt
[root@web tmp]# diff -c 5.txt 6.txt
[root@web tmp]# diff -u 5.txt 6.txt
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# cat 5.txt2
3
3
12:3:2:1:312:3123
21
32
112:2223:333213
312
2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
123123
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
123213
213123::::!@#@!#:@!#213:@!#12
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
3213123
12312321
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
312312312
12312312312
123123123213
123123213123:123
12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
[root@web tmp]# cat 6.txt2
3
3
12:3:2:1:312:3123
21
32
112:2223:333213
312
2112:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
123123
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
123213
213123::::!@#@!#:@!#213:@!#12
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
3213123
12312321
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
312312312
12312312312
123123123213
123123213123:123
12312312123122121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
[root@web tmp]# cat 5.txt | tr -d '[:/]'2
3
3
123213123123
21
32
1122223333213
312
2112123!@#!@#@!!@#!@#!@#!@#!@
123123
123123!@#213!@#123!@#!@#!#!@#123123@!3123
123213
213123!@#@!#@!#213@!#12
21321312312!@#!@!@312!@3123!@312!@#1221321312!23123!@3
3213123
12312321
21312312SADASD!@#!@#@!#!@#!@
312312312
12312312312
123123123213
123123213123123
12312312123122121312312!@#!@#!#ASASDSAD!@#!@#ASDASD!@#@!
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# tr -s [1-9] < 1.txt
12:23:3213
12:3:2:1:312:3123
123123213123:123
212:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
1231231212312121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
213123::::!@#@!#:@!#213:@!#12
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
123213
2
3213123
21
32
312
3
12312312312
3
12312312321312312321
312312312
123123
[root@web tmp]# tr -s [1-9] <5.txt2
3
3
12:3:2:1:312:3123
21
32
12:23:3213
312
212:123:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
123123
123123:!@#213:!@#123:!@#!@#:!#!@#:123123:@!3123
123213
213123::::!@#@!#:@!#213:@!#12
213213:12312:!@#!@:!@312:!@3123:!@312:!@#12:21321312:!23123:!@3
3213123
12312321
21312312:S:ADAS:D:!@:#!@:#:@!#:!@#!@
312312312
12312312312
123123123213
123123213123:123
1231231212312121312312:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# tr '[1-9]' '[@]' < 5.txt]
]
]
@]:]:]:@:]@]:]@]]
]@
]]
@@]:]]]]:]]]]@]
]@]
]@@]:@]]:!@#:!@#:@!:!@#!@:#:!@#:!@:#!@:
@]]@]]
@]]@]]:!@#]@]:!@#@]]:!@#!@#:!#!@#:@]]@]]:@!]@]]
@]]]@]
]@]@]]::::!@#@!#:@!#]@]:@!#@]
]@]]@]:@]]@]:!@#!@:!@]@]:!@]@]]:!@]@]:!@#@]:]@]]@]@]:!]]@]]:!@]
]]@]@]]
@]]@]]]@
]@]@]]@]:S:ADAS:D:!@:#!@:#:@!#:!@#!@
]@]]@]]@]
@]]@]]@]]@]
@]]@]]@]]]@]
@]]@]]]@]@]]:@]]
@]]@]]@]@]]@]]@]@]@]]@]:!@#!@#!#AS:ASDSAD:!@#!@#:ASDASD:!@#@!
[root@web tmp]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 192.168.235.20  netmask 255.255.255.0  broadcast 192.168.235.255inet6 fe80::20c:29ff:fe97:845e  prefixlen 64  scopeid 0x20<link>ether 00:0c:29:97:84:5e  txqueuelen 1000  (Ethernet)RX packets 221160  bytes 16267740 (15.5 MiB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 365321  bytes 158737689 (151.3 MiB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536inet 127.0.0.1  netmask 255.0.0.0inet6 ::1  prefixlen 128  scopeid 0x10<host>loop  txqueuelen 1000  (Local Loopback)RX packets 64  bytes 5280 (5.1 KiB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 64  bytes 5280 (5.1 KiB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255ether 52:54:00:2a:35:da  txqueuelen 1000  (Ethernet)RX packets 0  bytes 0 (0.0 B)RX errors 0  dropped 0  overruns 0  frame 0TX packets 0  bytes 0 (0.0 B)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0您在 /var/spool/mail/root 中有邮件
[root@web tmp]# inconfig ens33
bash: inconfig: 未找到命令...
[root@web tmp]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 192.168.235.20  netmask 255.255.255.0  broadcast 192.168.235.255inet6 fe80::20c:29ff:fe97:845e  prefixlen 64  scopeid 0x20<link>ether 00:0c:29:97:84:5e  txqueuelen 1000  (Ethernet)RX packets 221300  bytes 16278766 (15.5 MiB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 365485  bytes 158799857 (151.4 MiB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0[root@web tmp]# ifconfig ens33|grep 'Bcast'|tr -d '[a-zA-Z]'|cut -d: -f2,3,4
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 192.168.235.20  netmask 255.255.255.0  broadcast 192.168.235.255inet6 fe80::20c:29ff:fe97:845e  prefixlen 64  scopeid 0x20<link>ether 00:0c:29:97:84:5e  txqueuelen 1000  (Ethernet)RX packets 222598  bytes 16375798 (15.6 MiB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 367611  bytes 159710111 (152.3 MiB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0[root@web tmp]# ifconfig ens33|grep 'Bcast'
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep -i 'Bcast'
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33 |grep 'broadcast'inet 192.168.235.20  netmask 255.255.255.0  broadcast 192.168.235.255
[root@web tmp]# ifconfig ens33|grep 'broadcast'|tr -d '[a-z]'192.168.235.20   255.255.255.0   192.168.235.255
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep 'broadcast'|tr -d '[a-z]'|cut -d: -f2,3,4192.168.235.20   255.255.255.0   192.168.235.255
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep 'HWaddr'
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33 |grep 'ether'ether 00:0c:29:97:84:5e  txqueuelen 1000  (Ethernet)
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep 'ether'|tr -s ''ether 00:0c:29:97:84:5e  txqueuelen 1000  (Ethernet)
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33 |grep 'ethre'|cut -d' ' f2
cut: 您必须指定一组字节、字符或域的列表
Try 'cut --help' for more information.
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33 |grep 'ether'|cut -d' ' -f2您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33 |grep 'ether'ether 00:0c:29:97:84:5e  txqueuelen 1000  (Ethernet)
[root@web tmp]# ifconfig ens33|grep 'ether|tr -s ' '
> ^C
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep 'ether'|tr -s ''|cut -d' ' -f2您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33 | grep 'ether' |tr -s ' ' | cut -d ' ' -f3
00:0c:29:97:84:5e
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33 | grep 'ether' |tr -s ' ' |ls
1.txt        file2                sys-20250717.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-bolt.service-LMvltW
2.txt        file3.patch          sys-20250718.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-chronyd.service-UWJorp
3.txt        file5                sys-20250720.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-colord.service-tLvcX3
5.txt        file6.patch          sys-20250721.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-cups.service-LjtpWQ
6.txt        file.patch           sys-20250722.tar.gz  systemd-private-6f37c267bc534142983b62ad1ab0be9a-rtkit-daemon.service-gttbXa
bak.boot     passwd               sys-20250723.tar.gz  vmware-root_1022-2999133054
dir1         swapfile             sys-20250724.tar.gz  vmware-root_1207-3979642956
dir2         sys-20250714.tar.gz  sys-20250728.tar.gz  vmware-root_845-4021653450
EdP.aunSeOi  sys-20250715.tar.gz  sys-20250729.tar.gz  vmware-root_971-4290232077
file1        sys-20250716.tar.gz  sys-20250730.tar.gz
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33 |grep 'ether' |tr -s ' '|catether 00:0c:29:97:84:5e txqueuelen 1000 (Ethernet)
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33 |grep 'ether' |tr -s ' '|cut -d ' ' -f3
00:0c:29:97:84:5e
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep brodecast
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# brodacast
bash: brodacast: 未找到命令...
[root@web tmp]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 192.168.235.20  netmask 255.255.255.0  broadcast 192.168.235.255inet6 fe80::20c:29ff:fe97:845e  prefixlen 64  scopeid 0x20<link>ether 00:0c:29:97:84:5e  txqueuelen 1000  (Ethernet)RX packets 240830  bytes 17728559 (16.9 MiB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 398223  bytes 172882425 (164.8 MiB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0[root@web tmp]# ifconfig ens33|grep broadcastinet 192.168.235.20  netmask 255.255.255.0  broadcast 192.168.235.255
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep broadcast|tr -s ' 'inet 192.168.235.20 netmask 255.255.255.0 broadcast 192.168.235.255
[root@web tmp]# ifconfig ens33|grep broadcast| tr -s ''|cut -d ' ' -f7您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep broadcast|tr -s ' '|cut -d ' ' -f7
192.168.235.255
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep broadcast|tr -d '[a-zA-Z]'192.168.235.20   255.255.255.0   192.168.235.255
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# ifconfig ens33|grep broadcast|tr -d '[a-zA-Z]'|tr -s ' '|cut -d ' ' -f4
192.168.235.255
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# grep 'bash$' passwd
root:x:0:0:root:/root:/bin/bash
caozx26:x:1000:1002:caozx26:/home/caozx26:/bin/bash
XOAP:x:1002:1000::/rhome/XOAP:/bin/bash
cao1:x:1004:1223::/home/cao1:/bin/bash
cao2:x:1005:1005::/home/cao2:/bin/bash
xiaocao:x:1006:1006::/home/xiaocao:/bin/bash
xiao6:x:1007:1007::/home/xiao6:/bin/bash
tom:x:1008:1008::/home/tom:/bin/bash
jack:x:1009:1009::/home/jack:/bin/bash
cw01:x:1010:1224::/home/cw01:/bin/bash
sc01:x:1011:1226::/home/sc01:/bin/bash
rs01:x:1012:1225::/home/rs01:/bin/bash
boss01:x:1013:1004::/home/boss01:/bin/bash
cw02:x:1014:1224::/home/cw02:/bin/bash
sc02:x:1015:1226::/home/sc02:/bin/bash
rs02:x:1016:1225::/home/rs02:/bin/bash
harry:x:1017:1017::/home/mahei/redhat/harry:/bin/bash
netasha:x:1018:1018::/home/netasha:/bin/bash
sarsh:x:1019:1228::/home/sarsh:/bin/bash
OOO:x:1020:1020::/home/OOO:/bin/bash
jerry:x:1021:1229::/home/jerry:/bin/bash
kefu:x:1022:1022::/home/kefu:/bin/bash
kefu2:x:1023:1023::/home/kefu2:/bin/bash
user01:x:1024:1024::/home/user01:/bin/bash
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# grep 'bash$' passwd|grep -v 'root'
caozx26:x:1000:1002:caozx26:/home/caozx26:/bin/bash
XOAP:x:1002:1000::/rhome/XOAP:/bin/bash
cao1:x:1004:1223::/home/cao1:/bin/bash
cao2:x:1005:1005::/home/cao2:/bin/bash
xiaocao:x:1006:1006::/home/xiaocao:/bin/bash
xiao6:x:1007:1007::/home/xiao6:/bin/bash
tom:x:1008:1008::/home/tom:/bin/bash
jack:x:1009:1009::/home/jack:/bin/bash
cw01:x:1010:1224::/home/cw01:/bin/bash
sc01:x:1011:1226::/home/sc01:/bin/bash
rs01:x:1012:1225::/home/rs01:/bin/bash
boss01:x:1013:1004::/home/boss01:/bin/bash
cw02:x:1014:1224::/home/cw02:/bin/bash
sc02:x:1015:1226::/home/sc02:/bin/bash
rs02:x:1016:1225::/home/rs02:/bin/bash
harry:x:1017:1017::/home/mahei/redhat/harry:/bin/bash
netasha:x:1018:1018::/home/netasha:/bin/bash
sarsh:x:1019:1228::/home/sarsh:/bin/bash
OOO:x:1020:1020::/home/OOO:/bin/bash
jerry:x:1021:1229::/home/jerry:/bin/bash
kefu:x:1022:1022::/home/kefu:/bin/bash
kefu2:x:1023:1023::/home/kefu2:/bin/bash
user01:x:1024:1024::/home/user01:/bin/bash
[root@web tmp]# grep 'bash$' passwd|grep -v 'root'|cut -d: -f1,2,7
caozx26:x:/bin/bash
XOAP:x:/bin/bash
cao1:x:/bin/bash
cao2:x:/bin/bash
xiaocao:x:/bin/bash
xiao6:x:/bin/bash
tom:x:/bin/bash
jack:x:/bin/bash
cw01:x:/bin/bash
sc01:x:/bin/bash
rs01:x:/bin/bash
boss01:x:/bin/bash
cw02:x:/bin/bash
sc02:x:/bin/bash
rs02:x:/bin/bash
harry:x:/bin/bash
netasha:x:/bin/bash
sarsh:x:/bin/bash
OOO:x:/bin/bash
jerry:x:/bin/bash
kefu:x:/bin/bash
kefu2:x:/bin/bash
user01:x:/bin/bash
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# grep 'bash$' passwd|grep -v 'root'|cut -d: -f1,2,7|tr ':' '\t'
caozx26 x       /bin/bash
XOAP    x       /bin/bash
cao1    x       /bin/bash
cao2    x       /bin/bash
xiaocao x       /bin/bash
xiao6   x       /bin/bash
tom     x       /bin/bash
jack    x       /bin/bash
cw01    x       /bin/bash
sc01    x       /bin/bash
rs01    x       /bin/bash
boss01  x       /bin/bash
cw02    x       /bin/bash
sc02    x       /bin/bash
rs02    x       /bin/bash
harry   x       /bin/bash
netasha x       /bin/bash
sarsh   x       /bin/bash
OOO     x       /bin/bash
jerry   x       /bin/bash
kefu    x       /bin/bash
kefu2   x       /bin/bash
user01  x       /bin/bash
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# grep 'bash$' passwd|grep -v 'root'|cut -d: -f1,2,7|tr ':' '\t'|tee abc.txt
caozx26 x       /bin/bash
XOAP    x       /bin/bash
cao1    x       /bin/bash
cao2    x       /bin/bash
xiaocao x       /bin/bash
xiao6   x       /bin/bash
tom     x       /bin/bash
jack    x       /bin/bash
cw01    x       /bin/bash
sc01    x       /bin/bash
rs01    x       /bin/bash
boss01  x       /bin/bash
cw02    x       /bin/bash
sc02    x       /bin/bash
rs02    x       /bin/bash
harry   x       /bin/bash
netasha x       /bin/bash
sarsh   x       /bin/bash
OOO     x       /bin/bash
jerry   x       /bin/bash
kefu    x       /bin/bash
kefu2   x       /bin/bash
user01  x       /bin/bash
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# cat abc.txt
caozx26 x       /bin/bash
XOAP    x       /bin/bash
cao1    x       /bin/bash
cao2    x       /bin/bash
xiaocao x       /bin/bash
xiao6   x       /bin/bash
tom     x       /bin/bash
jack    x       /bin/bash
cw01    x       /bin/bash
sc01    x       /bin/bash
rs01    x       /bin/bash
boss01  x       /bin/bash
cw02    x       /bin/bash
sc02    x       /bin/bash
rs02    x       /bin/bash
harry   x       /bin/bash
netasha x       /bin/bash
sarsh   x       /bin/bash
OOO     x       /bin/bash
jerry   x       /bin/bash
kefu    x       /bin/bash
kefu2   x       /bin/bash
user01  x       /bin/bash
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# cp *.conf /dir1
cp: 无法获取"*.conf" 的文件状态(stat): 没有那个文件或目录
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# find ./ -name !1.txt
-bash: !1: event not found
[root@web tmp]# echo "$(hostname)"
web.cn
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# echo 'hostname'
hostname
[root@web tmp]# echo "hostname"
hostname
[root@web tmp]# echo '$(hostname)'
$(hostname)
[root@web tmp]# echo "$(hostname)"
web.cn
[root@web tmp]# echo "$(date)"
2025年 07月 30日 星期三 23:27:30 CST
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# echo '$(date)'
$(date)
[root@web tmp]# echo $(date)
2025年 07月 30日 星期三 23:27:56 CST
[root@web tmp]# echo $(hostname)
web.cn
[root@web tmp]# echo $(date +%F)
2025-07-30
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# echo `echo $(date +%F)`
2025-07-30
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# echo `echo $(hostname)`
web.cn
[root@web tmp]# echo `hostname`
web.cn
[root@web tmp]# echo `date+%F`
bash: date+%F: 未找到命令...[root@web tmp]# echo `date +%F`
2025-07-30
您在 /var/spool/mail/root 中有邮件
[root@web tmp]# echo `echo `hostname``
hostname
[root@web tmp]# echo `echo $(hostname)`
web.cn
[root@web tmp]#

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.pswp.cn/pingmian/91767.shtml
繁体地址,请注明出处:http://hk.pswp.cn/pingmian/91767.shtml
英文地址,请注明出处:http://en.pswp.cn/pingmian/91767.shtml

如若内容造成侵权/违法违规/事实不符,请联系英文站点网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

力扣457:环形数组是否存在循环

力扣457:环形数组是否存在循环题目思路代码题目 存在一个不含 0 的 环形 数组 nums &#xff0c;每个 nums[i] 都表示位于下标 i 的角色应该向前或向后移动的下标个数&#xff1a; 如果 nums[i] 是正数&#xff0c;向前&#xff08;下标递增方向&#xff09;移动 |nums[i]| 步…

在 Elasticsearch 中落地 Learning to Rank(LTR)

1 为什么要引入 LTR&#xff1f; 常规检索&#xff08;BM25、语义检索、Hybrid、RRF …&#xff09;往往只能基于少量信号&#xff08;关键词命中、向量相似度&#xff09;排序。 Learning-to-Rank 通过机器学习模型把多维度特征&#xff08;文档属性、查询属性、查询-文档相关…

Socket编程——TCP协议

文章目录一、TCP传输二、相关接口三、多进程版本四、多线程版本一、TCP传输 TCP和UDP类似&#xff0c;但是在传输中TCP有输入&#xff0c;输出缓冲区&#xff0c;看下面的传输图片 可以理解为TCP之间的数据传输都是依赖各自的socket&#xff0c;socket就充当传输的中介吧。 而…

GitHub使用小记——本地推送、外部拉取和分支重命名

GitHub 项目推送与拉取等操作使用随记 本小记适用于个人项目或组织项目&#xff0c;涵盖 GitHub 推送、拉取、分支管理、.gitignore 设置等常见需求。 1. 将已有本地工程推送至 GitHub 新仓库 1.1 前提条件 本地项目结构完整&#xff0c;已准备好&#xff1b;本地已安装 Git…

RabbitMQ 延时队列插件安装与使用详解(基于 Delayed Message Plugin)

RabbitMQ 延时队列插件安装与使用详解&#xff08;基于 Delayed Message Plugin&#xff09;&#x1f4cc; 一、什么是 RabbitMQ 延时队列&#xff1f;&#x1f680; 二、安装前准备✅ RabbitMQ 环境要求&#x1f527; 三、安装延时队列插件&#x1f9e9; 插件名称&#xff1a;…

Vue项目使用ssh2-sftp-client实现打包自动上传到服务器(完整教程)

告别手动拖拽上传&#xff01;本教程将手把手教你如何通过ssh2-sftp-client实现Vue项目打包后自动上传到服务器&#xff0c;提升部署效率300%。&#x1f680;一、需求场景与解决方案在Vue项目开发中&#xff0c;每次执行npm run build后都需要手动将dist目录上传到服务器&#…

《质光相济:Three.js中3D视觉的底层交互逻辑》

在Three.js搭建的虚拟维度中,光照与材质的关系远非技术参数的简单叠加,当光线以数字形态穿越虚空,与物体表面相遇的瞬间,便开始书写属于这个世界的物理叙事——每一缕光斑的形状、每一块阴影的浓淡、每一寸肌理的反光,都是对现实光学规律的转译与重构。理解这种交互的深层…

无刷电机在汽车领域的应用与驱动编程技术

文章目录引言一、核心应用场景1. 新能源汽车动力系统2. 底盘控制系统3. 车身与舒适系统4. 智能驾驶与安全系统二、无刷电机的技术优势解析三、无刷电机驱动编程基础1. 驱动原理2. 驱动架构四、核心控制算法与实现1. 六步换向法&#xff08;梯形波控制&#xff09;算法流程图C语…

【游戏引擎之路】登神长阶(十八):3天制作Galgame引擎《Galplayer》——无敌之道心

游戏引擎开发记录&#xff1a;2024年 5月20日-6月4日&#xff1a;攻克2D物理引擎。 2024年 6月4日-6月13日&#xff1a;攻克《3D数学基础》。 2024年 6月13日-6月20日&#xff1a;攻克《3D图形教程》。 2024年 6月21日-6月22日&#xff1a;攻克《Raycasting游戏教程》。 2024年…

kotlin kmp 跨平台环境使用sqldelight

欢迎访问我的主页: https://heeheeaii.github.io/ 1. 项目结构 SQLDelightKMPDemo/ ├── shared/ │ ├── src/ │ │ ├── commonMain/kotlin/ │ │ ├── androidMain/kotlin/ │ │ ├── desktopMain/kotlin/ │ │ └── commonMain/sqldel…

机器学习【五】decision_making tree

决策树是一种通过树形结构进行数据分类或回归的直观算法&#xff0c;其核心是通过层级决策路径模拟规则推理。主要算法包括&#xff1a;ID3算法基于信息熵和信息增益选择划分属性&#xff1b;C4.5算法改进ID3&#xff0c;引入增益率和剪枝技术解决多值特征偏差&#xff1b;CART…

简单记录一下VSCode中的一些学习记

在刚开始学习VSCode时&#xff0c;相信大家都会好奇VSCode底部区域那几个不同的状态栏具体有什么作用&#xff08;输出、调试控制台、终端、端口&#xff09;&#xff0c;貌似好像都是输出与代码相关的信息的&#xff1f;貌似代码运行结果既可以出现在输出中&#xff0c;也可以…

基于 Hadoop 生态圈的数据仓库实践 —— OLAP 与数据可视化(二)

目录 二、Hive、SparkSQL、Impala 比较 1. SparkSQL 简介 2. Hive、SparkSQL、Impala 比较 &#xff08;1&#xff09;功能 &#xff08;2&#xff09;架构 &#xff08;3&#xff09;场景 3. Hive、SparkSQL、Impala 性能对比 &#xff08;1&#xff09;cloudera 公司…

C++:std::array vs 原生数组 vs std::vector

&#x1f4cc; C&#xff1a;std::array vs 原生数组 vs std::vector 引用&#xff1a; C/C 标准库 std::vector、std::array、原生静态数组 的区别有哪些&#xff1f; 深度剖析&#xff1a;std::vector 内存机制与 push_back 扩容策略 今天过去了 还有许许多个明天 能和大…

Hyper-V + Centos stream 9 搭建K8s集群(二)

一、安装自动补全主节点安装就可以yum install -y bash-completion echo source <(kubectl completion bash) >>~/.bashrc kubectl completion bash >/etc/bash_completion.d/kubectl二、安装Calico网络插件&#xff08;主节点&#xff09;下载文件wget https://ca…

VBA代码解决方案第二十七讲:禁用EXCEL工作簿右上角的关闭按钮

《VBA代码解决方案》(版权10028096)这套教程是我最早推出的教程&#xff0c;目前已经是第三版修订了。这套教程定位于入门后的提高&#xff0c;在学习这套教程过程中&#xff0c;侧重点是要理解及掌握我的“积木编程”思想。要灵活运用教程中的实例像搭积木一样把自己喜欢的代码…

Spring AI 系列之三十一 - Spring AI Alibaba-基于Nacos的MCP

之前做个几个大模型的应用&#xff0c;都是使用Python语言&#xff0c;后来有一个项目使用了Java&#xff0c;并使用了Spring AI框架。随着Spring AI不断地完善&#xff0c;最近它发布了1.0正式版&#xff0c;意味着它已经能很好的作为企业级生产环境的使用。对于Java开发者来说…

sqli-labs:Less-12关卡详细解析

1. 思路&#x1f680; 本关的SQL语句为&#xff1a; $uname".$uname."; $passwd".$passwd."; $sql"SELECT username, password FROM users WHERE username($uname) and password($passwd) LIMIT 0,1";注入类型&#xff1a;字符串型&#xff0…

【SpringAI】8.通过json动态添加mcp服务

前言 官方示例的代码中&#xff0c;mcp一般是配置到yml中或者json文件中&#xff0c;使用自动装配的方式注入服务&#xff0c;这种方式不方便在程序启动后添加新的服务&#xff0c;这里参考cherry studio的方式动态添加mcp服务 1.确定方案 mcp服务的维护放到mysql业务数据库维…

【PDF + ZIP 合并器:把ZIP文件打包至PDF文件中】

B站链接 PDF ZIP 合并器&#xff1a;把ZIP文件打包至PDF文件中_哔哩哔哩_bilibiliz 加强作者的工具 https://wwgw.lanzn.com/i8h1C32k9bef 密码:30cv 新增c框架&#xff0c;加快运行速度