Day09-Linux文件类型及查找文件精讲

2024-02-19 02:20

本文主要是介绍Day09-Linux文件类型及查找文件精讲,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Day09-Linux文件类型及查找文件精讲

  • 1. Linux文件类型
  • 2. wc 查看行数,字符数等
  • 3. find 查找

属性:

人:性别、身高、体重、年龄

文件:大小、用户 组 权限 创建时间

[root@oldboy ~]# stat ab.txtFile: ‘ab.txt’Size: 184             Blocks: 8          IO Block: 4096   regular file
Device: fd00h/64768d    Inode: 33729481    Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Context: unconfined_u:object_r:admin_home_t:s0
Access: 2023-12-15 11:32:37.460161262 +0800
Modify: 2023-12-15 11:32:27.436160735 +0800
Change: 2023-12-15 11:32:27.436160735 +0800

最近访问:2021-05-12 12:13:30 access 访问,浏览,针对内容

最近更改:2021-05-10 10:31:31 modify 最后更改时间,针对内容

最近改动:2021-05-10 10:31:31 change 状态改变,属性改变

查看文件属性:

[root@oldboy ~]# ls -li
总用量 32
33583628 -rw-r--r--. 1 root root 184 512 11:56 oldboy.txt

第1列,索引节点,形态是数字

第2列,首字符代表文件类型
​ 中间9个字符,文件权限
​ . 和selinux(高级安全组件)相关符号

第3列,硬链接数

第4列,用户

第5列,用户组

第6列,文件大小(目录不是)

第7-9列,日期时间

第10列,文件名

1. Linux文件类型

windows文件类型,根据扩展名来的。

.doc word文档

.mp4 .avi 视频

.ppt .md .txt

Linux下面不根据扩展名确定类型,但是依然会有扩展名,为了给人看。一眼看清楚。

系统不识别扩展名,

那么系统怎么确定文件类型呢?

ls -li 第2列,首字符代表文件类型

一切皆文件。

- 普通文件 .doc word文档 .mp4  .avi 视频.ppt .md .txt 
d 目录 directory
l 软链接文件 link
c 字符设备
b 块设备
s socket文件

- 普通文件 显示为白色

d 目录 directory 显示为浅蓝色

l 软链接文件 link 快捷方式

[root@oldboy ~]# ls  -l /bin
lrwxrwxrwx. 1 root root 7 57 09:21 /bin -> usr/bin

Linux下创建快捷方式

[root@oldboy ~]# ln -s /etc/hosts  /tmp/a.hosts
[root@oldboy ~]# cat /tmp/a.hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.0.129  oldboy

c 字符设备

[root@oldboy ~]# ls -l /dev/
total 0
crw-rw----. 1 root video    10, 175 Dec 14 09:23 agpgart
crw-------. 1 root root     10, 235 Dec 14 09:23 autofs
drwxr-xr-x. 2 root root         160 Dec 14 09:23 block
drwxr-xr-x. 2 root root          80 Dec 14 09:23 bsg
crw-------. 1 root root     10, 234 Dec 14 09:23 btrfs-control
lrwxrwxrwx. 1 root root           3 Dec 14 09:23 cdrom -> sr0
drwxr-xr-x. 2 root root          80 Dec 14 09:23 centos
drwxr-xr-x. 2 root root        2780 Dec 14 09:23 char
crw-------. 1 root root      5,   1 Dec 14 09:23 console
lrwxrwxrwx. 1 root root          11 Dec 14 09:23 core -> /proc/kcore
drwxr-xr-x. 6 root root         120 Dec 14 09:23 cpu
crw-------. 1 root root     10,  61 Dec 14 09:23 cpu_dma_latency
crw-------. 1 root root     10,  62 Dec 14 09:23 crash
drwxr-xr-x. 6 root root         120 Dec 14 09:23 disk
brw-rw----. 1 root disk    253,   0 Dec 14 09:23 dm-0
brw-rw----. 1 root disk    253,   1 Dec 14 09:23 dm-1
drwxr-xr-x. 2 root root          80 Dec 14 09:23 dri
crw-rw----. 1 root video    29,   0 Dec 14 09:23 fb0
lrwxrwxrwx. 1 root root          13 Dec 14 09:23 fd -> /proc/self/fd
crw-rw-rw-. 1 root root      1,   7 Dec 14 09:23 full
crw-rw-rw-. 1 root root     10, 229 Dec 14 09:23 fuse
......

