Linux730 tr:-d /-s;sort:-r,-n,-R,-o,-t,-k,-u;bash;cut:-d,-c;tee -a;uniq -c -i

回顧

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;加快運行速度