当前位置: 首页 > news >正文

Linux find

1.find介绍

linux查找命令find是linux运维中很重要、很常用的命令之一,find用于根据指定条件的匹配参数来搜索和查找文件和目录列表,我们可以通过权限、用户、用户组、文件类型、日期、大小等条件来查找文件。

2.find语法

find语法

find [查找路径] [查找条件] [处理动作]

查找路径:指定的具体目标路径 

查找条件:指定的查找标准,可以是权限、用户、用户组、文件类型、日期、大小等标准进行 

处理动作:对符合条件的文件做相关操作,比如:输出屏幕,存放至某个文件中

3.样例

3.1.根据文件名称,使用find命令进行查找

->在当前工作目录中查找名称为ztj.txt的文件

命令:

find ztj.txt

OR

find . -name ztj.txt -maxdepth 1

[root@rhel77 ~]# find ztj.txt
ztj.txt
[root@rhel77 ~]# find . -name ztj.txt -maxdepth 1
find: warning: you have specified the -maxdepth option after a non-option argument -name, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it).  Please specify options before other arguments../ztj.txt
[root@rhel77 ~]# 

->在/root目录下,查找名称为ztj.txt的所有文件

命令:

find /root -name ztj.txt

[root@rhel77 ~]# find /root -name ztj.txt
/root/1/ztj.txt
/root/ztj.txt
/root/ztj11/ztj.txt
[root@rhel77 ~]# 

->在/root目录中查找名称为z的所有目录

命令:

find /root -type d -name z

[root@rhel77 ~]# find /root -type d -name z
/root/z
[root@rhel77 ~]# 

其中,-type类型参数介绍如下:

f:普通文件

l:符号链接

d:目录

c:字符设备

b:块设备

s:套接字

->在/root目录下,查找所有以.zip和.log为扩展名的文件

命令:

find /root -type f \( -name "*.zip" -o -name "*.log" \) -ls

[root@rhel77 ~]# find /root -type f \( -name "*.zip" -o -name "*.log" \) -ls
1731369   80 -rw-r--r--   1 root     root        81141 May  4 16:13 /root/wordpress_auto_install.log
1731610    4 -rw-r--r--   1 root     root         2059 Jul 28 15:14 /root/ztj.zip
3269480    4 -rw-r--r--   1 root     root          586 May 17 22:19 /root/disk.log
3257826   40 -rw-r--r--   1 root     root        40739 May 25 14:01 /root/extundelete-0.2.4/config.log
1731382    4 -rw-r--r--   1 root     root          642 Jul 21 14:04 /root/1.zip
1731605    4 -rw-r--r--   1 root     root          106 Aug 10 09:10 /root/urandom.log
1731400    4 -rw-r--r--   1 root     root         1475 Jul 21 14:08 /root/2.zip70    4 -rw-r--r--   1 root     root         3334 Jul 20 08:50 /root/z.zip
3256369    4 -rw-r--r--   1 root     root           48 May 19 09:07 /root/zt1.log
[root@rhel77 ~]# 

->在/root目录下,查找所有以.png,.jpg,.php和.js为扩展名的文件

命令:

find /root -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.php" -o -name "*.js" \) -ls
 

[root@rhel77 ~]# find /root -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.php" -o -name "*.js" \) -ls
3247961    0 -rw-r--r--   1 root     root            0 Aug 17 14:25 /root/1.png
3247965    0 -rw-r--r--   1 root     root            0 Aug 17 14:25 /root/2.jpg
3247966    0 -rw-r--r--   1 root     root            0 Aug 17 14:25 /root/3.php
3247967    0 -rw-r--r--   1 root     root            0 Aug 17 14:25 /root/4.js
[root@rhel77 ~]# 

3.2.根据文件权限,使用find命令进行查找

->在/root目录下,查找权限为777的文件

命令:

find /root -type f -perm 0777  -maxdepth 1 -ls

[root@rhel77 ~]# find /root -type f -perm 0777  -maxdepth 1 -ls
find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it).  Please specify options before other arguments.1731602  160 -rwxrwxrwx   1 root     root       160059 Aug 16 09:56 /root/abc.txt
3256377    4 -rwxrwxrwx   1 root     root          259 May 23 16:48 /root/user_info.txt
[root@rhel77 ~]# 