b 块设备

[root@oldboy ~]# ls -l /dev/sd*
brw-rw----. 1 root disk 8, 0 510 20:11 /dev/sda
brw-rw----. 1 root disk 8, 1 510 20:11 /dev/sda1
brw-rw----. 1 root disk 8, 2 510 20:11 /dev/sda2

s socket文件,进程通信才会用到

[root@oldboy ~]# find / -type s
/dev/log
/run/vmware/guestServicePipe
/run/abrt/abrt.socket
/run/dbus/system_bus_socket
......[root@oldboy ~]# ls -l /dev/log
srw-rw-rw-. 1 root root 0 510 20:11 /dev/log

查看文件类型:file

[root@oldboy ~]# file /etc/hosts
/etc/hosts: ASCII text
[root@oldboy ~]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=aaf05615b6c91d3cbb076af81aeff531c5d7dfd9, stripped
[root@oldboy ~]# file /var/log/wtmp 
/var/log/wtmp: data

2. wc 查看行数,字符数等

-l 查看行数

-L 查看字符数

实践:

[root@oldboy ~]# wc -l /etc/hosts
5 /etc/hosts[root@oldboy ~]# echo oldboy|wc -L
6

查找命令:

1)which 查看二进制命令所在路径(从PATH环境变量路径里查找)

[root@oldboy ~]# which ls
alias ls='ls --color=auto'/usr/bin/ls
[root@oldboy ~]# which cp
alias cp='cp -i'/usr/bin/cp

特殊注意:

[root@oldboy ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
  • 分隔符为冒号:
  • 路径都是命令。

2)whereis 查看文件及文件的帮助等的路径

-b 查看二进制命令所在路径 which

[root@oldboy ~]# whereis -b ls
ls: /usr/bin/ls
[root@oldboy ~]# whereis ls
ls: /usr/bin/ls /usr/share/man/man1/ls.1.gz

3)locate 查找文件及相关内容(内置数据库,通过updatedb)(不需要了解)

yum install mlocate -y 
locate

3. find 查找

-name 按名字查找

find 路径 选项1 【参数1】 选项2 【参数2】

1)按名字查找:

[root@oldboy ~]# find / -name "hosts"
/etc/hosts
/tmp/hosts
/tmp/etc/hosts
/home/oldboy/hosts
/opt/etc/hosts

按名字模糊查找 *表示所有

[root@oldboy ~]# find / -name "ho*ts"

2)按类型查找

-type

f d l c b s

去哪看? man find 搜 /-type

  -type cFile is of type c:b      block (buffered) specialc      character (unbuffered) speciald      directoryf      regular filel      symbolic link;s      socket

查找目录

[root@oldboy ~]# find /root -type d 
/root
/root/oldboy_dir
/root/oldboy_dir/abc
/root/oldboy_dir/abc/def

查找文件

[root@oldboy ~]# find /root -type f
/root/.bash_logout
/root/.bash_profile

组合查找:find 默认就是取交集(-a)and,并集(-o)or

找女朋友:【高点】 [身材好点] 该有的要有,同时满足:交集
找男朋友:高的,帅的,有钱的
​ 热爱运动,特长多,热爱生活,渴望爱情,追求精神层次,经济基础,
​ 有才华(写诗、乐器),这样的男生,有没有女生喜欢?

例:查文件类型为文件,并且名字为hosts

find / -name "hosts" -a -type f
[root@oldboy ~]# find / -name "hosts" -a -type f
/etc/hosts
/tmp/hosts
/tmp/etc/hosts
/home/oldboy/hosts
/opt/etc/hosts
[root@oldboy ~]# find / -name "hosts" -type f
/etc/hosts
/tmp/hosts
/tmp/etc/hosts
/home/oldboy/hosts

并集:查找名为hosts,或者类型为d

