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

Linux shell编程学习笔记59: ps 获取系统进程信息,类似于Windows系统中的tasklist 命令

0 前言

系统进程信息是电脑网络信息安全检查中的一块重要内容,对于使用Linux和基于Linux作为操作系统的电脑来说,可以使用ps命令。

1 ps命令 的功能、格式和选项说明

1.1 ps命令 的功能

Linux 中的ps(意为:process status)命令用于显示当前进程的状态,类似于Windows系统中的tasklist 命令,我们可以查看系统中运行的进程信息,包括进程的ID、父进程ID、CPU和内存占用等信息,并可以根据需求进行进一步的过滤和排序。

我们可以使用命令 ps --help 来查看ps命令的帮助信息。

[purpleendurer @ bash ~ ] ps --helpUsage:ps [options]Try 'ps --help <simple|list|output|threads|misc|all>'or 'ps --help <s|l|o|t|m|a>'for additional help text.For more details see ps(1).
[purpleendurer @ bash ~ ] 

 1.2 ps命令的格式

ps [选项]   

1.3 ps命令的选项

 ps命令的选项非常多。

[purpleendurer @ bash ~ ] ps --help simpleUsage:ps [options]Basic options:-A, -e               all processes-a                   all with tty, except session leadersa                   all with tty, including other users-d                   all except session leaders-N, --deselect       negate selectionr                   only running processesT                   all processes on this terminalx                   processes without controlling ttysFor more details see ps(1).

 

[purpleendurer @ bash ~ ] ps --help listUsage:ps [options]Selection by list:-C <command>         command name-G, --Group <GID>    real group id or name-g, --group <group>  session or effective group name-p, p, --pid <PID>   process id--ppid <PID>  parent process id-q, q, --quick-pid <PID>process id (quick mode)-s, --sid <session>  session id-t, t, --tty <tty>   terminal-u, U, --user <UID>  effective user id or name-U, --User <UID>     real user id or nameThe selection options take as their argument either:a comma-separated list e.g. '-u root,nobody' ora blank-separated list e.g. '-p 123 4567'For more details see ps(1).
[purpleendurer @ bash ~ ] 

[purpleendurer @ bash ~ ] ps --help outputUsage:ps [options]Output formats:-F                   extra full-f                   full-format, including command linesf, --forest         ascii art process tree-H                   show process hierarchy-j                   jobs formatj                   BSD job control format-l                   long formatl                   BSD long format-M, Z                add security data (for SELinux)-O <format>          preloaded with default columnsO <format>          as -O, with BSD personality-o, o, --format <format>user-defined formats                   signal formatu                   user-oriented formatv                   virtual memory formatX                   register format-y                   do not show flags, show rss vs. addr (used with -l)--context        display security context (for SELinux)--headers        repeat header lines, one per page--no-headers     do not print header at all--cols, --columns, --width <num>set screen width--rows, --lines <num>set screen heightFor more details see ps(1).
[purpleendurer @ bash ~ ] 

[purpleendurer @ bash ~ ] ps --help threadsUsage:ps [options]Show threads:H                   as if they were processes-L                   possibly with LWP and NLWP columns-m, m                after processes-T                   possibly with SPID columnFor more details see ps(1).
[purpleendurer @ bash ~ ] 

[purpleendurer @ bash ~ ] ps --help miscUsage:ps [options]Miscellaneous options:-c                   show scheduling class with -l optionc                   show true command namee                   show the environment after commandk,    --sort        specify sort order as: [+|-]key[,[+|-]key[,...]]L                   show format specifiersn                   display numeric uid and wchanS,    --cumulative  include some dead child process data-y                   do not show flags, show rss (only with -l)-V, V, --version     display version information and exit-w, w                unlimited output width--help <simple|list|output|threads|misc|all>display help and exitFor more details see ps(1).
[purpleendurer @ bash ~ ] 

