xof*_*fer 56
请改用: ps -ax | grep -i skype
如果你真的爱顶,你可以尝试:
top -b -n 1 | grep skype
Run Code Online (Sandbox Code Playgroud)
例如
kent$ top -b -n 1 |grep dropbox
4039 kent 20 0 184m 14m 5464 S 0 0.4 0:58.30 dropbox
Run Code Online (Sandbox Code Playgroud)
在Linux上,该top命令支持-p监视特定PID 的选项.在MacOS上,-p调用该选项-pid.
# Get the PID of the process
pgrep Skype
# Then
top -pid <put PID here>
# Or more succinctly:
top -pid `pgrep Skype`
Run Code Online (Sandbox Code Playgroud)
如果你做了很多,你可以把它变成一个函数并将其添加到 ~/.bash_profile:
# Add this to ~/.bash_profile
function topgrep() {
if [[ $# -ne 1 ]]; then
echo "Usage: topgrep <expression>"
else
top -pid `pgrep $1`
fi
}
Run Code Online (Sandbox Code Playgroud)
现在您可以简单地使用topgrep Skype,它将像往常一样运行,但它只显示进程匹配expression.
| 归档时间: |
|
| 查看次数: |
54694 次 |
| 最近记录: |