[root@oldboy ~]# find / -name "hosts" -o -type d -name "oldboy"
/etc/hosts
/tmp/hosts
/tmp/etc/hosts
/home/oldboy
/home/oldboy/hosts
/opt/etc/hosts

取反:! 查找名字不是file1

[root@oldboy ~]# mkdir /data -p
[root@oldboy ~]# touch /data/file{1..3}
[root@oldboy ~]# find /data -name "file1"
/data/file1
[root@oldboy ~]# find /data ! -name "file1"
/data
/data/file2
/data/file3

3)按大小查找

-size +1M #大于1M

-size 1M #1M

-size -1M #小于1M

其他单位k G

测试1

[root@oldboy ~]# cd /data
[root@oldboy data]# rz -E
rz waiting to receive.
[root@oldboy data]# ls
file1  file2  file3  老男孩Linux58期开班典礼3_-.pptx
[root@oldboy data]# find ./ -size +10M
./老男孩Linux58期开班典礼3_-.pptx
[root@oldboy data]# 
[root@oldboy data]# find ./ -size -10M
./
./file1
./file2
./file3
[root@oldboy data]# find ./ -size -10k
./
./file1
./file2
./file3
[root@oldboy data]# find ./ -size -10G
./
./file1
./file2
./file3
./老男孩Linux58期开班典礼3_-.pptx
[root@oldboy data]# find ./ -size +10G

4)-mtime 按修改时间查找*********

-atime 按【访问】时间查找

-ctime 按【改变】时间查找

-mtime +7 #7天以前的

-mtime 7 #第7天

-mtime -7 #最近7天

测试:复制即可。模拟每天创建一个文件,连续30天

mkdir -p /data
for n in {01..30};do date -s "2030/05/0$n";touch /data/file$n;done

.和./都表示当前目录

…和…/都表示上级目录

[root@oldboy data]# for n in {01..30};do date -s "2030/05/0$n";touch /data/file$n;done
Wed May  1 00:00:00 CST 2030
Thu May  2 00:00:00 CST 2030
Fri May  3 00:00:00 CST 2030
Sat May  4 00:00:00 CST 2030
Sun May  5 00:00:00 CST 2030
Mon May  6 00:00:00 CST 2030
Tue May  7 00:00:00 CST 2030
Wed May  8 00:00:00 CST 2030
Thu May  9 00:00:00 CST 2030
Fri May 10 00:00:00 CST 2030
Sat May 11 00:00:00 CST 2030
Sun May 12 00:00:00 CST 2030
Mon May 13 00:00:00 CST 2030
Tue May 14 00:00:00 CST 2030
Wed May 15 00:00:00 CST 2030
Thu May 16 00:00:00 CST 2030
Fri May 17 00:00:00 CST 2030
Sat May 18 00:00:00 CST 2030
Sun May 19 00:00:00 CST 2030
Mon May 20 00:00:00 CST 2030
Tue May 21 00:00:00 CST 2030
Wed May 22 00:00:00 CST 2030
Thu May 23 00:00:00 CST 2030
Fri May 24 00:00:00 CST 2030
Sat May 25 00:00:00 CST 2030
Sun May 26 00:00:00 CST 2030
Mon May 27 00:00:00 CST 2030
Tue May 28 00:00:00 CST 2030
Wed May 29 00:00:00 CST 2030
Thu May 30 00:00:00 CST 2030
[root@oldboy data]# ls -l
total 0
-rw-r--r--. 1 root root 0 May  1 00:00 file01
-rw-r--r--. 1 root root 0 May  2 00:00 file02
-rw-r--r--. 1 root root 0 May  3 00:00 file03
-rw-r--r--. 1 root root 0 May  4 00:00 file04
-rw-r--r--. 1 root root 0 May  5 00:00 file05
-rw-r--r--. 1 root root 0 May  6 00:00 file06
-rw-r--r--. 1 root root 0 May  7 00:00 file07
-rw-r--r--. 1 root root 0 May  8 00:00 file08
-rw-r--r--. 1 root root 0 May  9 00:00 file09
-rw-r--r--. 1 root root 0 May 10 00:00 file10
-rw-r--r--. 1 root root 0 May 11 00:00 file11
-rw-r--r--. 1 root root 0 May 12 00:00 file12
-rw-r--r--. 1 root root 0 May 13 00:00 file13
-rw-r--r--. 1 root root 0 May 14 00:00 file14
-rw-r--r--. 1 root root 0 May 15 00:00 file15
-rw-r--r--. 1 root root 0 May 16 00:00 file16
-rw-r--r--. 1 root root 0 May 17 00:00 file17
-rw-r--r--. 1 root root 0 May 18 00:00 file18
-rw-r--r--. 1 root root 0 May 19 00:00 file19
-rw-r--r--. 1 root root 0 May 20 00:00 file20
-rw-r--r--. 1 root root 0 May 21 00:00 file21
-rw-r--r--. 1 root root 0 May 22 00:00 file22
-rw-r--r--. 1 root root 0 May 23 00:00 file23
-rw-r--r--. 1 root root 0 May 24 00:00 file24
-rw-r--r--. 1 root root 0 May 25 00:00 file25
-rw-r--r--. 1 root root 0 May 26 00:00 file26
-rw-r--r--. 1 root root 0 May 27 00:00 file27
-rw-r--r--. 1 root root 0 May 28 00:00 file28
-rw-r--r--. 1 root root 0 May 29 00:00 file29
-rw-r--r--. 1 root root 0 May 30 00:00 file30[root@oldboy data]# find ./ -mtime -7
./
./file24
./file25
./file26
./file27
./file28
./file29
./file30
[root@oldboy data]# find ./ -mtime 7
./file23
[root@oldboy data]# find ./ -mtime +7
./file01
./file02
./file03
./file04
./file05
./file06
./file07
./file08
./file09
./file10
./file11
./file12
./file13
./file14
./file15
./file16
./file17
./file18
./file19
./file20
./file21
./file22
[root@oldboy data]# find ./ -mtime +7|sort -n -t"e" -k2
./file01
./file02
./file03
./file04
./file05
./file06
./file07
./file08
./file09
./file10
./file11
./file12
./file13
./file14
./file15
./file16
./file17
./file18
./file19
./file20
./file21
./file22

