歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux覆蓋和追加

Linux覆蓋和追加

日期:2017/2/28 15:55:26   编辑:Linux教程

nohup 的使用是十分方便的,只需在要處理的命令前加上 nohup 即可,標准輸出和標准錯誤缺省會被重定向到 nohup.out 文件中。一般我們可在結尾加上"&"來將命令同時放入後台運行,也可用">filename 2>&1"來更改缺省的重定向文件名。

nohup 示例

[[email protected] ~]# nohup ping www.ibm.com & [1] 3059 nohup: appending output to `nohup.out'
[[email protected] ~]# ps -ef |grep 3059 root 3059 984 0 21:06 pts/3 00:00:00 ping www.ibm.com root 3067 984 0 21:06 pts/3 00:00:00 grep 3059
[[email protected] ~]#

在進行文件重定向的時候,>表示覆蓋,>>表示追加。

cat a >> b 追加

Copyright © Linux教程網 All Rights Reserved