Home  >  Q&A  >  body text

linux - 说说你觉得最狂霸酷炫屌炸天的命令

比如:

pwd | pbcopy

mac下是拷贝当前路径到黏贴板

最好写上注释, 对于没有注释的新手们不要乱试啊,乖,出问题了踩答案啊,为毛踩我的问题,看我开的头多好的,没想到楼歪这么厉害.....真是的, 看来TDD还没死,同志们请用你们的大脑编译器跑一下下面这个测试,跑挂了的请自觉修过测试:

def 狂霸酷炫 = (yourCommands) => {
    yourCommands.forEach((command) => {
        assert(command().userReaction).not.contains("草")
        assert(command().userReaction).contains("Woww")
    })
}

Ref: stackoverflow

高洛峰高洛峰2745 days ago1434

reply all(40)I'll reply

  • 迷茫

    迷茫2017-04-17 11:49:43

    adb root,sudo su。

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 11:49:43

    Get external network ip curl ifconfig.me

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 11:49:43

    You are all bad people!

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 11:49:43

    真的是狂欢呀。 If there is any tool worth recommending, I think the multiplexer tmux is worth owning

    reply
    0
  • 黄舟

    黄舟2017-04-17 11:49:43

    cp target{,.bak}  # 将target备份成target.bak
    
    ^old^new  # 将上一条命令中第一个old字符串替换成new后重新执行
    
    Ctrl - l  # 清屏
    
    Ctrl - r  # 搜索历史命令
    

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 11:49:43

    Some additions to @lidashuang’s answer on the 1st floor,

    !! 表示上一次命令
    !$ 表示上一次命令的最后一个参数
    

    For example, if you use vi to open nginx, the default configuration is mistakenly written as cd:

    cd /etc/nginx/sites-enabled/default
    

    Change to vi <改>

    vi !$
    

    reply
    0
  • 阿神

    阿神2017-04-17 11:49:43

    Don’t try it! ! ! ! ! ! ! !

    Please see here:
    The tragedy caused by a space

    For example:
    rm -rf /tmp/lib/nvidia-current/xorg/xorg

    There is also a coder’s pseudo code on how to express loneliness on Valentine’s Day:

    while !stackOverflow 
        push()
        pop()
    end
    

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 11:49:43

    Add one more: ctrl-x e
    Rapidly invoke an editor to write a long, complex, or tricky command

    From: http://www.commandlinefu.com/

    reply
    0
  • 阿神

    阿神2017-04-17 11:49:43

    dd if=/dev/null of=/dev/sda

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 11:49:43

    yes ppg
    

    reply
    0
  • Cancelreply