- ps:用于查看系统中的进程状态
ps +参数
-a 显示所有进程
-u 用户以及其他详细信息
-x显示没用控制中端的进程
5种常见的进程状态:R运行,S中断,D不可中断,Z僵死,T停止
[root@localhost test]# ps -u
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 11889 0.2 1.3 249560 25292 tty1 Ss+ 10:18 0:44 /usr/bin/Xorg
root 13844 0.0 0.1 116924 3616 pts/0 Ss 10:27 0:02 /bin/bash
root 72700 0.0 0.1 209924 3232 pts/0 S 13:29 0:00 su - liumaojin
root 73818 0.0 0.1 209924 3620 pts/0 S 13:35 0:00 su - root
root 73823 0.0 0.1 116696 3424 pts/0 S 13:35 0:00 -bash
root 75974 0.0 0.1 209924 3192 pts/0 S 14:08 0:00 su liumaojing
root 76962 0.0 0.1 209924 3624 pts/0 S 14:32 0:00 su root
root 76967 0.0 0.1 116924 3580 pts/0 S 14:32 0:00 bash
root 77093 0.0 0.1 209920 3192 pts/0 S 14:33 0:00 su liumaojing
root 81208 0.0 0.1 209920 3624 pts/0 S 15:33 0:00 su root
root 81212 0.1 0.1 116804 3456 pts/0 S 15:33 0:00 bash
root 81298 0.0 0.0 139492 1648 pts/0 R+ 15:35 0:00 ps -u
- top:用于动态地监视进程活动与系统负载信息等,相当于看作Windows下的任务管理器
top
top - 10:19:59 up 5:26, 2 users, load average: 0.23, 0.14, 0.08
Tasks: 504 total, 3 running, 501 sleeping, 0 stopped, 0 zombie
%Cpu(s): 8.9 us, 2.1 sy, 0.0 ni, 89.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 1868660 total, 97900 free, 741768 used, 1028992 buff/cache
KiB Swap: 2097148 total, 2096988 free, 160 used. 846492 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
11889 root 20 0 249560 25292 9716 S 7.0 1.4 0:45.74 Xorg
13840 root 20 0 569308 23720 15028 S 2.6 1.3 0:44.25 gnome-term+
12475 root 20 0 1471528 123476 41808 S 1.7 6.6 2:13.88 gnome-shell
81569 root 20 0 146412 2416 1428 R 1.0 0.1 0:00.15 top
735 root 20 0 0 0 0 R 0.3 0.0 0:52.01 xfsaild/dm+
1064 root 20 0 317740 6500 4980 S 0.3 0.3 1:00.13 vmtoolsd
12417 root 20 0 37232 2156 1400 S 0.3 0.1 0:09.83 dbus-daemon
12422 root 20 0 129684 3396 2764 S 0.3 0.2 0:01.12 at-spi2-re+
12521 root 20 0 571796 10676 5148 S 0.3 0.6 0:09.17 caribou
12548 root 20 0 334428 6064 4576 S 0.3 0.3 0:03.07 goa-identi+
1 root 20 0 192256 7512 2636 S 0.0 0.4 0:35.87 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.03 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:27.90 ksoftirqd/0
7 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/0
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/1
- free:用于显示当前系统内存的使用情况。
[root@localhost test]# free -h
total used free shared buff/cache available
Mem: 1.8G 720M 98M 10M 1.0G 830M
Swap: 2.0G 160K 2.0G
- stat:用于查看文件的具体存储时间和时间等信息;
[root@localhost test]# stat /test
文件:"/test"
大小:49 块:0 IO 块:4096 目录
设备:fd00h/64768d Inode:36453058 硬链接:2
权限:(1777/drwxrwxrwt) Uid:( 0/ root) Gid:( 0/ root)
环境:unconfined_u:object_r:default_t:s0
最近访问:2018-12-07 10:27:57.602035597 +0800
最近更改:2018-12-05 21:29:58.978328663 +0800
最近改动:2018-12-05 21:29:58.978328663 +0800
创建时间:-
(欢迎补充)