挂载命令pid
尝试挂载设备并获取挂载命令的 pid。
cmd="/bin/mount /dev/sda1 /mnt"
os.system(cmd)
现在如何获取mount命令的pid?我的系统上有很多可用的已安装设备,例如 ps | grep mount 不起作用。
Trying to mount a device and get the pid of mount command.
cmd="/bin/mount /dev/sda1 /mnt"
os.system(cmd)
Now how to obtain the pid of mount command? There plenty of mounted device available on my system, something like ps | grep mount
won't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如评论所暗示的,我不确定获取挂载 pid 有多大用处,但如果您使用 subprocess 模块,您可以轻松获取 pid。
As the comments suggest I'm not sure how useful it is to get the mount pid, but if you use the subprocess module you can easily get the pid.