不重要的

-perm 按权限查找

[root@oldboy data]# find /data/ -perm 755
/data/

-user 按用户查找

[root@oldboy data]# touch oldboy.txt
[root@oldboy data]# chown oldboy oldboy.txt
[root@oldboy data]# find /data/ -user oldboy
/data/oldboy.txt

要想成功,永远比别人多做一点点,早做一点点,做好一点点。————老男孩

【对找到的东西,进行处理】

方法一:

-exec 执行动作

find /data/ -name "file*" -mtime +7 -exec rm -f {} \;

原理:

rm -f file01
rm -f file02
rm -f file03
......
[root@oldboy data]# find /data/ -name "file*" -mtime +7
/data/file01
/data/file02
/data/file03
/data/file04
/data/file05
/data/file06
/data/file07
/data/file08
/data/file09
/data/file10
/data/file11
/data/file12
/data/file13
/data/file14
/data/file15
/data/file16
/data/file17
/data/file18
/data/file19
/data/file20
/data/file21
/data/file22
[root@oldboy data]# find /data/ -name "file*" -mtime +7|sort -r
/data/file22
/data/file21
/data/file20
/data/file19
/data/file18
/data/file17
/data/file16
/data/file15
/data/file14
/data/file13
/data/file12
/data/file11
/data/file10
/data/file09
/data/file08
/data/file07
/data/file06
/data/file05
/data/file04
/data/file03
/data/file02
/data/file01
[root@oldboy data]# find /data/ -name "file*" -mtime +7 -exec rm -f {} \;
[root@oldboy data]# find /data/ -name "file*" -mtime +7
[root@oldboy data]# find /data/ -name "file*" -mtime 7
/data/file23
[root@oldboy data]# find /data/ -name "file*" -mtime 7 -exec rm -f {} \;
[root@oldboy data]# find /data/ -name "file*" -mtime 7
[root@oldboy data]# find /data/ -name "file*" -mtime -7
/data/file24
/data/file25
/data/file26
/data/file27
/data/file28
/data/file29
/data/file30
[root@oldboy data]# find /data/ -name "file*" -mtime -7 -exec rm -f {} \;
[root@oldboy data]# find /data/ -name "file*" -mtime -7
[root@oldboy data]#