[purpleendurer @ bash ~ ] ps --help allUsage:ps [options]Basic options:-A, -e               all processes-a                   all with tty, except session leadersa                   all with tty, including other users-d                   all except session leaders-N, --deselect       negate selectionr                   only running processesT                   all processes on this terminalx                   processes without controlling ttysSelection by list:-C <command>         command name-G, --Group <GID>    real group id or name-g, --group <group>  session or effective group name-p, p, --pid <PID>   process id--ppid <PID>  parent process id-q, q, --quick-pid <PID>process id (quick mode)-s, --sid <session>  session id-t, t, --tty <tty>   terminal-u, U, --user <UID>  effective user id or name-U, --User <UID>     real user id or nameThe selection options take as their argument either:a comma-separated list e.g. '-u root,nobody' ora blank-separated list e.g. '-p 123 4567'Output formats:-F                   extra full-f                   full-format, including command linesf, --forest         ascii art process tree-H                   show process hierarchy-j                   jobs formatj                   BSD job control format-l                   long formatl                   BSD long format-M, Z                add security data (for SELinux)-O <format>          preloaded with default columnsO <format>          as -O, with BSD personality-o, o, --format <format>user-defined formats                   signal formatu                   user-oriented formatv                   virtual memory formatX                   register format-y                   do not show flags, show rss vs. addr (used with -l)--context        display security context (for SELinux)--headers        repeat header lines, one per page--no-headers     do not print header at all--cols, --columns, --width <num>set screen width--rows, --lines <num>set screen heightShow threads:H                   as if they were processes-L                   possibly with LWP and NLWP columns-m, m                after processes-T                   possibly with SPID columnMiscellaneous options:-c                   show scheduling class with -l optionc                   show true command namee                   show the environment after commandk,    --sort        specify sort order as: [+|-]key[,[+|-]key[,...]]L                   show format specifiersn                   display numeric uid and wchanS,    --cumulative  include some dead child process data-y                   do not show flags, show rss (only with -l)-V, V, --version     display version information and exit-w, w                unlimited output width--help <simple|list|output|threads|misc|all>display help and exitFor more details see ps(1).
[purpleendurer @ bash ~ ] 

[purpleendurer @ bash ~ ] ps --help aUsage:ps [options]Basic options:-A, -e               all processes-a                   all with tty, except session leadersa                   all with tty, including other users-d                   all except session leaders-N, --deselect       negate selectionr                   only running processesT                   all processes on this terminalx                   processes without controlling ttysSelection by list:-C <command>         command name-G, --Group <GID>    real group id or name-g, --group <group>  session or effective group name-p, p, --pid <PID>   process id--ppid <PID>  parent process id-q, q, --quick-pid <PID>process id (quick mode)-s, --sid <session>  session id-t, t, --tty <tty>   terminal-u, U, --user <UID>  effective user id or name-U, --User <UID>     real user id or nameThe selection options take as their argument either:a comma-separated list e.g. '-u root,nobody' ora blank-separated list e.g. '-p 123 4567'Output formats:-F                   extra full-f                   full-format, including command linesf, --forest         ascii art process tree-H                   show process hierarchy-j                   jobs formatj                   BSD job control format-l                   long formatl                   BSD long format-M, Z                add security data (for SELinux)-O <format>          preloaded with default columnsO <format>          as -O, with BSD personality-o, o, --format <format>user-defined formats                   signal formatu                   user-oriented formatv                   virtual memory formatX                   register format-y                   do not show flags, show rss vs. addr (used with -l)--context        display security context (for SELinux)--headers        repeat header lines, one per page--no-headers     do not print header at all--cols, --columns, --width <num>set screen width--rows, --lines <num>set screen heightShow threads:H                   as if they were processes-L                   possibly with LWP and NLWP columns-m, m                after processes-T                   possibly with SPID columnMiscellaneous options:-c                   show scheduling class with -l optionc                   show true command namee                   show the environment after commandk,    --sort        specify sort order as: [+|-]key[,[+|-]key[,...]]L                   show format specifiersn                   display numeric uid and wchanS,    --cumulative  include some dead child process data-y                   do not show flags, show rss (only with -l)-V, V, --version     display version information and exit-w, w                unlimited output width--help <simple|list|output|threads|misc|all>display help and exitFor more details see ps(1).
[purpleendurer @ bash ~ ] 

ps命令的选项分为基本选项、列表选项、输出格式选项、显示线程选项和杂项五类,如下:

基本选项功能
-A显示所有的进程,包括前台的、后台的、其他用户的进程,跟-e的效果相同
-a

显示所有终端下除了session leaders外的所有进程(ssh登录的shell是一种session leader)