->在/root目录下,查找权限不是777的文件

命令:

find /root -type f ! -perm 777  -maxdepth 1 -ls

[root@rhel77 ~]# find /root -type f ! -perm 777  -maxdepth 1 -ls | tail -n 5
find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it).  Please specify options before other arguments.3256384    4 -rwxr-xr-x   1 root     root          988 May 23 22:33 /root/fdisk.sh
3257852    4 -rw-r--r--   1 root     root           62 May 27 14:42 /root/1234.txt
430437    4 -rwxr-xr-x   1 root     root           64 Jun  5 21:23 /root/ztj-1.sh
1731615    4 -rwxr-xr-x   1 root     root           21 Jun  7 13:55 /root/uuidgen.sh
430376    4 -rw-r--r--   1 root     root           41 Jul 21 13:59 /root/zzz.txt.bz2
[root@rhel77 ~]# 

->在/root目录下,查找权限为777的目录,将其权限设置为755

命令:

find /root -type d -perm 777 -maxdepth 1 -ls -exec chmod 755 {} \;
 

[root@rhel77 ~]# find /root -type d -perm 777 -maxdepth 1 -ls -exec chmod 755 {} \;
find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it).  Please specify options before other arguments.69   12 drwxrwxrwx  24 root     root         8192 Aug 16 09:27 /root
1729025    0 drwxrwxrwx   2 root     root           90 Jul 20 10:29 /root/test

->在/root目录下,查找名称为cc.txt文件,并将其删除

命令:

find /root -type f -name cc.txt -maxdepth 1 | xargs rm -rf

[root@rhel77 ~]# find /root -type f -name cc.txt -maxdepth 1 | xargs rm -rf
find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it).  Please specify options before other arguments.[root@rhel77 ~]# 

OR

find /root -type f -name cc.txt -maxdepth 1 -exec rm -rf {} \;

[root@rhel77 ~]# find /root -type f -name cc.txt -maxdepth 1 -exec rm -rf {} \;
find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it).  Please specify options before other arguments.[root@rhel77 ~]# 

->在/root目录下,找出权限是600的文件

命令:

find /root/ -perm 600 -ls

[root@rhel77 ~]# find /root/ -perm 600 -ls
3698739    4 -rw-------   1 root     root         1679 Apr 27 14:09 /root/.ssh/id_rsa1601   16 -rw-------   1 root     root        14605 Aug 17 10:03 /root/.bash_history
3247958    8 -rw-------   1 root     root         5648 Aug 17 10:03 /root/.viminfo
1731372    0 -rw-------   1 alice    alice           0 May 27 21:04 /root/test/alice.txt
202108776    4 -rw-------   1 root     root           11 Aug 17 13:32 /root/.cache/abrt/lastnotification
542180    4 -rw-------   1 root     root          312 Aug 10 08:51 /root/.lesshst
3247962    4 -rw-------   1 root     root          312 Aug 17 13:32 /root/.Xauthority
1731398    4 -rw-------   1 root     root          306 Aug 10 09:08 /root/nohup.out
3256372    4 -rw-------   1 root     root           15 Jul 17 08:35 /root/.lvm_history
3547010    4 -rw-------   1 root     root           18 Jun  4 12:00 /root/.mysql_history
[root@rhel77 ~]# 

上述命令(find /root/ -perm 600 -ls)会找到所有只有rw-------权限的文件。

另外,

如下命令:

find /root/ -perm -600 -ls

-600表示列出只要是包括了rw的其它位任意的文件