方法二:

命令行:

$(命令)或`命令`,拼路径拼命令

[root@oldboy data]# !for
for n in {01..30};do date -s "2030/05/0$n";touch /data/file$n;done
Wed May  1 00:00:00 CST 2030
Thu May  2 00:00:00 CST 2030
Fri May  3 00:00:00 CST 2030
Sat May  4 00:00:00 CST 2030
Sun May  5 00:00:00 CST 2030
Mon May  6 00:00:00 CST 2030
Tue May  7 00:00:00 CST 2030
Wed May  8 00:00:00 CST 2030
Thu May  9 00:00:00 CST 2030
Fri May 10 00:00:00 CST 2030
Sat May 11 00:00:00 CST 2030
Sun May 12 00:00:00 CST 2030
Mon May 13 00:00:00 CST 2030
Tue May 14 00:00:00 CST 2030
Wed May 15 00:00:00 CST 2030
Thu May 16 00:00:00 CST 2030
Fri May 17 00:00:00 CST 2030
Sat May 18 00:00:00 CST 2030
Sun May 19 00:00:00 CST 2030
Mon May 20 00:00:00 CST 2030
Tue May 21 00:00:00 CST 2030
Wed May 22 00:00:00 CST 2030
Thu May 23 00:00:00 CST 2030
Fri May 24 00:00:00 CST 2030
Sat May 25 00:00:00 CST 2030
Sun May 26 00:00:00 CST 2030
Mon May 27 00:00:00 CST 2030
Tue May 28 00:00:00 CST 2030
Wed May 29 00:00:00 CST 2030
Thu May 30 00:00:00 CST 2030
[root@oldboy data]# ls
file01  file04  file07  file10  file13  file16  file19  file22  file25  file28  oldboy.txt
file02  file05  file08  file11  file14  file17  file20  file23  file26  file29
file03  file06  file09  file12  file15  file18  file21  file24  file27  file30
[root@oldboy data]# rm -f $(find /data/ -name "file*" -type f -mtime +7)
[root@oldboy data]# rm -f `find /data/ -name "file*" -type f -mtime -7`
[root@oldboy data]# ls
file23  oldboy.txt

方法三:xargs

-n 分组

[root@oldboy data]# seq 10 >oldboy.txt
[root@oldboy data]# xargs -n 3 <oldboy.txt
1 2 3
4 5 6
7 8 9
10

-i 可以让后面的{ }接受搜索到的内容

find /data/ -name "file*" -mtime -7|xargs -i rm -f {}find /data/ -name "file*" -mtime +7|xargs rm -f  #简写

原理:

rm -f file01 file02 file03....

效率更高

[root@oldboy data]# find /data/ -name "file*" -mtime -7
/data/file24
/data/file25
/data/file26
/data/file27
/data/file28
/data/file29
/data/file30
[root@oldboy data]# find /data/ -name "file*" -mtime -7|xargs -i rm -f {}
[root@oldboy data]# find /data/ -name "file*" -mtime -7
[root@oldboy data]#
[root@oldboy data]# find /data/ -name "file*" -mtime +7
/data/file01
/data/file02
/data/file03
/data/file04
/data/file05
/data/file06
/data/file07
/data/file08
/data/file09
/data/file10
/data/file11
/data/file12
/data/file13
/data/file14
/data/file15
/data/file16
/data/file17
/data/file18
/data/file19
/data/file20
/data/file21
/data/file22
[root@oldboy data]# find /data/ -name "file*" -mtime +7|xargs rm -f
[root@oldboy data]# find /data/ -name "file*" -mtime +7
[root@oldboy data]#

查找/data大于20K,修改时间为7天以内的文件,复制到/opt

cp 源 目标

cp -t 目标 源

