51Testing软件测试论坛
标题: 给力的linux命令--parallel安装 [打印本页]
作者: TimiZheng 时间: 2019-9-27 14:01
标题: 给力的linux命令--parallel安装
GNU parallel是并行执行任务的shell工具。在文章情景linux—shell如何实现多线程?中提到了它的一种用法,但这远远不够,它还有许多更强大的应用场景。但在此之前,需要先安装它。
下载
作者: TimiZheng 时间: 2019-9-27 14:02
安装
- sudo make install -j 16
- Making install in src
- make[1]: Entering directory `/home/j-tester/bin/multiple_process/parallel-20170622/src'
- make[2]: Entering directory `/home/j-tester/bin/multiple_process/parallel-20170622/src'
- /bin/mkdir -p '/usr/local/bin'
- /bin/mkdir -p '/usr/local/share/doc/parallel'
- /bin/mkdir -p '/usr/local/share/man/man1'
- /bin/mkdir -p '/usr/local/share/man/man7'
- /usr/bin/install -c parallel sql niceload parcat env_parallel env_parallel.ash env_parallel.bash env_parallel.csh env_parallel.dash env_parallel.fish env_parallel.ksh env_parallel.pdksh env_parallel.sh env_parallel.tcsh env_parallel.zsh '/usr/local/bin'
- /usr/bin/install -c -m 644 parallel.html env_parallel.html sem.html sql.html niceload.html parallel_tutorial.html parallel_design.html parallel_alternatives.html parcat.html parset.html parallel.texi env_parallel.texi sem.texi sql.texi niceload.texi parallel_tutorial.texi parallel_design.texi parallel_alternatives.texi parcat.texi parset.texi parallel.pdf env_parallel.pdf sem.pdf sql.pdf niceload.pdf parallel_tutorial.pdf parallel_design.pdf parallel_alternatives.pdf parcat.pdf parset.pdf '/usr/local/share/doc/parallel'
- /usr/bin/install -c -m 644 parallel.1 env_parallel.1 sem.1 sql.1 niceload.1 parcat.1 parset.1 '/usr/local/share/man/man1'
- /usr/bin/install -c -m 644 parallel_tutorial.7 parallel_design.7 parallel_alternatives.7 '/usr/local/share/man/man7'
- make install-exec-hook
- make[3]: Entering directory `/home/j-tester/bin/multiple_process/parallel-20170622/src'
- rm /usr/local/bin/sem || true
- rm: cannot remove `/usr/local/bin/sem': No such file or directory
- ln -s parallel /usr/local/bin/sem
- make[3]: Leaving directory `/home/j-tester/bin/multiple_process/parallel-20170622/src'
- make[2]: Leaving directory `/home/j-tester/bin/multiple_process/parallel-20170622/src'
- make[1]: Leaving directory `/home/j-tester/bin/multiple_process/parallel-20170622/src'
- make[1]: Entering directory `/home/j-tester/bin/multiple_process/parallel-20170622'
- make[2]: Entering directory `/home/j-tester/bin/multiple_process/parallel-20170622'
- make[2]: Nothing to be done for `install-exec-am'.
- make[2]: Nothing to be done for `install-data-am'.
- make[2]: Leaving directory `/home/j-tester/bin/multiple_process/parallel-20170622'
- make[1]: Leaving directory `/home/j-tester/bin/multiple_process/parallel-20170622'
复制代码
作者: TimiZheng 时间: 2019-9-27 14:03
测试安装后的效果
- whereis parallel
- parallel: /usr/local/bin/parallel
- $ parallel --help
- Usage:
- parallel [options] [command [arguments]] < list_of_arguments
- parallel [options] [command [arguments]] (::: arguments|:::: argfile(s))...
- cat ... | parallel --pipe [options] [command [arguments]]
- -j n Run n jobs in parallel
- -k Keep same order
- -X Multiple arguments with context replace
- --colsep regexp Split input on regexp for positional replacements
- {} {.} {/} {/.} {#} {%} {= perl code =} Replacement strings
- {3} {3.} {3/} {3/.} {=3 perl code =} Positional replacement strings
- With --plus: {} = {+/}/{/} = {.}.{+.} = {+/}/{/.}.{+.} = {..}.{+..} =
- {+/}/{/..}.{+..} = {...}.{+...} = {+/}/{/...}.{+...}
- -S sshlogin Example: foo@server.example.com
- --slf .. Use ~/.parallel/sshloginfile as the list of sshlogins
- --trc {}.bar Shorthand for --transfer --return {}.bar --cleanup
- --onall Run the given command with argument on all sshlogins
- --nonall Run the given command with no arguments on all sshlogins
- --pipe Split stdin (standard input) to multiple jobs.
- --recend str Record end separator for --pipe.
- --recstart str Record start separator for --pipe.
- See 'man parallel' for details
- Academic tradition requires you to cite works you base your article on.
- When using programs that use GNU Parallel to process data for publication
- please cite:
- O. Tange (2011): GNU Parallel - The Command-Line Power Tool,
- ;login: The USENIX Magazine, February 2011:42-47.
- This helps funding further development; AND IT WON'T COST YOU A CENT.
- If you pay 10000 EUR you should feel free to use GNU Parallel without citing.
复制代码
参考链接
https://www.gnu.org/software/parallel/
情景linux—shell如何实现多线程?
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) |
Powered by Discuz! X3.2 |