[root@rhel77 ~]# find /root/ -perm -600 -ls |head -n 1069   16 drwxr-xr-x  24 root     root        12288 Aug 17 13:32 /root/
3180996    4 -rwxr-xr-x   1 root     root           79 Apr 11 09:55 /root/access.sh
135138217    0 drwxr-xr-x   2 root     root            6 Apr 24 19:08 /root/110
502725    4 -rw-r--r--   1 root     root           18 Dec 29  2013 /root/.bash_logout
542640    4 -rwxr-xr-x   1 root     root          192 Mar 15 09:25 /root/earth-1.sh
1729048    4 -rw-r--r--   1 root     root           57 Mar 16 15:57 /root/symlinks-1.list
542203    4 -rwxr-xr-x   1 root     root           94 Mar 30 13:57 /root/apache-1.sh
3193035    4 -rwxr-xr-x   1 root     root          207 Apr 18 22:22 /root/spawn.sh
502727    4 -rw-r--r--   1 root     root          176 Dec 29  2013 /root/.bashrc
3181007    4 -rwxr-xr-x   1 root     root          155 Apr 11 14:05 /root/case-2.sh
[root@rhel77 ~]# 

如下命令:

find /root/ -perm /600 -ls

/600表示列出指定的权限符合r--------或w--------的文件。

[root@rhel77 ~]# find /root/ -perm /600 -ls |head -n 1069   16 drwxr-xr-x  24 root     root        12288 Aug 17 13:32 /root/
3180996    4 -rwxr-xr-x   1 root     root           79 Apr 11 09:55 /root/access.sh
135138217    0 drwxr-xr-x   2 root     root            6 Apr 24 19:08 /root/110
502725    4 -rw-r--r--   1 root     root           18 Dec 29  2013 /root/.bash_logout
542640    4 -rwxr-xr-x   1 root     root          192 Mar 15 09:25 /root/earth-1.sh
1729048    4 -rw-r--r--   1 root     root           57 Mar 16 15:57 /root/symlinks-1.list
542203    4 -rwxr-xr-x   1 root     root           94 Mar 30 13:57 /root/apache-1.sh
3193035    4 -rwxr-xr-x   1 root     root          207 Apr 18 22:22 /root/spawn.sh
502727    4 -rw-r--r--   1 root     root          176 Dec 29  2013 /root/.bashrc
3181007    4 -rwxr-xr-x   1 root     root          155 Apr 11 14:05 /root/case-2.sh
[root@rhel77 ~]# 

3.3.基于文件所有者和所属组,使用find命令进行查找

->在/root目录下,找出文件所有者为root,名称为ztj.txt的文件

命令:

find /root/ -user root -name ztj.txt -ls

[root@rhel77 ~]# find /root/ -user root -name ztj.txt -ls
68916551    4 -rw-r--r--   1 root     root           28 Mar 30 16:54 /root/1/ztj.txt
3247948    0 -rw-r--r--   1 root     root            0 Aug  4 10:00 /root/ztj.txt
203522440    4 -rw-r--r--   1 root     root            4 Apr 23  2022 /root/ztj11/ztj.txt
[root@rhel77 ~]# 

->在/root目录下,找出文件属组为root,文件名称为process.txt的文件

命令:

find /root/ -group root -name process.txt -ls

[root@rhel77 ~]# find /root/ -group root -name process.txt -ls
1731367   48 -rw-r--r--   1 root     root        48638 May 16 16:43 /root/process.txt
[root@rhel77 ~]# 

->在/root目录,查找所有者为root的所有.txt文件

命令:

find /root -user root -iname "*.txt" -ls

其中,

-iname:忽略name的大小写版本