a显示所有终端主机下存在的进程,包括session leaders进程
-d显示除了session leaders外的进程
-e显示所有的进程,包括前台的、后台的、其他用户的进程,跟-A的效果相同

-N

--deselect

否定选择
r仅显示终端主机正在执行中的程序
T显示当前终端主机下的所有程序
-x显示所有程序,不以终端机来区分。通常与 a 这个参数一起使用,可列出较完整信息
列表选项功能
-C <command>显示命令名

-G

--Group <GID>

显示真实的组 ID 或名称

-g

--group <group>

显示会话或有效组名称

 -p

p

--pid <PID>   

显示进程ID
--ppid <PID>  显示父进程ID

-q

q

--quick-pid <PID>

显示进程 id (快速模式)

-s

--sid <session>

显示会话ID

-t

t

--tty <tty>

显示终端

-u [<UID>]

u <UID>

--user <UID>

显示指定UID的有效用户的进程状态,未指定UID则显示当前用户的进程状态

-U <UID>  

--User <UID>  

显示指定UID的真实用户的进程状态
输出格式选项功能
     --context显示安全上下文(用于 SELinux)

--cols <num>

--columns <num>

设置屏幕宽度
-F
-f把进程的所有信息都显示出来,包括命令行

f

--forest

用ASCII字符显示树状结构
--format <format>用户定义的格式
 -H显示进程层次结构
--headers重复标题行,每页一行
 -j作业格式
jBSD 作业控制格式
-l较长、较详细的格式
lBSD的长格式
 --lines <num>设置屏幕高度
 -M添加安全数据(适用于 SELinux)
--no-headers不打印标题
 -O <format> 预加载默认列
O <format>与-O相似,但是具有BSD

-o <format>

o <format>                 

与--format 相同,用户定义的格式
--rows <num>设置屏幕高度
  s信号格式
  u面向用户的格式
  v虚拟内存格式
--width <num>设置屏幕宽度
  X寄存器格式
 -y不显示标志,显示 RSS 与 ADDR(与 -l 一起使用)
显示线程选项功能
  H             就好像它们是过程一样
-L可能带有 LWP 和 NLWP 列

-m

m

处理后
-T可能与 SPID 列
杂项功能
-c显示调度类(与-l 选项使用)
--cumulative 包括一些死亡子进程数据
c显示真命令名
e命令后显示环境
--help <simple|list|output|threads|misc|all>
                     
显示帮助和退出
k将排序顺序指定为: [ + |-] key [ ,[ + |-] key [ ,... ]]
L显示格式说明符
n显示数字 uid 和 wchan
S 包括一些死亡子进程数据,与 --cumulative 相同
--sort将排序顺序指定为: [ + |-] key [ ,[ + |-] key [ ,... ]]
-y不显示标志,显示 rss (只与-l配合使用)

-V

V

--version

显示版本信息并退出

-w

w

无限输出宽度

2.进程的PID、PPID,PGID和SID

在Linux中,每个进程都有多个与之关联的 ID,包括:

2.1 进程 ID (Process ID,PID)

这是标识进程的任意数字。每个进程都有一个唯一的 ID,但在进程退出并且父进程检索到退出状态后,该进程 ID 将被释放以供新进程重用。

2.2 父进程 ID (Parent Process ID ,PPID)

这只是启动相关进程的进程的 PID。如果父进程在子进程之前退出,则子进程的 PPID 将更改为另一个进程(通常为 PID 1)。

2.3 进程组 ID (Process Group ID,PGID)

进程组领导者的 PID。如果 PID == PGID,则此进程是进程组的领导者。

2.4 会话 ID (Session ID,SID)

这只是会话领导者的 PID。如果 PID == SID,则此进程是会话领导者。

会话和进程组只是将许多相关进程视为一个单元的方法。进程组的所有成员始终属于同一会话,但一个进程可能具有多个进程组。

通常,一个 shell 就是一个会话领导者,该 shell 执行的每个命令进程都将是一个进程组。这是为了在shell退出时很容易杀死shell的子进程。

3 Linux进程的状态

