转自:http://www.cnblogs.com/stephen-liu74/archive/2011/11/10/2240461.htmlLinux系统提供了两个对Shell编程非常有用的特殊文件,/dev/null和/dev/tty。其中/dev/null将会丢掉所有写入它的数据,换句换说,当...
分类:
其他好文 时间:
2015-07-22 22:11:04
阅读次数:
122
curl -o /dev/null -s -w "nslookup_time :%{time_namelookup}\n time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{t...
分类:
Web程序 时间:
2015-07-21 20:30:25
阅读次数:
114
一直在学习,也一直在忘记,今天借助这篇博文,记录下自己学习过程中的一些最基础的东西!1、for#!/bin/bash
foriin{1..10}
do
echo$i
done扫描目标网段中活动的ip#!/bin/bash
foripin192.168.1.{1..255};
do
ping$ip-c2&>/dev/null;
if[$?-eq0];
then
echo$ipi..
分类:
系统相关 时间:
2015-07-21 15:24:35
阅读次数:
132
system("nohupphpindex.php>/dev/null&");nohup命令会开启一个新的进程执行后面的PHP任务这里有要一个要注意的地方,这一段>/dev/null&是不可缺少的,>/dev/null表示立即将php的执行结果返回为空,如果不加,调用此命令的PHP会等待system调用的php页面结果,..
分类:
Web程序 时间:
2015-07-21 15:06:45
阅读次数:
136
#!/bin/shwhile truedops | grep "main_3g" | grep -v "grep" > /dev/nullif [ "$?" -ne 0 ]then ls /root/main_3g > /dev/null if [ "$?" -eq 0 ] the...
分类:
系统相关 时间:
2015-07-17 00:15:15
阅读次数:
179
d211 admin # for i in {3..254} ; do ping -c 1 192.168.1.$i &>/dev/null && echo 192.168.1.$i is alive ;done192.168.1.5 is alive192.168.1.7 is alivefpin...
分类:
系统相关 时间:
2015-07-14 13:08:16
阅读次数:
143
输入输出重定向&> 混合重定向 /dev/null 数据黑洞> 覆盖输出>> 追加输出set -C 对已存在文件关闭覆盖重定向 强制覆盖输出则 >|2> 重定向错误输出2>> 追加错误输出<< Here Document <<后面加结束符号
分类:
系统相关 时间:
2015-07-12 21:34:33
阅读次数:
128
break和continue
这两个命令分别用来退出循环,或跳到循环体的其他地方.
使用while与break,等待用户登录
bash代码:
printf “Enter username: ”
read user
while true
do
if who | grep “$user” >/dev/null
then
break;
fi
sleep 30
done
...
分类:
系统相关 时间:
2015-06-28 12:42:40
阅读次数:
119
1 什么是Linux黑洞
在Linux系统中,/dev/null是一个虚设的设备,俗称“Linux黑洞”。
任何对/dev/null的写入都会成功,但数据会消失得无影无踪,没有任何反馈,读入数据也为空。
2 Linux黑洞有什么左右
经常把不想在屏幕显示的信息全部送到/dev/null中,在shell脚本中用得比较多。该命令必须结合输出重定向进行使用。
如:
将查看...
分类:
系统相关 时间:
2015-06-27 18:31:30
阅读次数:
320
通过局域网MAC地址得到IP地址[root@localhostcli]#cattmp.shfunctionget_all_arp_info(){ip-s-sneighflushall>/dev/nul&foripin`seq2254`doping192.168.50.$ip-c1>/dev/null&done}functionfrom_mac_get_ip(){get_all_arp_infoMAC_ADDR=$1if[[-n`ipneigh|grep$MAC..
分类:
系统相关 时间:
2015-06-27 00:05:34
阅读次数:
190