[root@rhel77 ~]# find /root -user root -iname "*.txt" -ls 
1731370    4 -rw-r--r--   3 root     root            8 May 27 21:29 /root/test/a.txt
1731370    4 -rw-r--r--   3 root     root            8 May 27 21:29 /root/test/b.txt
1731370    4 -rw-r--r--   3 root     root            8 May 27 21:29 /root/test/d.txt
3181009    4 -rw-r--r--   1 root     root           14 Mar 23 15:18 /root/all.txt
3193028    4 -rw-r--r--   1 root     root          604 Apr 18 13:36 /root/system.txt
542186    4 -rw-r--r--   1 root     root            6 Mar  1 14:33 /root/bb.txt
1555878    4 -rw-r--r--   1 root     root            9 Jun  5 21:41 /root/user.txt
3193757    4 -rw-r--r--   1 root     root          154 Apr 26 08:56 /root/test.txt
137253126    4 -rw-r--r--   1 root     root           37 Aug  4 09:57 /root/123/zzz.txt
137119752    4 -rw-r--r--   1 root     root            6 Mar 15 10:12 /root/2/bb.txt
430370    4 -rw-r--r--   1 root     root           37 Aug  4 09:55 /root/zzz.txt
137259616    4 -rw-r--r--   1 root     root            3 May 27 17:05 /root/z/aa.txt
68916537    4 -rw-r--r--   1 root     root            2 Mar 30 16:54 /root/1/aa.txt
68916539    4 -rw-r--r--   1 root     root           14 Mar 30 16:54 /root/1/all.txt
68916543    4 -rw-r--r--   1 root     root            6 Mar 30 16:54 /root/1/bb.txt
68916545    4 -rw-r--r--   1 root     root          464 Mar 30 16:54 /root/1/cc.txt
68916547    4 -rw-r--r--   1 root     root            6 Mar 30 16:54 /root/1/user.txt
68916551    4 -rw-r--r--   1 root     root           28 Mar 30 16:54 /root/1/ztj.txt
3698754    4 -r--r--r--   1 root     root           10 Apr 28 08:58 /root/gg.txt
1731602  180 -rwxrwxrwx   1 root     root       183335 Aug 17 13:54 /root/abc.txt
1731374    4 -rw-r--r--   1 root     root           58 May 13 20:12 /root/online.txt
1731378    4 -rw-r--r--   1 root     root         1636 May 13 20:12 /root/offline.txt
3269441    4 -rw-r--r--   1 root     root          132 May  9 22:15 /root/off.txt
3269442    4 -rw-r--r--   1 root     root            1 May  9 22:15 /root/on.txt
3269445    4 -rw-r--r--   1 root     root         1794 May 19 09:18 /root/a.txt
1731367   48 -rw-r--r--   1 root     root        48638 May 16 16:43 /root/process.txt
3247948    0 -rw-r--r--   1 root     root            0 Aug  4 10:00 /root/ztj.txt
1731387    4 -rw-r--r--   1 root     root          361 May 29 19:53 /root/1.txt
3193031    4 -rw-r--r--   1 root     root           56 Apr 20 10:52 /root/v.txt
1731403 512000 -rw-r--r--   1 root     root     524288000 May 31 08:42 /root/boc.txt
1729071    0 -rw-r--r--   1 root     root            0 Jul 20 08:33 /root/DDA/ztj/1.txt
1731379    0 -rw-r--r--   1 root     root            0 Jul 20 08:34 /root/DDA/ztj/2.txt
1731391    0 -rw-r--r--   1 root     root            0 Jul 20 08:34 /root/DDA/ztj/3.txt
1731394    0 -rw-r--r--   1 root     root            0 Jul 20 08:34 /root/DDA/ztj/4.txt
1731404    0 -rw-r--r--   1 root     root            0 Jul 20 08:34 /root/DDA/ztj/5.txt
1731406    0 -rw-r--r--   1 root     root            0 Jul 20 08:34 /root/DDA/ztj/6.txt
3698742    4 -rw-r--r--   1 root     root          102 Apr 23 21:12 /root/brace.txt
3247960    0 -rw-r--r--   1 root     root            0 Aug 17 13:53 /root/tttt.TXT
203522440    4 -rw-r--r--   1 root     root            4 Apr 23  2022 /root/ztj11/ztj.txt
203522446    0 lrwxrwxrwx   1 root     root            7 Apr 23  2022 /root/ztj11/aa.txt -> ztj.txt
3256377    4 -rwxrwxrwx   1 root     root          259 May 23 16:48 /root/user_info.txt
430371    4 -rw-r--r--   1 root     root         2137 Aug  4 09:55 /root/zzza.txt
3698759    0 lrwxrwxrwx   1 root     root            7 Apr 28 09:06 /root/hh.txt -> ztj.txt
430369    4 -rw-r--r--   1 root     root           23 Jul 19 08:38 /root/ztj1.txt
3269443    4 -rw-r--r--   1 root     root           52 May 19 09:18 /root/b.txt
1731368    4 -rw-r--r--   1 root     root          892 May 16 16:56 /root/stat.txt
3256365    4 -rw-r--r--   1 root     root            6 May 18 21:01 /root/22.txt
3257852    4 -rw-r--r--   1 root     root           62 May 27 14:42 /root/1234.txt
[root@rhel77 ~]# 