linux中进程有以下几种状态:

  1. R——Runnable(运行):正在运行或在运行队列中等待。只有在该状态的进程才可能在CPU上运行。而同一时刻可能有多个进程处于可执行状态,这些进程的task_struct结构(进程控制块)被放入对应CPU的可执行队列中(一个进程最多只能出现在一个CPU的可执行队列中)。进程调度器的任务就是从各个CPU的可执行队列中分别选择一个进程在该CPU上运行。
  2. S——sleeping(中断):休眠中,受阻,在等待某个条件的形成或接收到信号。处于这个状态的进程因为等待某某事件的发生(比如等待socket连接、等待信号量),而被挂起。这些进程的task_struct结构被放入对应事件的等待队列中。当这些事件发生时(由外部中断触发、或由其他进程触发),对应的等待队列中的一个或多个进程将被唤醒。
  3. D——uninterruptible sleep(不可中断):收到信号不唤醒和不可运行,进程必须等待直到有中断发生。与TASK_INTERRUPTIBLE状态类似,进程处于睡眠状态,但是此刻进程是不可中断的。不可中断,指的并不是CPU不响应外部硬件的中断,而是指进程不响应异步信号。绝大多数情况下,进程处在睡眠状态时,总是应该能够响应异步信号的。
  4. Z——zombie(僵死):进程已终止,但进程描述还在,直到父进程调用wait4()系统调用后释放。这个退出过程中,进程占有的所有资源将被回收,除了task_struct结构(以及少数资源)以外。于是进程就只剩下task_struct这么个空壳,故称为僵尸。之所以保留task_struct,是因为task_struct里面保存了进程的退出码、以及一些统计信息。而其父进程很可能会关心这些信息。比如在shell中,$?变量就保存了最后一个退出的前台进程的退出码,而这个退出码往往被作为if语句的判断条件。
  5. T——traced or stoppd(停止):进程收到SiGSTOP,SIGSTP,SIGTOU信号后停止运行。对于进程本身来说,TASK_STOPPED和TASK_TRACED状态很类似,都是表示进程暂停下来。
    而TASK_TRACED状态相当于在TASK_STOPPED之上多了一层保护,处于TASK_TRACED状态的进程不能响应SIGCONT信号而被唤醒。只能等到调试进程通过ptrace系统调用执行PTRACE_CONT、PTRACE_DETACH等操作(通过ptrace系统调用的参数指定操作),或调试进程退出,被调试的进程才能恢复TASK_RUNNING状态。
  6. W: 进入内存交换(从内核2.6开始无效)
  7. X——TASK_DEAD – EXIT_DEAD(死亡的任务-退出死亡):退出状态,进程即将被销毁。进程将被置于EXIT_DEAD退出状态,这意味着接下来的代码立即就会将该进程彻底释放。所以EXIT_DEAD状态是非常短暂的,几乎不可能通过ps命令捕捉到。
  8. <:   高优先级
  9. N:  低优先级
  10. L:  有些页被锁进内存
  11. s:   包含子进程
  12. \+: 位于后台的进程组
  13. l   : 多线程,克隆线程

4 ps 命令实例

4.1  ps -A

[purpleendurer @ bash ~] ps -APID TTY          TIME CMD1 pts/0    00:00:00 zsh47 pts/1    00:00:00 zsh72 pts/2    00:00:00 zsh100 pts/1    00:00:00 bash115 pts/3    00:00:00 zsh142 pts/4    00:00:00 zsh169 pts/5    00:00:00 zsh194 pts/6    00:00:00 zsh222 pts/6    00:00:00 bash237 pts/6    00:00:00 ps
[purpleendurer @ bash ~] 

命令列出了10条进程信息 

包括4列内容,其中:

  1. PID:进程ID
  2. TTY:与进程关联的终端,涵盖pts/0~pts/6。如果是?,就是与终端无关的进程,即后台服务,意味着它不依赖于终端。
  3. TIME:进程从触发开始所运行的时间
  4. CMD:启动进程的命令

4.2 ps -a

[purpleendurer @ bash ~] ps -aPID TTY          TIME CMD100 pts/1    00:00:00 bash222 pts/6    00:00:00 bash238 pts/6    00:00:00 ps
[purpleendurer @ bash ~] 

与2.1相比,命令列只出了3个进程,TTY分别为pts/1、pts/6。

4.3 ps a

