V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
alexapollo
V2EX  ›  程序员

交流点有用的 shell alias

  •  
  •   alexapollo ·
    geekan · 2014-12-26 22:30:33 +08:00 · 3639 次点击
    这是一个创建于 3415 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我先来:
    pin='pip install -i http://pypi.douban.com/simple'
    cd..='cd ..'
    cd...='cd ../..'
    cd....='cd ../../..'
    cd.....='cd ../../../..'
    gp='git push'
    gup='git pull --rebase'
    f='find . | grep --color'
    g='find . | xargs grep --color -n'
    m='make -j 8'

    20 条回复    2014-12-27 10:36:34 +08:00
    inkbxy
        1
    inkbxy  
       2014-12-26 22:33:25 +08:00
    怎么可以少了 rm='rm -i'
    Tink
        2
    Tink  
       2014-12-26 22:34:54 +08:00   ❤️ 4
    rm = rm -rf /
    ChiangDi
        3
    ChiangDi  
       2014-12-26 22:35:35 +08:00
    alias ... "cd ../../"
    alias .... "cd ../../../"
    alias ..... "cd ../../../../"
    alias rm "rm -i"
    alias cp "cp -i"
    alias mv "mv -i"
    alias s "subl"
    alias mux "tmuxinator"
    alias sl "ls"

    # git alias
    alias g "git"
    alias ga "git add"
    alias gc "git commit -v"
    alias gc! "git commit -v --amend"
    alias gp "git push"
    alias gcm "git checkout master"
    alias gst "git status"
    LazyZhu
        4
    LazyZhu  
       2014-12-26 22:38:20 +08:00
    cd 为啥还是两个点?
    推荐bash的pushd/popd,切换目录更方便
    viator42
        5
    viator42  
       2014-12-26 22:39:02 +08:00   ❤️ 1
    ll = ls -al
    没有这个简直没法过.
    fangpeishi
        6
    fangpeishi  
       2014-12-26 23:02:21 +08:00   ❤️ 1
    ffffwh
        7
    ffffwh  
       2014-12-26 23:03:55 +08:00
    alias emcas=emacs
    alias eamcs=emacs
    。。。
    vibbow
        8
    vibbow  
       2014-12-26 23:06:18 +08:00
    alias cls=clear
    vibbow
        9
    vibbow  
       2014-12-26 23:07:02 +08:00
    alias dir=ls -alt
    XiaoxiaoPu
        10
    XiaoxiaoPu  
       2014-12-26 23:14:43 +08:00
    alias r='echo -ne "\033c"'
    bingdian
        11
    bingdian  
       2014-12-26 23:18:47 +08:00   ❤️ 2
    alias server="open http://localhost:8000 && python -m SimpleHTTPServer "

    顺便再分享个 http://dotfiles.github.io/
    iptux
        12
    iptux  
       2014-12-26 23:27:41 +08:00
    razrlele
        13
    razrlele  
       2014-12-26 23:28:18 +08:00
    alias emacs="vim"
    veapon
        14
    veapon  
       2014-12-26 23:30:31 +08:00
    veapon
        15
    veapon  
       2014-12-26 23:31:24 +08:00   ❤️ 1
    saber000
        16
    saber000  
       2014-12-27 00:49:27 +08:00
    alias clr='printf "\ec"'
    ooxxcc
        17
    ooxxcc  
       2014-12-27 00:52:09 +08:00
    .gitconfig里面

    [alias]
    lg = log --all --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
    GeekGao
        18
    GeekGao  
       2014-12-27 02:09:00 +08:00
    alias site="curl -s -o /dev/null -w '%{http_code}'"
    zhujinliang
        19
    zhujinliang  
       2014-12-27 09:57:28 +08:00
    gohere="export GOPATH=`pwd`"
    reverland
        20
    reverland  
       2014-12-27 10:36:34 +08:00
    ~  type rot13
    rot13 is an alias for tr '[A-Za-z]' '[N-ZA-Mn-za-m]'


    ~  type rot13r
    rot13r is an alias for tr '[N-ZA-Mn-za-m]' '[A-Za-z]'
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   753 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:26 · PVG 05:26 · LAX 14:26 · JFK 17:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.