1 ps - o
命令
$ ps -eo pid,tty,user,comm,lstart,etime|grep fastq
参数说明: pid:进程ID tty:终端 user:用户 comm:进程名 lstart:开始时间 etime:运行时间
运行结果如下:
91413 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91414 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91415 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91416 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91417 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91418 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91419 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91420 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91421 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91422 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91423 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91424 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91425 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91426 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91427 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91428 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91429 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91430 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91431 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05
2 ps -ef
和ps aux
命令
ps -ef:标准格式显示进程 ps -aux:BSD格式显示进程
(base) pc@pc-System-Product-Name:/project/raw_fq$ ps -ef |head UID PID PPID C STIME TTY TIME CMD root 1 0 0 5月09 ? 00:00:08 /sbin/init splash root 2 0 0 5月09 ? 00:00:00 [kthreadd] root 3 2 0 5月09 ? 00:00:00 [rcu_gp] root 4 2 0 5月09 ? 00:00:00 [rcu_par_gp] root 6 2 0 5月09 ? 00:00:00 [kworker/0:0H-kb] root 8 2 0 5月09 ? 00:00:00 [mm_percpu_wq] root 9 2 0 5月09 ? 00:00:03 [ksoftirqd/0] root 10 2 0 5月09 ? 00:01:04 [rcu_sched] root 11 2 0 5月09 ? 00:00:00 [rcu_bh] (base) pc@pc-System-Product-Name:/project/raw_fq$ ps aux|head USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 225888 6456 ? Ss 5月09 0:08 /sbin/init splash root 2 0.0 0.0 0 0 ? S 5月09 0:00 [kthreadd] root 3 0.0 0.0 0 0 ? IUSER:用户名 %CPU:进程占用的CPU百分比 %MEM:占用内存的百分比 VSZ:该进程使用的虚拟內存量(KB) RSS:该进程占用的固定內存量(KB)(驻留中页的数量) STAT:进程的状态 START:该进程被触发启动时间 TIME:该进程实际使用CPU运行的时间
top命令
详细见
top也可以看进程信息,与ps区别如下
ps看命令执行那刻的进程信息,top是持续监视,ctrl c退出
ps只是查看进程,而top还可以监视系统性能,如平均负载,cpu和内存的消耗
总体来说, ps主要是查看进程的,尤其你关心的进程 top主要看cpu,内存使用情况,及占用资源最多的进程由高到低排序,关注点在于资源占用情况
总结
以上就是
为各位朋友分享的 相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多 等着你!