[purpleendurer @ bash ~] ps aPID TTY      STAT   TIME COMMAND1 pts/0    Ss+    0:00 /bin/zsh47 pts/1    Ss     0:00 /bin/zsh72 pts/2    Ss+    0:00 /bin/zsh100 pts/1    S+     0:00 bash115 pts/3    Ss+    0:00 /bin/zsh142 pts/4    Ss+    0:00 /bin/zsh169 pts/5    Ss+    0:00 /bin/zsh194 pts/6    Ss     0:00 /bin/zsh222 pts/6    S      0:00 bash239 pts/6    R+     0:00 ps a
[purpleendurer @ bash ~] 

命令列出了10个进程 ,数量与 2.1相同,比2.2 不仅多了7个进程信息,包括了TTY值为pts/0、pts/2、pts/3、pts/4和pts/5的进程信息,而且在信息项数量上,也多了1列,即:

STAT(即:状态)。

4.4 ps -d

[purpleendurer @ bash ~ ]ps -dPID TTY          TIME CMD102 pts/1    00:00:00 bash115 pts/1    00:00:00 ps
[purpleendurer @ bash ~ ]ps -aPID TTY          TIME CMD102 pts/1    00:00:00 bash116 pts/1    00:00:00 ps
[purpleendurer @ bash ~ ]

 

从命令返回信息来看,-d 和 -a选项还是有一些差别的。

4.5 ps -f

[purpleendurer @ bash ~ ]ps -f
UID          PID    PPID  C STIME TTY          TIME CMD
csdn          47       0  0 23:24 pts/1    00:00:00 /bin/zsh
csdn         106      47  0 23:24 pts/1    00:00:00 bash
csdn         120     106  0 23:24 pts/1    00:00:00 ps -f
[purpleendurer @ bash ~ ]

返回的信息中有8列,其中多出的3列是:

  1. PPID  :父进程ID
  2. C        : CPU?
  3. STIME:进程触发的时间

 通过对比PID和PPID,我们可以看出进程之间的父子衍生关系。

2.5 ps -F

[purpleendurer @ bash ~ ]ps -F
UID          PID    PPID  C    SZ   RSS PSR STIME TTY          TIME CMD
csdn          47       0  0 10039  5044   0 23:24 pts/1    00:00:00 /bin/zsh
csdn         106      47  0  3781  3488   0 23:24 pts/1    00:00:00 bash
csdn         119     106  0 13763  3808   0 23:24 pts/1    00:00:00 ps -F

返回信息包括11列,比 2.4 多了3列:

  1. SZ  :进程核心映像的页面大小
  2. RSS:驻留空间的大小。显示当前常驻内存的程序的K字节数。
  3. PSR:绑定内核线程的处理器(如果有)的逻辑处理器号

4.6 ps -aux

[purpleendurer @ bash ~ ]ps -aux
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
csdn           1  0.0  0.1  40356  5140 pts/0    Ss+  00:02   0:00 /bin/zsh
csdn          46  0.0  0.1  40156  4956 pts/1    Ss+  00:02   0:00 /bin/zsh
csdn          70  0.0  0.1  40156  5024 pts/2    Ss+  00:02   0:00 /bin/zsh
csdn          98  0.0  0.1  40156  4888 pts/3    Ss+  00:13   0:00 /bin/zsh
csdn         123  0.0  0.1  40156  5016 pts/4    Ss+  00:13   0:00 /bin/zsh
csdn         152  0.0  0.1  40156  5044 pts/5    Ss   00:24   0:00 /bin/zsh
csdn         177  0.0  0.1  40156  4944 pts/6    Ss+  00:24   0:00 /bin/zsh
csdn         205  0.0  0.0  15124  3404 pts/5    S    00:24   0:00 bash
csdn         219  0.0  0.1  55052  3912 pts/5    R+   00:26   0:00 ps -aux
[purpleendurer @ bash ~ ]

 

 返回的信息共有11列,其中:
 

  1. %CPU :      进程的cpu占用率
  2. %MEM:       进程使用内存的百分比
  3. VSZ     :       进程使用的虚拟内存大小,以K为单位

4.7 ps -ef

