• 2006-11-30

    Linux应用的小技巧

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
    http://happyman-bruce.blogbus.com/logs/3942400.html

    1、让tail不停地读地最新的内容

    tail -n 10 -f /etc/httpd/logs/access.log

    2、查看文件中间的第五行(含)到第10行(含)的内容
    sed -n '5,10p' /etc/httpd/logs/access.log

    3、使系统对ping没反应
    echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

    4、使tcp syn cookie保护生效
    echo 1 > /proc/sys/net/ipv4/tcp_syncookies

    5、find命令使用参数
    格式: find [path...] [expression]
    find / -name access_log 2>/dev/null 不显示错误信息
    find /-amin n ##查找系统中最后N分钟访问的文件
    find /-atime n ##查找系统中最后n*24小时访问的文件
    find /-cmin n ##查找系统中最后N分钟被改变状态的文件
    find /-ctime n ##查找系统中最后n*24小时被改变状态的文件
    find /-empty ##查找系统中空白的文件,或空白的文件目录,或目录中没有子目录的文件夹
    find /-false ##查找系统中总是错误的文件
    find /-fstype type ##查找系统中存在于指定文件系统的文件,例如:ext2 .
    find /-gid n ##查找系统中文件数字组 ID 为 n的文件
    find /-group gname ##查找系统中文件属于gnam文件组,并且指定组和ID的文件
    find / -mmin n # 查找在系统中最后n分钟里修改过的文件
    find / -mtime n #查找在系统中最后24*n小时里修改过的文件
    find / -nouser #查找在系统中属于作废用户的文件
    find / -size nc #查找在系统中长度为n字节的文件
    find / -size +nc #查找在系统中长度大于n字节的文件
    find / -daystart ##测试系统从今天开始24小时以内的文件,用法类似-amin
    find / -depth ##使用深度级别的查找过程方式,在某层指定目录中优先查找文件内容
    find / -follow ##遵循通配符链接方式查找; 另外,也可忽略通配符链接方式查询
    find / -help ##显示命令摘要
    find / -maxdepth levels ##在某个层次的目录中按照递减方法查找
    find / -mount ##不在文件系统目录中查找, 用法类似 -xdev.
    find / -noleaf ##禁止在非UNUX文件系统,MS-DOS系统,CD-ROM文件系统中进行最优化查找
    find / -version ##打印版本数字
    -exec command; ##查找并执行命令
    -fprint file ##打印文件完整文件名
    -fprint0 file ##打印文件完整文件名包括空的文件
    -fprintf file format ##打印文件格式
    -ok command; ##给用户命令执行操作,根据用户的Y 确认输入执行
    -printf format ##打印文件格式
    -ls ##打印同种文件格式的文件.
    几个参数之间可以用-and,-or连接,某个参数取反可用!.

    收藏到:Del.icio.us




    评论

  • In the 16 to17 year old class, Kaleb was one of six competitors in the 275 pound weight division. His competitors included three powerlifters from Germany, one from Ukraine and one from Iraq. Kaleb took home the gold medal by lifting 512 pounds in the squat, 250 in the bench and 476 pounds in the dead lift event. Just getting to Russia was no small feat. Besides winning the necessary qualifying meets, Kaleb, his coaches, family and friends had to raise enough money for the trip. Between the porkburger sales and raffle tickets, they came up with nearly $7,000 to pay for airfare, room and board. Now that he's won the Gold in the WPC Championships in his class, Kaleb is taking some time off to recuperate from the lingering effects of "mono" and to recover from the whirlwind trip to Russia. "I hope to get back into training soon," Kaleb said. "Winning in Russia qualifies me to compete...<br><a href='http://wl-site.com/news/23123'>http://wl-site.com/</a>
  • Dr Nahed Taher highlighted the mining, petrochemical, transportation, utilities and communications sectors as industry fields in which regional companies have a chance of becoming global players.
  • Jakarta, Nov 15 (Xinhua) Finance ministers from across the world will hold a two day meeting in conjunction with the international conference on climate change next month in Indonesia's resort island of Bali. They will discuss financial issues and policies to address the concern of climate change, Indonesian Finance Minister Mulyani Indrawati said Thursday. The ministers will meet on Dec 10 11 to convince the governments of the respective countries to agree on a 'common objective on the financial issues of climate change', leading to a more appropriate policy for sustainable development and support for the global carbon trading market, the minister said. 'This is important because many developing countries are uneasy about the issue of climate change,' Indrawati was quoted by a local newspaper Jakarta Post as saying. 'For many countries that are trying to improve their economies with limited...<br><a href='http://blog-about-finance.com/news/11720'>http://blog-about-finance.com/</a>
  • As many as 10 huts at Appar Nagar, a fishing hamlet at Tiruvottiyur, were washed away by surging waves, while sea water entered about 200 houses, forcing residents to flee for safety. Nearly 14 fishing villages in Ennore, Tiruvottiyur, Kasimedu and Ernavur areas had been affected by the tidal waves. Fishermen stayed away from venturing into sea in view of the adverse weather condition. Fishermen said they had not seen such ferocious waves in the last eight years. "Not even when tsunami struck in 2004," they added. State Fisheries Minister K P Swamy, RDO Sangeetha and other officials rushed to the spot and studied the situation. Weather Office sources said alerts had been received from floating stations of the National Institute of Ocean Technology (NIOT) about high...<br><a href='http://best-sport-blog.com/news/11693'>http://best-sport-blog.com/</a>
  • As I look at people fishing or hunting, I see a lot of gray hair. Where is the next generation of stewards of the land? How well are adults passing on outdoor heritage? When I grew up in Detroit in the 1960s, most neighborhood kids were into hunting and fishing. Our parents took us camping, to local sportsmen clubs and area lakes, and taught us about the cycle of life and to be responsible and respectful...<br><a href='http://bloginfo4u.info/news/11696'>http://bloginfo4u.info/</a>
  • Hello! Good Site! Thanks you! cskevmwfbwe
  • 好东西啊。

  • 各位,同事们,新年快乐
  • 深~奥~接~滚~