3.4.根据文件日期和时间,使用find命令进行查找

linux系统里面的文件都有三种属性:
访问(access)时间(-atime/天,-amin/分钟):用户最近一次访问时间
修改(modify)时间(-mtime/天,-mmin/分钟):文件最后一次修改时间
变化(change)时间(-ctime/天,-cmin/分钟):文件元数据(例如权限、属性等)最后一次修改时间

->在/root目录下,查找50天外修改的所有文件

命令:

find /root -mtime +50 -ls

[root@rhel77 ~]# find /root -mtime +50 -ls |head -n 10
3180996    4 -rwxr-xr-x   1 root     root           79 Apr 11 09:55 /root/access.sh
135138217    0 drwxr-xr-x   2 root     root            6 Apr 24 19:08 /root/110
502725    4 -rw-r--r--   1 root     root           18 Dec 29  2013 /root/.bash_logout
542640    4 -rwxr-xr-x   1 root     root          192 Mar 15 09:25 /root/earth-1.sh
1729048    4 -rw-r--r--   1 root     root           57 Mar 16 15:57 /root/symlinks-1.list
542203    4 -rwxr-xr-x   1 root     root           94 Mar 30 13:57 /root/apache-1.sh
3193035    4 -rwxr-xr-x   1 root     root          207 Apr 18 22:22 /root/spawn.sh
502727    4 -rw-r--r--   1 root     root          176 Dec 29  2013 /root/.bashrc
3181007    4 -rwxr-xr-x   1 root     root          155 Apr 11 14:05 /root/case-2.sh
502728    4 -rw-r--r--   1 root     root          100 Dec 29  2013 /root/.cshrc
[root@rhel77 ~]# 

->在/root目录下,查找最近1小时内修改的所有文件

命令:

find /root -mmin -60 -ls
 

[root@rhel77 ~]# find /root -mmin -60 -ls69   16 drwxr-xr-x  24 root     root        12288 Aug 17 13:53 /root
201482216    0 drwxr-xr-x   2 root     root           30 Aug 17 13:32 /root/.cache/abrt
202108776    4 -rw-------   1 root     root           11 Aug 17 13:32 /root/.cache/abrt/lastnotification
3247962    4 -rw-------   1 root     root          312 Aug 17 13:32 /root/.Xauthority
1731602  180 -rwxrwxrwx   1 root     root       184083 Aug 17 14:11 /root/abc.txt
3247960    0 -rw-r--r--   1 root     root            0 Aug 17 13:53 /root/tttt.TXT
[root@rhel77 ~]# 

3.5.根据文件大小,使用find命令进行查找

->在/root目录下,找到大小为15MB的文件

命令:

find /root -size 15M -ls

[root@rhel77 ~]# find /root -size 15M -ls
3268520 14924 -rw-r--r--   1 root     root     15279408 Jun  3 20:18 /root/mysql-community-server-minimal-5.7.42-1.el7.x86_64.rpm
[root@rhel77 ~]# 

->在/root目录下,找到大于1MB且小于16MB的所有文件

命令:

find /root -size +1M -size -16M -ls

[root@rhel77 ~]# find /root -size +1M -size -16M -ls
3268520 14924 -rw-r--r--   1 root     root     15279408 Jun  3 20:18 /root/mysql-community-server-minimal-5.7.42-1.el7.x86_64.rpm
3698723 8872 -rw-r--r--   1 root     root      9082696 Apr 30 07:09 /root/wordpress-4.9.4-zh_CN.tar.gz
69023364 1860 -rw-r--r--   1 root     root      1904320 May 25 14:01 /root/extundelete-0.2.4/src/extundelete-extundelete.o
69023371 1296 -rwxr-xr-x   1 root     root      1323312 May 25 14:01 /root/extundelete-0.2.4/src/extundelete
1731386 10224 -rw-r--r--   1 root     root     10466248 May 29 13:50 /root/aa.tar.gz
[root@rhel77 ~]# 

