页面“Shell重定向”与“Showdoc安装部署”之间的差异

来自linux中国网wiki
(页面间的差异)
跳到导航 跳到搜索
docker>Evan
 
(导入1个版本)
 
第1行: 第1行:
 +
=环境准备=
 +
php nginx
  
=说说2>&1=
+
下载,给权限,配置nginx, 连mysql都可以不要,直接sqlite
  
<pre>
+
git clone https://github.com/star7th/showdoc.git
  
 +
在浏览器访问 http://xxxx.com/install/
 +
请将网址更改为你服务器域名或ip)安装完毕后可使用默认账号showdoc(密码:123456)登录,也可以自行注册账户
  
 +
=参考=
 +
http://www.showdoc.cc/php?page_id=14595
  
 +
http://www.cnblogs.com/liangml/p/6421600.html
  
通过上面command > /dev/null等价于command 1 > /dev/null,那么对于2>&1也就好理解了,2就是标准错误,1是标准输出,那么这条命令不就是相当于把标准错误重定向到标准输出么。
+
  [[category:ops]]
等等是&1而不是1,这里&是什么?这里&相当于等效于标准输出
 
 
 
常见的  commands >> /dev/null 2 >&1
 
 
 
 
 
2>&1 错误返回值传递给1输出通道, 同样&1表示1输出通道
 
 
 
2>/dev/null
 
</pre>
 
 
 
= >/dev/null 2>&1 帅的解说  =
 
<pre>
 
 
 
1>/dev/null 2>&1  和  >/dev/null 2>&1 是一样的
 
 
 
0代表标准输入
 
1代表stdout标准输出,默认值为1,所以”1>/dev/null”可以简写为”>/dev/null”
 
2代表stderr标准错误输出
 
 
 
(3)2>&1代表把stderr标准错误输出 重定向 到stdout标准输出
 
 
 
所以,1>/dev/null 2>&1的解释就是  note 1代表stdout标准输出,默认值为1,所以”1>/dev/null”可以简写为”>/dev/null”
 
 
 
将stdout标准输出重定向到空设备文件/dev/null ,同时将stderr标准错误输出的重定向跟stdout标准输出重定向一致,也输出到空设备文件/dev/null。
 
 
 
 
 
</pre>
 
 
 
[[Linux IO重定向]] 以前的WIKI
 
 
 
=see also=
 
 
 
[https://www.cnblogs.com/520playboy/p/6275022.html shell中>/dev/null 2>&1]
 
 
 
https://www.jb51.net/article/64183.htm
 
 
 
https://www.zhihu.com/question/53295083
 
[[category:shell]] [[category:ops]]
 

2019年10月14日 (一) 13:52的最新版本

环境准备

php nginx

下载,给权限,配置nginx, 连mysql都可以不要,直接sqlite

git clone https://github.com/star7th/showdoc.git

在浏览器访问 http://xxxx.com/install/ 请将网址更改为你服务器域名或ip)安装完毕后可使用默认账号showdoc(密码:123456)登录,也可以自行注册账户

参考

http://www.showdoc.cc/php?page_id=14595

http://www.cnblogs.com/liangml/p/6421600.html