当前位置: 技术问答>linux和unix
怎样在linux命令行同时运行多个相同程序
来源: 互联网 发布时间:2017-02-03
本文导语: 我想同时运行多个相同的程序,来模拟一下CPU的繁忙情况。 例如:cpu_bound01.c cpu_bound02.c cpu_bound03.c 这三个程序。 用gcc 编译三个程序后: cpu_bound01 cpu_bound02 cpu_bound03 可执行文件名。 输入什么命令才能...
我想同时运行多个相同的程序,来模拟一下CPU的繁忙情况。
例如:cpu_bound01.c cpu_bound02.c cpu_bound03.c 这三个程序。
用gcc 编译三个程序后: cpu_bound01 cpu_bound02 cpu_bound03 可执行文件名。
输入什么命令才能同时运行这三个程序?!
谢谢
例如:cpu_bound01.c cpu_bound02.c cpu_bound03.c 这三个程序。
用gcc 编译三个程序后: cpu_bound01 cpu_bound02 cpu_bound03 可执行文件名。
输入什么命令才能同时运行这三个程序?!
谢谢
|
写个脚本,都放后台执行
#!/bin/bash/
./cpu_bound01 &
./cpu_bound02 &
./cpu_bound03 &
|
./cpu_bound01 &; ./cpu_bound02 &; ./cpu_bound03 &;
分号分隔 挨个扔后台就行了...
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。