check if a linux process is done using bash 检查进程是否在运行
# cat > check_process_is_end.sh
while true
do
sleep 30 # seconds
res=`ps -ef | grep RNAhybrid`
count=`grep -o "RNAhybrid" <<<"$res" | wc -l`
if [ "$count" -eq "1" ] ; then
echo $res
echo -en "\007"
sleep 1
echo -en "\007"
sleep 1
echo -en "\007"
fi
done
# chmod u+x check_process_is_end.sh
# ./check_process_is_end.sh
NOTE: RNAhybrid is a process name.
#======================
# 监控某个进程运行时占用的内存
#======================
# cat > process_memory.sh
while true
do
sleep 30 # seconds
res=`ps aux | grep -w "RNAhybrid"`
date >> mylogs
echo $res >> mylogs
done
# chmod u+x process_memory.sh
# ./process_memory.sh
NOTE: RNAhybrid is a process name.
check if a linux process is done using bash 检查进程是否在运行的更多相关文章
- Linux Process Virtual Memory
目录 . 简介 . 进程虚拟地址空间 . 内存映射的原理 . 数据结构 . 对区域的操作 . 地址空间 . 内存映射 . 反向映射 .堆的管理 . 缺页异常的处理 . 用户空间缺页异常的校正 . 内核 ...
- Linux Process/Thread Creation、Linux Process Principle、sys_fork、sys_execve、glibc fork/execve api sourcecode
相关学习资料 linux内核设计与实现+原书第3版.pdf(.3章) 深入linux内核架构(中文版).pdf 深入理解linux内核中文第三版.pdf <独辟蹊径品内核Linux内核源代码导读 ...
- Performance Tuning Using Linux Process Management Commands
[root@bigdata-server-02 /]# ps --help all Usage: ps [options] Basic options: -A, -e all processes -a ...
- Linux process vs thread
Linux process vs thread Question I have a query related to the implementation of threads in Linux. L ...
- Linux Process VS Thread VS LWP
Process program program==code+data; 一个进程可以对应多个程序,一个程序也可以变成多个进程.程序可以作为一种软件资源长期保存,以文件的形式存放在硬盘 process: ...
- Linux process authority、the security risks in running process with high authority
catalog . Linux进程权限原理 . 最小权限原则 - 进程降权运行最佳实践 . 进程权限控制包含的攻防向量 . 进程高权限安全风险检查技术方案 1. Linux进程权限原理 我们知道,Li ...
- Linux Process Management && Process Scheduling Principle
目录 . 引言 . 进程优先级 . 进程的生命周 . 进程表示 . 进程管理相关的系统调用 . 进程调度 . 完全公平调度类 . 实时调度类 . 调度器增强 . 小结 1. 引言 在多处理器系统中,可 ...
- Shell script for logging cpu and memory usage of a Linux process
Shell script for logging cpu and memory usage of a Linux process http://www.unix.com/shell-programmi ...
- Linux 进程与信号的概念和操作 linux process and signals
进程 主要参考: http://www.bogotobogo.com/Linux/linux_process_and_signals.php 译者:李秋豪 信号与进程几乎控制了操作系统的每个任务. 在 ...
随机推荐
- Swift-3-字符串和字符
// Playground - noun: a place where people can play import UIKit var someString = "some string ...
- Javascript动态生成表格的性能调优
vision 0.8 [耗时672ms]终极优化 将字符串作为数组对象的方式是目前效率最高,性能最优的方式. <script> var t1 = new Date(); < ...
- [geeksforgeeks] Bottom View of a Binary Tree
http://www.geeksforgeeks.org/bottom-view-binary-tree/ Bottom View of a Binary Tree Given a Binary Tr ...
- nginx 多站点配置方法集合(转)
关于nginx的多站设置,其实和apache很相似,假设我们已经有两个域名,分别是:www.websuitA.com和www.websuitB.com.并且这两个域名已经映射给了IP为192.168. ...
- [翻译]The Neophyte's Guide to Scala Part 12: Type Classes
The Neophyte's Guide to Scala Part 12: Type Classes 过去的两周我们讨论了一些使我们保持DRY和灵活性的函数式编程技术,特别是函数组合,partial ...
- Sqli-labs less 45
Less-45 同样的,45关与43关的payload是一样的,只不过45关依旧没有报错信息. 登录 username:admin Password:c');create table less45 l ...
- CentOS用yum安装X Window
安装X图形界面系统 yum list 列出所有可安装的软件包 可以通过 yum grouplist 来查看可能批量安装哪些列表 先装X windows #yum groupinstall 'X Win ...
- 为什么主流网站无法捕获 XSS 漏洞?
二十多年来,跨站脚本(简称 XSS)漏洞一直是主流网站的心头之痛.为什么过了这么久,这些网站还是对此类漏洞束手无策呢? 对于最近 eBay 网站曝出的跨站脚本漏洞,你有什么想法?为什么会出现这样的漏网 ...
- ZOJ3718 Diablo II(状态压缩dp)
题意:一个人物有K(K<=7)种技能,每种技能都有bi,ci,di值,表示该技能不能点超过bi次,每点一次加ci,点满bi次有一个附加得分di.然后还有N件武器,武器本身会有能力加成,然后每个武 ...
- poj 1986
Distance Queries Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 8638 Accepted: 3032 ...