我的常用命令

来源:互联网 发布:bim设计方案优化 编辑:程序博客网 时间:2024/05/01 00:38

1  linux下使某个命令在后台运行,在关闭crt等的终端命令行工具后,

   确保该程序仍旧能正确运行。  例如我要启动某个程序:    ./startup.sh   run   > dev/null 2>&1  &

   看到网上也很多说 ./startup.sh   run > dev/null &    ///////后台运行,stdout 直接到/dev/null 

1)“wibble > /dev/null 2>1″ stdout is redirected to /dev/null and stderr is redirected to a file named “1″ (in the current directory)
2)“wibble > /dev/null 2>&1″ stdout is redirected to /dev/null and stderr is redirected to where stdout is redirected (bit bucket)
3) “wibble > /dev/null &2>1″ stdout is redirected to /dev/null , then character “&” comes, which means that this process will run in background(parallel with the shell u are using). Then comes 2>1 which will create an empt file with the name 1.
And FINALLY!!!
4) "wibble > /dev/null &2>&1 " stdout is redirected to /dev/null. “&” means that, that process(wibble) will run in background(with stdout redirected only).Then another process is started with 2>&1 which creates no file.


/////////////////////////////////命令有待增加哦//////////////////////////////////////////////////////////