[purpleendurer @ bash ~ ]ps -ef
UID          PID    PPID  C STIME TTY          TIME CMD
csdn           1       0  0 00:02 pts/0    00:00:00 /bin/zsh
csdn          46       0  0 00:02 pts/1    00:00:00 /bin/zsh
csdn          70       0  0 00:02 pts/2    00:00:00 /bin/zsh
csdn          98       0  0 00:13 pts/3    00:00:00 /bin/zsh
csdn         123       0  0 00:13 pts/4    00:00:00 /bin/zsh
csdn         152       0  0 00:24 pts/5    00:00:00 /bin/zsh
csdn         177       0  0 00:24 pts/6    00:00:00 /bin/zsh
csdn         205     152  0 00:24 pts/5    00:00:00 bash
csdn         218     205  0 00:24 pts/5    00:00:00 ps -ef
[purpleendurer @ bash ~ ]

相关文章:

Linux shell编程学习笔记59: ps 获取系统进程信息,类似于Windows系统中的tasklist 命令

0 前言 系统进程信息是电脑网络信息安全检查中的一块重要内容&#xff0c;对于使用Linux和基于Linux作为操作系统的电脑来说&#xff0c;可以使用ps命令。 1 ps命令 的功能、格式和选项说明 1.1 ps命令 的功能 Linux 中的ps&#xff08;意为&#xff1a;process status&…...

在Android中使用ProgressBar显示进度

在Android中使用ProgressBar显示进度 大家好&#xff0c;我是免费搭建查券返利机器人省钱赚佣金就用微赚淘客系统3.0的小编&#xff0c;也是冬天不穿秋裤&#xff0c;天冷也要风度的程序猿&#xff01;今天我们将探讨如何在Android应用中使用ProgressBar来显示进度。ProgressB…...

Java基础面试题(简单版):

1.java的8个基本数据类型? 整型: byte(占用1个字节) short(占用2个字节) int(占用4个字节) long(占用8个字节) 浮点型: float(占用4个字节)、double(占用8个字节) 字符型: char 布尔型: boolean 2.ArrayList和LinkedList的区别? 可以说ArrayList和LinkedList除了是同属于集合…...

​Chrome插件:Postman Interceptor 调试的终极利器

今天给大家介绍一款非常实用的工具——Postman Interceptor。 这个工具可以捕捉任何网站的请求&#xff0c;并将其发送到Postman客户端。 对于经常和API打交道的程序员来说&#xff0c;Postman Interceptor真的是神器级别的存在。 下面就让我详细说说这个插件怎么用&#xf…...

SpringBoot学习04-[定制SpringMVC]

定制SpringMVC 定制SpringMvc的自动配置定制springmvc-configurePathMatch配置定制SpringMVC-拦截器Interceptor定制SpringMVC-CORS配置全局cors配置针对某个方法加跨域解决 WebMvcConfigurer原理定制SpringMVC-JSONJSON开发jackson的使用定制化json序列化和反序列化 JSON国际化…...

QT拖放事件之六:自定义MIME类型的存储及读取demo

1、MIME类型描述 MIME (Multipurpose Internet Mail Extensions) 是描述消息内容类型的标准,用来表示文档、文件或字节流的性质和格式。 MIME 消息能包含文本、图像、音频、视频以及其他应用程序专用的数据。 浏览器通常使用 MIME 类型(而不是文件扩展名)来确定如何处理URL…...

架构师必知的绝活-JVM调优

前言 为什么要学JVM&#xff1f; 首先&#xff1a;面试需要 了解JVM能帮助回答面试中的复杂问题。面试中涉及到的JVM相关问题层出不穷&#xff0c;难道每次面试都靠背几百上千条面试八股&#xff1f; 其次&#xff1a;基础知识决定上层建筑 自己写的代码都不知道是怎么回事&a…...

小米平板6系列对比

小米平板6系列目前有4款&#xff0c;分别为6、6 Pro、6 Max、6S Pro。具体对比如下表所示。 小米平板型号66 Pro6 Max6S Pro实物图发布时间2023年4月21日2023年4月21日2023年8月14日2024年2月22 日屏幕大小11英寸11英寸14英寸12.4英寸分辨率2.8K2.8K2.8K3K刷新率144Hz144Hz120…...

用 Rust 实现一个替代 WebSocket 的协议

