OS第1次实验报告:熟悉使用Linux命令和剖析ps命令

Posted chenyuekai

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OS第1次实验报告:熟悉使用Linux命令和剖析ps命令相关的知识,希望对你有一定的参考价值。

  • 姓名 陈悦凯
  • 学号 201821121011
  • 班级 计算1811

1. 实验环境介绍

给出实验环境:

  • 操作系统:ubuntu-18.04.4-desktop-amd64
  • 平台:虚拟机

2. 常用命令使用

 

 

 

 

 

 

3. 剖析ps命令

EXAMPLES
       To see every process on the system using standard syntax:
          ps -e
          ps -ef
          ps -eF
          ps -ely

       To see every process on the system using BSD syntax:
          ps ax
          ps axu

       To print a process tree:
          ps -ejH
          ps axjf

       To get info about threads:
          ps -eLf
          ps axms

       To get security info:
          ps -eo euser,ruser,suser,fuser,f,comm,label
          ps axZ
          ps -eM

       To see every process running as root (real & effective ID) in user
       format:
          ps -U root -u root u

       To see every process with a user-defined format:
          ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
          ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm
          ps -Ao pid,tt,user,fname,tmout,f,wchan

       Print only the process IDs of syslogd:
          ps -C syslogd -o pid=

       Print only the name of PID 42:
          ps -q 42 -o comm=

 

运行 ps -ef

