问题
1.以用户lisi登入,完成下列操作
2.使用vim打开nsd.txt文件,不要编辑、不退出
3.以用户root登入另一个终端,完成下列操作
4.查找用户lisi使用的bash进程的父进程名称、PID
5.根据查找结果,列出该父进程的进程树
方案
ps命令主要记住两个组合:一个是“aux”,记住前面没有“-”,另一个是“-elf”。要记住一点“-elf”,显示结果中有PPID为父ID值。
步骤
实现此案例需要按照如下步骤进行。
步骤一:以用户lisi登入,完成下列操作
分析: 按Ctrl+Shift+t再开一个终端,利用su命令切换进行操作,如图-2所示。

图-2
使用vim打开nsd.txt文件,不要编辑、不退出,命令操作如下所示:
[lisi@localhost ~]$ vim nsd.txt //按Enter回车即可
步骤二:以用户root登入另一个终端,完成下列操作
分析: 上题中lisi打开nsd.txt的终端开着不用动,以供测试。查找的是父进程,所以选项应是-elf。
查找用户lisi使用的bash进程的父进程名称、PID,命令操作如下所示:
[root@localhost ~]# ps -elf | grep lisi
4 S root 3260 2767 0 80 0 - 40936 wait 10:49 pts/1 00:00:00 su - lisi
4 S lisi 3261 3260 0 80 0 - 27084 n_tty_ 10:49 pts/1 00:00:00 -bash
0 S root 3340 2786 0 80 0 - 25814 pipe_w 10:55 pts/2 00:00:00 grep lisi
//其中3260为父进程的PID
根据查找结果,列出该父进程的进程树,命令操作如下所示:
[root@localhost ~]# pstree -aup 3260
su,3260 - lisi
└─bash,3261,lisi
[root@localhost ~]#
本文章固定链接: http://www.rakbuluo.com/p52/
<A HREF='http://vidallista.com/'>vidalista without a doctor prescription</A>
<a href='https://cialis.grassfed.us/'>best research tadalafil</a>
<a href="https://ddapoxetine.com/">price comparison viagra dapoxetine levitra</a>
https://cial20mg.online/ - cialis canada online
Hi, all the time i used to check website posts here in the early
hours in the break of day, as i enjoy to learn more and more.
<a href="https://cial20mg.online/">tadalafil india price</a>
<A HREF="https://tadfil.online/">how can i get tadalafil over the counter</A>
https://cialinic.com/ - cialis medication price
<a href="https://sildenafili.com/">sildenafil</a>
<a href="https://cialinic.com/">cialis everyday</a>
<a href=https://hydroxychloroquinee.com/>what are side effects of hydroxychloroquine</a>
<a href="https://amstyles.com/">https://amstyles.com/</a>
<a href="https://sildrx.com/">cvs viagra prices without insurance</a>
<a href=https://aurogra.buszcentrum.com/>what is the drug aurogra used for</a>
<A HREF=https://vidalista40mg.mlsmalta.com/>does 60 mg of vidalista work</A>
<A HREF="https://ivermectin1st.com/">non ivermectin heartworm preventative</A>
<a href='https://suhagra.buszcentrum.com/'>can women take suhagra</a>
<a href="https://sildenafildug.com/">viagra walgreens cost</a>
<a href="https://sildenafiltar.com/">viagra at 75</a>
<a href="https://cadviag.com/">taking finasteride and viagra</a>
<a href="https://cadviag.com/">best price for viagra</a>
https://cadviag.com/# - best price for viagra
<a href="http://www.lm360.us/">cialis low price cialis</a>
<a href="https://clomidweb.com/">clomiphene pct</a>
<a href='https://tamoxifen.mrdgeography.com/'>why not to take tamoxifen</a>
<a href="https://dapoxetine.bee-rich.com/">what is the generic dapoxetine</a>
<a href="https://ivermectin.webbfenix.com/">ivermectin us pharmacy fedex delivery</a>
generic viagra <a href=" http://sild100fast.com/# ">viagra without a doctor prescription</a> viagra online canadian pharmacy