很久之前我就对websocket颇有微词&#xff0c;它的确满足了很多情境下的需求&#xff0c;但是仍然有不少问题。对我来说&#xff0c;最大的一个问题是websocket的数据是明文传输的&#xff0c;这使得websocket的数据很容易遭到劫持和攻击。同时&#xff0c;WebSocket继承自HTTP…...

【docker】2. 编排容器技术发展史(了解)

该篇文章介绍的主要是编排以及容器技术的发展史(了解即可)&#xff0c;如果想单纯学习docker命令操作可直接略过&#xff01;&#xff01;&#xff01; 容器技术发展史 Jail 时代 容器不是一个新概念或者新技术&#xff0c;很早就有了&#xff0c;只是近几年遇到了云计算&am…...

吉利银河L6(官方小订送的3M) 对比 威固vk70+ks15

吉利送的号称价值2000的3M效果 撕膜重贴 威固vk70ks15 之后的效果 // 忘记测反射的热量了 可以验证金属膜是反射热而不是吸热 金属膜 手机GPS还能用吗 亲测 能用 太阳能总阻隔率 3M貌似20%出头 威固前档55% 侧后挡高一点不超过60% 夏天真实太阳发热能量 即阻隔率55%到60% …...

three.js实现雪花场景效果

点击获取雪花图片素材 提取码:lywa // 雪花效果 import * as THREE from "three" export function getsnowEffect(th) {console.log(th, th) // this 场景var that th// 创建一个BufferGeometry对象&#xff0c;用于存储顶点数据 const geometry new THREE.Buffe…...

鸿蒙 HarmonyOS NEXT星河版APP应用开发-阶段一

一、鸿蒙开发环境搭建 DevEco Studio安装 下载 访问官网&#xff1a;https://developer.huawei.com/consumer/cn/deveco-studio/选择操作系统版本后并注册登录华为账号既可下载安装包 安装 建议&#xff1a;软件和依赖安装目录不要使用中文字符软件安装包下载完成后&#xff0…...

Elasticsearch优化索引映射和设置

在Elasticsearch的世界中&#xff0c;优化索引的映射&#xff08;mapping&#xff09;和设置&#xff08;settings&#xff09;对于提高搜索性能、存储效率和系统稳定性至关重要。本文将带您深入了解如何针对Elasticsearch的索引进行优化&#xff0c;帮助您构建更高效、更可靠的…...

boss直聘招聘数据可视化分析

boss直聘招聘数据可视化分析 一、数据预处理二、数据可视化三、完整代码一、数据预处理 在 上一篇博客中,笔者已经详细介绍了使用selenium爬取南昌市web前端工程师的招聘岗位数据,数据格式如下: 这里主要对薪水列进行处理,为方便处理,将日薪和周薪的数据删除,将带有13薪…...

小程序人脸分析

公司的业务需求是用户在使用某个功能前&#xff0c;必须使用人脸识别&#xff0c;确保当前使用人是用户本人&#xff0c;防止某些功能乱用。后端用的是腾讯的人脸识别方案&#xff0c;这里只是前端的识别代码&#xff0c;保证人脸剧中&#xff0c;大小合适&#xff0c;有一个人…...

UML建模笔记

5个视图 设计。类&#xff0c;接口&#xff0c;对象如何协作。实现。组件&#xff0c;运行程序&#xff0c;文档关系。用例。用户功能期望。进程。并发与同步相关进程&#xff0c;线程。部署。部署到计算机。 建模目的 和客户共创追踪需求变更协同开发进度控制持续迭代测试生…...

初见SpringCloud ing

Consul 服务注册与发现 服务注册与发现 服务注册&#xff1a;微服务在启动时&#xff0c;会将自己的信息&#xff08;如 IP 地址、端口、服务名称等&#xff09;注册到 Consul。 服务发现&#xff1a;其他微服务可以通过 Consul 查询到已注册的服务&#xff0c;并通过这些信息…...

Python | Leetcode Python题解之第198题打家劫舍

题目&#xff1a; 题解&#xff1a; class Solution:def rob(self, nums: List[int]) -> int:if not nums:return 0size len(nums)if size 1:return nums[0]first, second nums[0], max(nums[0], nums[1])for i in range(2, size):first, second second, max(first nu…...

什么是中断?---STM32篇