3.6.基于inode删除ztj.txt文件(使用频率居高)

命令:

ls -li ztj.txt

find /root -inum 3247948 -exec rm -rf {} \;

[root@rhel77 ~]# pwd
/root
[root@rhel77 ~]# ls -li ztj.txt
3247948 -rw-r--r-- 1 root root 0 Aug  4 10:00 ztj.txt
[root@rhel77 ~]# find /root -inum 3247948 -ls
3247948    0 -rw-r--r--   1 root     root            0 Aug  4 10:00 /root/ztj.txt
[root@rhel77 ~]# find /root -inum 3247948 -exec rm -rf {} \;
[root@rhel77 ~]# ls -li ztj.txt
ls: cannot access ztj.txt: No such file or directory
[root@rhel77 ~]# 

相关文章:

Linux find

1.find介绍 linux查找命令find是linux运维中很重要、很常用的命令之一,find用于根据指定条件的匹配参数来搜索和查找文件和目录列表,我们可以通过权限、用户、用户组、文件类型、日期、大小等条件来查找文件。 2.find语法 find语法 find [查找路径] …...

UE4实现断线重连功能

断线重连的整体逻辑是 设备离线后,根据需要决定是否保留pawn,还是设备重连后再重新生成一个,然后是断线重连时的验证方式,最后是playerstate重连后的属性保留 重载Playercontroller的PawnLeavingGame,这里是设备断线后&#xff0…...

nginx笔记

1. nginx 简介 nginx性能比apache强,体现 在io模型方面 76 Pv: UV : 不同浏览器是不同的UV GET 获取 POST 上传 HEAT 只看头 访问网站的流程 1.dns解析 2.cdn 3.tcp 4.web服务器 处理 建立连接 接收请求 处理请求 GET POST等 获取资源 构…...

动态库的制作和使用

动态库和静态库的工作原理 配置环境变量 方式1: 坏处:环境变量是临时的 方式2: 1 用户级别的配置: 进入到/home,找到.bashrc,进入 先去找到库的路径 然后再到.bashrc最后一行输入路径 使其生效 2 系统…...

AWS Glue Pyspark+Athena基础学习汇总

Pyspark 基础学习汇总篇🍎 一、AWS 架构 ① AWS Glue:工作平台,包括脚本的编写以及管理脚本的运行状态以及调度等(主要:数据库配置、ETL和数据转换脚本编写、调度) ② Amazon S3 数据湖(数仓):数据的存储 ③ Athena:(雅典娜)SQL直接编写查询工作台(会产生费用) ④ Q…...

智能合约安全新范式,超越 `require`和`assert`

智能合约安全新范式,超越 require_assert 摘要 不要只为特定的函数写 require 语句;为你的协议写 require 语句。函数遵循检查(requirements)-生效(Effects)-交互(INteractions)协议不变性(Invariants)或 FREI-PI 模式可以帮助你的合约更加安全&#x…...

【ESP-S3-BOX-Lite花屏问题】:Github下载源码(出厂源码factory_demo)编译调试到ESP-S3-BOX-Lite中出现花屏现象

项目场景: 最近拿到了一块乐鑫的 ESP-S3-BOX-Lite (esp-box: ESP-BOX 是乐鑫信息科技) 详细资料(esp32_s3_box_lite) 版本信息 ESP-BOX依赖的 ESP-IDF分支信息支持状态master> release/v5.1 commit id: 22cfbf3…...

Redis集群3.2.11离线安装详细版本(使用Ruby)

1.安装软件准备 1.Redis版本下载 Index of /releases/http://download.redis.io/releases/ 1.2gcc环境准备 GCC(GNU Compiler Collection,GNU编译器套件)是一套用于编译程序代码的开源编译器工具集。它的主要用途是将高级编程语言(如C、C++、Fortran等)编写的源代码转换…...