chenyuekai@chenyuekai-virtual-machine:~$ ps -ef
UID         PID   PPID  C STIME TTY          TIME CMD
root          1      0  0 11:11 ?        00:00:02 /sbin/init splash
root          2      0  0 11:11 ?        00:00:00 [kthreadd]
root          3      2  0 11:11 ?        00:00:00 [rcu_gp]
root          4      2  0 11:11 ?        00:00:00 [rcu_par_gp]
root          6      2  0 11:11 ?        00:00:00 [kworker/0:0H-kb]
root          9      2  0 11:11 ?        00:00:00 [mm_percpu_wq]
root         10      2  0 11:11 ?        00:00:00 [ksoftirqd/0]
root         11      2  0 11:11 ?        00:00:00 [rcu_sched]
root         12      2  0 11:11 ?        00:00:00 [migration/0]
root         13      2  0 11:11 ?        00:00:00 [idle_inject/0]
root         14      2  0 11:11 ?        00:00:00 [cpuhp/0]
root         15      2  0 11:11 ?        00:00:00 [kdevtmpfs]
root         16      2  0 11:11 ?        00:00:00 [netns]
root         17      2  0 11:11 ?        00:00:00 [rcu_tasks_kthre]
root         18      2  0 11:11 ?        00:00:00 [kauditd]
root         19      2  0 11:11 ?        00:00:00 [khungtaskd]
root         20      2  0 11:11 ?        00:00:00 [oom_reaper]
root         21      2  0 11:11 ?        00:00:00 [writeback]
root         22      2  0 11:11 ?        00:00:00 [kcompactd0]
root         23      2  0 11:11 ?        00:00:00 [ksmd]
root         24      2  0 11:11 ?        00:00:00 [khugepaged]
root        116      2  0 11:11 ?        00:00:00 [kintegrityd]
root        117      2  0 11:11 ?        00:00:00 [kblockd]
root        118      2  0 11:11 ?        00:00:00 [blkcg_punt_bio]
root        119      2  0 11:11 ?        00:00:00 [tpm_dev_wq]
root        120      2  0 11:11 ?        00:00:00 [ata_sff]
root        121      2  0 11:11 ?        00:00:00 [md]
root        122      2  0 11:11 ?        00:00:00 [edac-poller]
root        123      2  0 11:11 ?        00:00:00 [devfreq_wq]
root        124      2  0 11:11 ?        00:00:00 [watchdogd]
root        127      2  0 11:11 ?        00:00:00 [kswapd0]
root        128      2  0 11:11 ?        00:00:00 [kworker/u257:0]
root        129      2  0 11:11 ?        00:00:00 [ecryptfs-kthrea]
root        132      2  0 11:11 ?        00:00:00 [kthrotld]
root        133      2  0 11:11 ?        00:00:00 [irq/24-pciehp]
root        134      2  0 11:11 ?        00:00:00 [irq/25-pciehp]
root        135      2  0 11:11 ?        00:00:00 [irq/26-pciehp]
root        136      2  0 11:11 ?        00:00:00 [irq/27-pciehp]
root        137      2  0 11:11 ?        00:00:00 [irq/28-pciehp]
root        138      2  0 11:11 ?        00:00:00 [irq/29-pciehp]
root        139      2  0 11:11 ?        00:00:00 [irq/30-pciehp]
root        140      2  0 11:11 ?        00:00:00 [irq/31-pciehp]
root        141      2  0 11:11 ?        00:00:00 [irq/32-pciehp]
root        142      2  0 11:11 ?        00:00:00 [irq/33-pciehp]
root        143      2  0 11:11 ?        00:00:00 [irq/34-pciehp]
root        144      2  0 11:11 ?        00:00:00 [irq/35-pciehp]
root        145      2  0 11:11 ?        00:00:00 [irq/36-pciehp]
root        146      2  0 11:11 ?        00:00:00 [irq/37-pciehp]
root        147      2  0 11:11 ?        00:00:00 [irq/38-pciehp]
root        148      2  0 11:11 ?        00:00:00 [irq/39-pciehp]
root        149      2  0 11:11 ?        00:00:00 [irq/40-pciehp]
root        150      2  0 11:11 ?        00:00:00 [irq/41-pciehp]
root        151      2  0 11:11 ?        00:00:00 [irq/42-pciehp]
root        152      2  0 11:11 ?        00:00:00 [irq/43-pciehp]
root        153      2  0 11:11 ?        00:00:00 [irq/44-pciehp]
root        154      2  0 11:11 ?        00:00:00 [irq/45-pciehp]
root        155      2  0 11:11 ?        00:00:00 [irq/46-pciehp]
root        156      2  0 11:11 ?        00:00:00 [irq/47-pciehp]
root        157      2  0 11:11 ?        00:00:00 [irq/48-pciehp]
root        158      2  0 11:11 ?        00:00:00 [irq/49-pciehp]
root        159      2  0 11:11 ?        00:00:00 [irq/50-pciehp]
root        160      2  0 11:11 ?        00:00:00 [irq/51-pciehp]
root        161      2  0 11:11 ?        00:00:00 [irq/52-pciehp]
root        162      2  0 11:11 ?        00:00:00 [irq/53-pciehp]
root        163      2  0 11:11 ?        00:00:00 [irq/54-pciehp]
root        164      2  0 11:11 ?        00:00:00 [irq/55-pciehp]
root        165      2  0 11:11 ?        00:00:00 [acpi_thermal_pm]
root        166      2  0 11:11 ?        00:00:00 [scsi_eh_0]
root        167      2  0 11:11 ?        00:00:00 [scsi_tmf_0]
root        168      2  0 11:11 ?        00:00:00 [scsi_eh_1]
root        169      2  0 11:11 ?        00:00:00 [scsi_tmf_1]
root        171      2  0 11:11 ?        00:00:00 [ipv6_addrconf]
root        184      2  0 11:11 ?        00:00:00 [kstrp]
root        203      2  0 11:11 ?        00:00:00 [charger_manager]
root        252      2  0 11:11 ?        00:00:00 [mpt_poll_0]
root        253      2  0 11:11 ?        00:00:00 [mpt/0]
root        254      2  0 11:11 ?        00:00:00 [scsi_eh_2]
root        255      2  0 11:11 ?        00:00:00 [scsi_tmf_2]
root        256      2  0 11:11 ?        00:00:00 [scsi_eh_3]
root        257      2  0 11:11 ?        00:00:00 [scsi_tmf_3]
root        258      2  0 11:11 ?        00:00:00 [scsi_eh_4]
root        259      2  0 11:11 ?        00:00:00 [scsi_tmf_4]
root        260      2  0 11:11 ?        00:00:00 [scsi_eh_5]
root        261      2  0 11:11 ?        00:00:00 [scsi_tmf_5]
root        262      2  0 11:11 ?        00:00:00 [scsi_eh_6]
root        263      2  0 11:11 ?        00:00:00 [scsi_tmf_6]
root        264      2  0 11:11 ?        00:00:00 [scsi_eh_7]
root        265      2  0 11:11 ?        00:00:00 [scsi_tmf_7]
root        266      2  0 11:11 ?        00:00:00 [scsi_eh_8]
root        267      2  0 11:11 ?        00:00:00 [scsi_tmf_8]
root        268      2  0 11:11 ?        00:00:00 [scsi_eh_9]
root        269      2  0 11:11 ?        00:00:00 [scsi_tmf_9]
root        270      2  0 11:11 ?        00:00:00 [scsi_eh_10]
root        271      2  0 11:11 ?        00:00:00 [scsi_tmf_10]
root        272      2  0 11:11 ?        00:00:00 [scsi_eh_11]
root        273      2  0 11:11 ?        00:00:00 [scsi_tmf_11]
root        274      2  0 11:11 ?        00:00:00 [scsi_eh_12]
root        275      2  0 11:11 ?        00:00:00 [scsi_tmf_12]
root        276      2  0 11:11 ?        00:00:00 [scsi_eh_13]
root        277      2  0 11:11 ?        00:00:00 [scsi_tmf_13]
root        278      2  0 11:11 ?        00:00:00 [scsi_eh_14]
root        279      2  0 11:11 ?        00:00:00 [scsi_tmf_14]
root        280      2  0 11:11 ?        00:00:00 [scsi_eh_15]
root        281      2  0 11:11 ?        00:00:00 [scsi_tmf_15]
root        282      2  0 11:11 ?        00:00:00 [scsi_eh_16]
root        283      2  0 11:11 ?        00:00:00 [scsi_tmf_16]
root        284      2  0 11:11 ?        00:00:00 [scsi_eh_17]
root        285      2  0 11:11 ?        00:00:00 [scsi_tmf_17]
root        286      2  0 11:11 ?        00:00:00 [scsi_eh_18]
root        287      2  0 11:11 ?        00:00:00 [scsi_tmf_18]
root        288      2  0 11:11 ?        00:00:00 [scsi_eh_19]
root        289      2  0 11:11 ?        00:00:00 [scsi_tmf_19]
root        290      2  0 11:11 ?        00:00:00 [scsi_eh_20]
root        291      2  0 11:11 ?        00:00:00 [scsi_tmf_20]
root        292      2  0 11:11 ?        00:00:00 [scsi_eh_21]
root        293      2  0 11:11 ?        00:00:00 [scsi_tmf_21]
root        294      2  0 11:11 ?        00:00:00 [scsi_eh_22]
root        295      2  0 11:11 ?        00:00:00 [scsi_tmf_22]
root        296      2  0 11:11 ?        00:00:00 [scsi_eh_23]
root        297      2  0 11:11 ?        00:00:00 [scsi_tmf_23]
root        OS第1次实验报告:熟悉使用Linux命令和剖析ps命令

OS第1次实验报告:熟悉使用Linux命令和剖析ps命令

OS第1次实验报告:熟悉使用Linux命令和剖析ps命令

OS第1次实验报告:熟悉使用Linux命令和剖析ps命令

OS第1次实验报告:熟悉使用Linux命令和剖析ps命令

OS第1次实验报告:熟悉使用Linux命令和剖析ps命令