目录 一&#xff0c;中断的概念 二&#xff0c;中断的意义 三&#xff0c;中断的优先级 四&#xff0c;中断的嵌套 如果一个高优先级的中断发生&#xff0c;它会立即打断当前正在处理的中断&#xff08;如果其优先级较低&#xff09;&#xff0c;并首先处理这个高优…...

观成科技:隐蔽隧道工具Ligolo-ng加密流量分析

1.工具介绍 Ligolo-ng是一款由go编写的高效隧道工具&#xff0c;该工具基于TUN接口实现其功能&#xff0c;利用反向TCP/TLS连接建立一条隐蔽的通信信道&#xff0c;支持使用Let’s Encrypt自动生成证书。Ligolo-ng的通信隐蔽性体现在其支持多种连接方式&#xff0c;适应复杂网…...

【WiFi帧结构】

文章目录 帧结构MAC头部管理帧 帧结构 Wi-Fi的帧分为三部分组成&#xff1a;MAC头部frame bodyFCS&#xff0c;其中MAC是固定格式的&#xff0c;frame body是可变长度。 MAC头部有frame control&#xff0c;duration&#xff0c;address1&#xff0c;address2&#xff0c;addre…...

【RockeMQ】第2节|RocketMQ快速实战以及核⼼概念详解(二)

升级Dledger高可用集群 一、主从架构的不足与Dledger的定位 主从架构缺陷 数据备份依赖Slave节点&#xff0c;但无自动故障转移能力&#xff0c;Master宕机后需人工切换&#xff0c;期间消息可能无法读取。Slave仅存储数据&#xff0c;无法主动升级为Master响应请求&#xff…...

USB Over IP专用硬件的5个特点

USB over IP技术通过将USB协议数据封装在标准TCP/IP网络数据包中&#xff0c;从根本上改变了USB连接。这允许客户端通过局域网或广域网远程访问和控制物理连接到服务器的USB设备&#xff08;如专用硬件设备&#xff09;&#xff0c;从而消除了直接物理连接的需要。USB over IP的…...

代码随想录刷题day30

1、零钱兑换II 给你一个整数数组 coins 表示不同面额的硬币&#xff0c;另给一个整数 amount 表示总金额。 请你计算并返回可以凑成总金额的硬币组合数。如果任何硬币组合都无法凑出总金额&#xff0c;返回 0 。 假设每一种面额的硬币有无限个。 题目数据保证结果符合 32 位带…...

[ACTF2020 新生赛]Include 1(php://filter伪协议)

题目 做法 启动靶机&#xff0c;点进去 点进去 查看URL&#xff0c;有 ?fileflag.php说明存在文件包含&#xff0c;原理是php://filter 协议 当它与包含函数结合时&#xff0c;php://filter流会被当作php文件执行。 用php://filter加编码&#xff0c;能让PHP把文件内容…...

Axure 下拉框联动

实现选省、选完省之后选对应省份下的市区...

数据结构第5章:树和二叉树完全指南(自整理详细图文笔记)

名人说&#xff1a;莫道桑榆晚&#xff0c;为霞尚满天。——刘禹锡&#xff08;刘梦得&#xff0c;诗豪&#xff09; 原创笔记&#xff1a;Code_流苏(CSDN)&#xff08;一个喜欢古诗词和编程的Coder&#x1f60a;&#xff09; 上一篇&#xff1a;《数据结构第4章 数组和广义表》…...

React核心概念:State是什么?如何用useState管理组件自己的数据?

系列回顾&#xff1a; 在上一篇《React入门第一步》中&#xff0c;我们已经成功创建并运行了第一个React项目。我们学会了用Vite初始化项目&#xff0c;并修改了App.jsx组件&#xff0c;让页面显示出我们想要的文字。但是&#xff0c;那个页面是“死”的&#xff0c;它只是静态…...

大模型——基于Docker+DeepSeek+Dify :搭建企业级本地私有化知识库超详细教程

基于Docker+DeepSeek+Dify :搭建企业级本地私有化知识库超详细教程 下载安装Docker Docker官网:https://www.docker.com/ 自定义Docker安装路径 Docker默认安装在C盘,大小大概2.9G,做这行最忌讳的就是安装软件全装C盘,所以我调整了下安装路径。 新建安装目录:E:\MyS…...