[root@oldboy data]# cp /etc/services .
[root@oldboy data]# ll
total 660
-rw-r--r--. 1 root   root      0 May 23 00:00 file23
-rw-r--r--. 1 oldboy root     21 May 30 00:05 oldboy.txt
-rw-r--r--. 1 root   root 670293 May 30 00:30 services
[root@oldboy data]# find /data/ -size +20k -mtime -7|xargs -i cp {} /opt
[root@oldboy data]# ls /opt/
services[root@oldboy data]# find /data/ -size +20k -mtime -7|xargs cp -t /tmp
[root@oldboy data]# ls /tmp/
services

这篇关于Day09-Linux文件类型及查找文件精讲的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/723220

相关文章

基于Linux的ffmpeg python的关键帧抽取

《基于Linux的ffmpegpython的关键帧抽取》本文主要介绍了基于Linux的ffmpegpython的关键帧抽取,实现以按帧或时间间隔抽取关键帧,文中通过示例代码介绍的非常详细,对大家的学... 目录1.FFmpeg的环境配置1) 创建一个虚拟环境envjavascript2) ffmpeg-py

Linux脚本(shell)的使用方式

《Linux脚本(shell)的使用方式》:本文主要介绍Linux脚本(shell)的使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录概述语法详解数学运算表达式Shell变量变量分类环境变量Shell内部变量自定义变量:定义、赋值自定义变量:引用、修改、删

Linux链表操作方式

《Linux链表操作方式》:本文主要介绍Linux链表操作方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、链表基础概念与内核链表优势二、内核链表结构与宏解析三、内核链表的优点四、用户态链表示例五、双向循环链表在内核中的实现优势六、典型应用场景七、调试技巧与

详解Linux中常见环境变量的特点与设置

《详解Linux中常见环境变量的特点与设置》环境变量是操作系统和用户设置的一些动态键值对,为运行的程序提供配置信息,理解环境变量对于系统管理、软件开发都很重要,下面小编就为大家详细介绍一下吧... 目录前言一、环境变量的概念二、常见的环境变量三、环境变量特点及其相关指令3.1 环境变量的全局性3.2、环境变

Linux系统中的firewall-offline-cmd详解(收藏版)

《Linux系统中的firewall-offline-cmd详解(收藏版)》firewall-offline-cmd是firewalld的一个命令行工具,专门设计用于在没有运行firewalld服务的... 目录主要用途基本语法选项1. 状态管理2. 区域管理3. 服务管理4. 端口管理5. ICMP 阻断

Linux实现线程同步的多种方式汇总

《Linux实现线程同步的多种方式汇总》本文详细介绍了Linux下线程同步的多种方法,包括互斥锁、自旋锁、信号量以及它们的使用示例,通过这些同步机制,可以解决线程安全问题,防止资源竞争导致的错误,示例... 目录什么是线程同步?一、互斥锁(单人洗手间规则)适用场景:特点:二、条件变量(咖啡厅取餐系统)工作流

Linux中修改Apache HTTP Server(httpd)默认端口的完整指南

《Linux中修改ApacheHTTPServer(httpd)默认端口的完整指南》ApacheHTTPServer(简称httpd)是Linux系统中最常用的Web服务器之一,本文将详细介绍如何... 目录一、修改 httpd 默认端口的步骤1. 查找 httpd 配置文件路径2. 编辑配置文件3. 保存

Linux使用scp进行远程目录文件复制的详细步骤和示例

《Linux使用scp进行远程目录文件复制的详细步骤和示例》在Linux系统中,scp(安全复制协议)是一个使用SSH(安全外壳协议)进行文件和目录安全传输的命令,它允许在远程主机之间复制文件和目录,... 目录1. 什么是scp?2. 语法3. 示例示例 1: 复制本地目录到远程主机示例 2: 复制远程主

Linux基础命令@grep、wc、管道符的使用详解

《Linux基础命令@grep、wc、管道符的使用详解》:本文主要介绍Linux基础命令@grep、wc、管道符的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录grep概念语法作用演示一演示二演示三,带选项 -nwc概念语法作用wc,不带选项-c,统计字节数-

Linux CPU飙升排查五步法解读

《LinuxCPU飙升排查五步法解读》:本文主要介绍LinuxCPU飙升排查五步法,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录排查思路-五步法1. top命令定位应用进程pid2.php top-Hp[pid]定位应用进程对应的线程tid3. printf"%