Ansible自动化运维

目录 前言 一、概述 常见的开源自动化运维工具比较 二、ansible环境搭建 三、ansible模块 (一)、hostname模块 (二)、file模块 (三)、copy模块 (四)、fetch模块 &#xff…...

MSTP + Eth-Trunk配置实验 华为实验手册

1.1 实验介绍 1.1.1 关于本实验 以太网是当今现有局域网LAN(Local Area Network)采用的最通用的通信协议标准,以太网作为一种原理简单、便于实现同时又价格低廉的局域网技术已经成为业界的主流。 本实验主要介绍了LAN网络中的Eth-Trunk技术…...

滚动菜单 flutter

想实现这个功能: 下面的代码可以实现: import package:flutter/material.dart;void main() > runApp(MyApp());class MyApp extends StatelessWidget {static const String _title Flutter Code Sample;overrideWidget build(BuildContext context)…...

javaee springMVC数字类型转换之通过注解的方式

po 在属性上增加注解 NumberFormat(pattern “#,#.#”) package com.test.pojo;import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.NumberFormat;import java.util.Date;public class Users {private int uid;pr…...

SQL中CASE的用法

在SQL中,CASE语句是一种条件表达式,用于根据条件执行不同的操作。它有两种形式:简单CASE表达式和搜索CASE表达式。 简单CASE表达式的语法如下: CASE expressionWHEN value1 THEN result1WHEN value2 THEN result2...ELSE result …...

自己的碎碎念集合

自己的碎碎念集合 2023-09-07 c++叠加三目运算符闰年计算法2023-08-13 一个小题目 A+B problem一、问题及解答关碍总结2023-07-26 C的2至36进制转换函数一、itoa()函数的示例代码总结2023-07-19 平面坐标下判断三角形以及输出周长和面积一. 基本知识总结2023-06-25 达芬奇去除白…...

暂定名「码道功成:Coder启示录」

听人劝、吃饱饭,奉劝各位小伙伴,不要订阅该文所属专栏。 作者:不渴望力量的哈士奇(哈哥),十余年工作经验, 跨域学习者,从事过全栈研发、产品经理等工作,现任研发部门 CTO 。荣誉:2022年度博客之星Top4、博客专家认证、全栈领域优质创作者、新星计划导师,“星荐官共赢计…...

Apache HTTPD (CVE-2017-15715)换行解析漏洞复现

Apache HTTPD 换行解析漏洞 CVE-2017-15715漏洞简介 组件版本漏洞名称 Apache HTTPD 换行解析漏洞(CVE-2017-15715) 漏洞描述 ​ Apache HTTPD是一款HTTP服务器,它可以通过mod_php来运行PHP网页。其2.4.0~2.4.29版本中存在一个解析漏洞&…...

Spring Boot集成JasperReport生成文档

由于工作需要,要实现后端根据模板动态填充数据生成PDF文档,通过技术选型,使用Ireport5.6来设计模板,结合JasperReports5.6工具库来调用渲染生成PDF文档。 一、使用Ireport designer 5.6设计模板 ireport的使用由于时间关系不便多…...

02-Tomcat打破双亲委派机制

上一篇:01-从JDK源码级别剖析JVM类加载机制 Tomcat 如果使用默认的双亲委派类加载机制行不行? 我们思考一下:Tomcat是个web容器, 那么它要解决什么问题: 一个web容器可能需要部署两个应用程序,不同的应用…...

怎么理解flink的异步检查点机制

背景 flink的checkpoint监控页面那里有两个指标Sync Duration 和Async Duration,一个是开始进行同步checkpoint所需的时间,一个是异步checkpoint过程所需的时间,你是否也有过疑惑,是否只是同步过程中的时间才会阻塞正常的数据处理…...

SpringMVC <url-pattern/>解读

1. < url-pattern/>的值 (1).使用拓展名的方式&#xff0c;语法*.xxx&#xff0c;xxx是自定义的拓展名&#xff0c;常用的方式*.do&#xff0c;*.action,不能使用*.jsp. (2).使用斜杠 "/"当项目中使用了 / &#xff0c;他会替代tomcat中的default。导致所有的…...

Java 语言特性(面试系列2)

一、SQL 基础 1. 复杂查询 &#xff08;1&#xff09;连接查询&#xff08;JOIN&#xff09; 内连接&#xff08;INNER JOIN&#xff09;&#xff1a;返回两表匹配的记录。 SELECT e.name, d.dept_name FROM employees e INNER JOIN departments d ON e.dept_id d.dept_id; 左…...

从WWDC看苹果产品发展的规律

WWDC 是苹果公司一年一度面向全球开发者的盛会&#xff0c;其主题演讲展现了苹果在产品设计、技术路线、用户体验和生态系统构建上的核心理念与演进脉络。我们借助 ChatGPT Deep Research 工具&#xff0c;对过去十年 WWDC 主题演讲内容进行了系统化分析&#xff0c;形成了这份…...

Day131 | 灵神 | 回溯算法 | 子集型 子集

Day131 | 灵神 | 回溯算法 | 子集型 子集 78.子集 78. 子集 - 力扣&#xff08;LeetCode&#xff09; 思路&#xff1a; 笔者写过很多次这道题了&#xff0c;不想写题解了&#xff0c;大家看灵神讲解吧 回溯算法套路①子集型回溯【基础算法精讲 14】_哔哩哔哩_bilibili 完…...

mongodb源码分析session执行handleRequest命令find过程

mongo/transport/service_state_machine.cpp已经分析startSession创建ASIOSession过程&#xff0c;并且验证connection是否超过限制ASIOSession和connection是循环接受客户端命令&#xff0c;把数据流转换成Message&#xff0c;状态转变流程是&#xff1a;State::Created 》 St…...

ssc377d修改flash分区大小

1、flash的分区默认分配16M、 / # df -h Filesystem Size Used Available Use% Mounted on /dev/root 1.9M 1.9M 0 100% / /dev/mtdblock4 3.0M...

屋顶变身“发电站” ,中天合创屋面分布式光伏发电项目顺利并网!

5月28日&#xff0c;中天合创屋面分布式光伏发电项目顺利并网发电&#xff0c;该项目位于内蒙古自治区鄂尔多斯市乌审旗&#xff0c;项目利用中天合创聚乙烯、聚丙烯仓库屋面作为场地建设光伏电站&#xff0c;总装机容量为9.96MWp。 项目投运后&#xff0c;每年可节约标煤3670…...

项目部署到Linux上时遇到的错误(Redis,MySQL,无法正确连接,地址占用问题)

Redis无法正确连接 在运行jar包时出现了这样的错误 查询得知问题核心在于Redis连接失败&#xff0c;具体原因是客户端发送了密码认证请求&#xff0c;但Redis服务器未设置密码 1.为Redis设置密码&#xff08;匹配客户端配置&#xff09; 步骤&#xff1a; 1&#xff09;.修…...

Linux --进程控制

本文从以下五个方面来初步认识进程控制&#xff1a; 目录 进程创建 进程终止 进程等待 进程替换 模拟实现一个微型shell 进程创建 在Linux系统中我们可以在一个进程使用系统调用fork()来创建子进程&#xff0c;创建出来的进程就是子进程&#xff0c;原来的进程为父进程。…...

技术栈RabbitMq的介绍和使用

目录 1. 什么是消息队列&#xff1f;2. 消息队列的优点3. RabbitMQ 消息队列概述4. RabbitMQ 安装5. Exchange 四种类型5.1 direct 精准匹配5.2 fanout 广播5.3 topic 正则匹配 6. RabbitMQ 队列模式6.1 简单队列模式6.2 工作队列模式6.3 发布/订阅模式6.4 路由模式6.5 主题模式…...

JS设计模式(4):观察者模式

JS设计模式(4):观察者模式 一、引入 在开发中&#xff0c;我们经常会遇到这样的场景&#xff1a;一个对象的状态变化需要自动通知其他对象&#xff0c;比如&#xff1a; 电商平台中&#xff0c;商品库存变化时需要通知所有订阅该商品的用户&#xff1b;新闻网站中&#xff0…...