Chinaunix首页 | 论坛 | 博客
  • 博客访问: 156866
  • 博文数量: 31
  • 博客积分: 2025
  • 博客等级: 大尉
  • 技术积分: 380
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-09 15:21
文章分类

全部博文(31)

文章存档

2011年(1)

2010年(1)

2009年(29)

我的朋友

分类: LINUX

2009-12-27 19:28:59

A. 
1> /dev/null 表示将命令的标准输出重定向到 /dev/null
2>/dev/null 表示将命令的错误输出重定向到 /dev/null

1 - denotes stdout ( standard output )
2 - denotes stderr  ( standard error )
/dev/null就相当与windows里的回收站,只是进去了不能再出来了。
>/dev/null 就是将标准输出和标准出错的信息屏蔽不显示
B.
>/dev/null 2>&1   also can write  as  1>/dev/null 2>&1     
- stdout redirect to /dev/null (no stdout) ,and redirect stderr to stdout  (stderr gone as well) . end up it turns both stderr and stdout off
C.
a little practice may help to undstand above .  
#ls /usr  /nothing 
#ls /usr  /nothing  2>/dev/null 
#ls /usr  /nothing  >/dev/null 2>&1 

-----------------------分割线-----------------------------------------
cd -          #回到上次所在目录,这个技巧我原来还真是不知道,感觉还是比较有用,省略了很多输入。
cd !$          #把上个命令的参数作为输入。
cd           #回到主目录
cd ~         #同样也是回到主目录
阅读(6686) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~