码迷,mamicode.com
首页 > 系统相关 > 详细

数学之路-分布式计算-linux/unix技术基础(2)

时间:2014-09-16 12:46:30      阅读:344      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   使用   ar   文件   div   

让进程在后台运行,执行命令后立即返回,可以继续执行其它命令,在命令行最后加上“&”

bash-4.2$ find ~ -name doc &
[1] 5453
bash-4.2$ /home/myhaspl/hadoop-2.4.1/share/doc
/home/myhaspl/pypy-2.3.1-src/site-packages/numpy/doc
/home/myhaspl/pypy-2.3.1-src/ctypes_configure/doc
/home/myhaspl/pypy-2.3.1-src/pypy/doc
/home/myhaspl/numpy/doc
/home/myhaspl/numpy/build/lib.linux-x86_64-2.7/numpy/doc
/home/myhaspl/numpy/numpy/doc
/home/myhaspl/numpy/numpy/numpy/doc
/home/myhaspl/numpy/numpy/numpy/f2py/doc

重定向

下面命令查找文件,并将结果列表重定向到一个文件中

bash-4.2$ find ~ -name doc >mydoclist &
[1] 5461
bash-4.2$ ls
hadoop-2.4.1 hadoop-2.4.1.tar.gz  numpy
hadoop-2.4.1-src.tar.gz  mydoclist      pypy-2.3.1-src
[1]+  完成                  find ~ -name doc > mydoclist
bash-4.2$ cat mydoclist
/home/myhaspl/hadoop-2.4.1/share/doc
/home/myhaspl/pypy-2.3.1-src/site-packages/numpy/doc
/home/myhaspl/pypy-2.3.1-src/ctypes_configure/doc
/home/myhaspl/pypy-2.3.1-src/pypy/doc
/home/myhaspl/numpy/doc
/home/myhaspl/numpy/build/lib.linux-x86_64-2.7/numpy/doc
/home/myhaspl/numpy/numpy/doc
/home/myhaspl/numpy/numpy/numpy/doc
/home/myhaspl/numpy/numpy/numpy/f2py/doc
/home/myhaspl/numpy/numpy/build/lib.linux-x86_64-2.7/numpy/doc
bash-4.2$ 

重定向增加到一个文件中,使用">>"

bash-4.2$ find ~ -name hadoop >>mydoclist &
[1] 5466

bash-4.2$ cat mydoclist
/home/myhaspl/hadoop-2.4.1/share/doc
/home/myhaspl/pypy-2.3.1-src/site-packages/numpy/doc
/home/myhaspl/pypy-2.3.1-src/ctypes_configure/doc
/home/myhaspl/pypy-2.3.1-src/pypy/doc
/home/myhaspl/numpy/doc
/home/myhaspl/numpy/build/lib.linux-x86_64-2.7/numpy/doc
/home/myhaspl/numpy/numpy/doc
/home/myhaspl/numpy/numpy/numpy/doc
/home/myhaspl/numpy/numpy/numpy/f2py/doc
/home/myhaspl/numpy/numpy/build/lib.linux-x86_64-2.7/numpy/doc
/home/myhaspl/hadoop-2.4.1/bin/hadoop
/home/myhaspl/hadoop-2.4.1/etc/hadoop
/home/myhaspl/hadoop-2.4.1/share/hadoop
/home/myhaspl/hadoop-2.4.1/share/hadoop/httpfs/tomcat/webapps/webhdfs/WEB-INF/classes/org/apache/hadoop
/home/myhaspl/hadoop-2.4.1/share/hadoop/httpfs/tomcat/webapps/webhdfs/WEB-INF/classes/org/apache/hadoop/lib/service/hadoop
/home/myhaspl/hadoop-2.4.1/share/doc/hadoop
/home/myhaspl/hadoop-2.4.1/share/doc/hadoop/api/src-html/org/apache/hadoop
/home/myhaspl/hadoop-2.4.1/share/doc/hadoop/api/org/apache/hadoop
/home/myhaspl/hadoop-2.4.1/share/doc/hadoop/api/org/apache/hadoop/lib/service/hadoop
/home/myhaspl/hadoop-2.4.1/share/doc/hadoop/hadoop-hdfs-httpfs/apidocs/src-html/org/apache/hadoop
/home/myhaspl/hadoop-2.4.1/share/doc/hadoop/hadoop-hdfs-httpfs/apidocs/src-html/org/apache/hadoop/lib/service/hadoop
/home/myhaspl/hadoop-2.4.1/share/doc/hadoop/hadoop-hdfs-httpfs/apidocs/org/apache/hadoop
/home/myhaspl/hadoop-2.4.1/share/doc/hadoop/hadoop-hdfs-httpfs/apidocs/org/apache/hadoop/lib/service/hadoop


本博客所有内容是原创,如果转载请注明来源

http://blog.csdn.net/myhaspl/

使用管道“|",将第1个命令的输出变为第2个命令的输入。

bash-4.2$ find ~ -name hadoop|grep hdfs
/home/myhaspl/hadoop-2.4.1/share/hadoop/httpfs/tomcat/webapps/webhdfs/WEB-INF/classes/org/apache/hadoop
/home/myhaspl/hadoop-2.4.1/share/hadoop/httpfs/tomcat/webapps/webhdfs/WEB-INF/classes/org/apache/hadoop/lib/service/hadoop
/home/myhaspl/hadoop-2.4.1/share/doc/hadoop/hadoop-hdfs-httpfs/apidocs/src-html/org/apache/hadoop
/home/myhaspl/hadoop-2.4.1/share/doc/hadoop/hadoop-hdfs-httpfs/apidocs/src-html/org/apache/hadoop/lib/service/hadoop
/home/myhaspl/hadoop-2.4.1/share/doc/hadoop/hadoop-hdfs-httpfs/apidocs/org/apache/hadoop
/home/myhaspl/hadoop-2.4.1/share/doc/hadoop/hadoop-hdfs-httpfs/apidocs/org/apache/hadoop/lib/service/hadoop

数学之路-分布式计算-linux/unix技术基础(2)

标签:style   blog   http   color   io   使用   ar   文件   div   

原文地址:http://blog.csdn.net/myhaspl/article/details/39314013

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!