monitor
来自「利用C」· 代码 · 共 29 行
TXT
29 行
#!/bin/sh## Copyright (C) 2005 Anders Logg. # Licensed under the GNU LGPL Version 2.1. ## First added: 2005-12-13# Last changed: 2005-12-13# # Monitor memory usage for given command. This script# will probably only work on Linux.## Note that this script runs the given command as a new# process, so killing the script (ctrl-c) won't kill the# running process.exec $* &pid="$!"echo "Monitoring memory usage for process with id $pid..."PIDFILE="/proc/$pid/status"while [ 1 ]; do if [ -e $PIDFILE ]; then cat $PIDFILE | grep VmSize | awk '{ print $2/1024" MB"}' else exit 0 fi sleep 1done
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?