Skip to content

Instantly share code, notes, and snippets.

@reireias
Last active April 9, 2019 00:46
Show Gist options
  • Save reireias/109883d51e408cbf7189047fb3116945 to your computer and use it in GitHub Desktop.
Save reireias/109883d51e408cbf7189047fb3116945 to your computer and use it in GitHub Desktop.

ls系

alias ls='ls --color=auto'
alias ls='ls -G'
alias ll='ls -alF'
alias ll='ls -lh'
alias ll="ls -l"
alias la='ls -A'
alias la='ls -a'
alias l='ls -CF'

.系

alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'

alias ..2='cd ../..'
alias ..3='cd ../../..'

cd系

# よく利用するディレクトリの頭文字の連結
alias abc='cd ~/aaa/bbb/ccc'

# 'd'と言っても人それぞれ
alias d='cd ~/.dotfiles'
alias d='cd ~/Desktop'
alias d='cd ~/Documents/Dropbox'
alias d='cd ~/Dropbox'

git系

多い順に

alias g='git'
alias ga='git add'
alias gd='git diff'
alias gs='git status'
alias gp='git push'
alias gb='git branch'
alias gst='git status'
alias gco='git checkout'
alias gf='git fetch'
alias gc='git commit'

dotfiles関連

# 省略度合いも人それぞれ
alias d='/path/to/dotfiles'
alias dot='/path/to/dotfiles'
alias dotfiles='/path/to/dotfiles
# 編集系
alias zshrc='/path/to/dotfiles/.zshrc'
alias zshconfig='/path/to/dotfiles/.zshrc'

apt系

alias ag='sudo apt-get'
alias agi='sudo apt install'
alias agi='sudo apt-get install'
alias agr='sudo apt remove'
alias agr='sudo apt-get remove'
alias agu='sudo apt update'
alias agu='sudo apt-get update'

ちなみに、apt-getよりaptコマンドを利用したほうがよいです

bundle系

alias b='bundle'
alias be='bundle exec'
alias bx='bundle exec'
alias bi='bundle insyall'
alias bo='bundle outdated'
alias bu='bundle update'
alias rc='bundle exec rails c'

top系

# 人それぞれ
alias top='htop'
alias top='gtop'
alias top='vtop'
alias top='gotop'
# 別名
alias mem='top -o rsize'
alias cpu='top -o cpu'

安全策

-i(--interactive)オプションで上書き時には対話形式で質問する

alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'

その他

# うーん
alias _='sudo'

# オプションを覚えづらい場合はアリ?
alias allps='ps aux'

# カレントディレクトリのパスをクリップボードにコピー(cpwd, copypathなど)
alias pwdc='pwd | tr -d "\n" | pbcopy'

宗教戦争系

# 異教徒への攻撃
alias atom='code'
alias v='code'
alias emacs='vi'
# 熾烈なedit争い
alias ed='atom .'
alias ed='emacs --daemon'
alias ed='vim'
alias edit="emacs -nw"
alias edit='subl'
alias edit='subl3'
alias edit='vim'

1文字系

# a
alias a='alias'
alias a='ansible'
alias a='apt'
alias a='apt-get'
alias a='aptitude'
alias a='atom'

# b
alias b='brew'
alias b='bundle exec'
alias b='bundle'
alias b='bundler'
alias b='cd ..'
alias b='git branch'

# c
alias c='curl'
alias c='cd'
alias c='clear'
alias c='cat'
alias c='rails console'
alias c='pbcopy'

# d
alias d='cd ~/.dotfiles'
alias d='cd ~/Desktop'
alias d='cd ~/Documents && ls -a'
alias d='cd ~/Documents/Dropbox'
alias d='cd ~/Dropbox'
alias d='date +%Y%m%d'
alias d='docker'
alias d='du -h -d=1'
alias d='git diff'
alias d='less'
alias d='pwd'

# e
alias e='$EDITOR'
alias e='atom'
alias e='echo'
alias e='egrep'
alias e='emacs'
alias e='emacsclient'
alias e='exit'
alias e='vim'

# f
alias f='() { find -iname '*$1*' '${@:2}' }'
alias f='fdir.sh'
alias f='fg'
alias f='file'
alias f='find . -name'
alias f='find'
alias f='finger'
alias f='foreman'
alias f='fselect'
alias f='fuck'
alias f='open -a Finder ./'
alias f=fd
alias f=finger
alias g='be guard'
alias g='git '
alias g='git st'
alias g='git status -sb'
alias g='git status'
alias g='git'
alias g='go-makepkg-enhanced'
alias g='googleit'
alias g='googler'
alias g='grep --color=auto'
alias g='grep -F -n --color=auto'
alias g='grep'
alias g='k pkgbuild'
alias g='noglob git_wrapper' ; compdef g=git
alias g=/usr/local/bin/git
alias g=git
alias g=grep
alias h='cd ~ && ls -a'
alias h='cd ~'
alias h='fc -R'
alias h='fc -il 1 | tail -n 40'
alias h='git reset HEAD'
alias h='heroku'
alias h='history -fd -500'
alias h='history 0 | grep'
alias h='history | grep'
alias h='history'
alias h='history|awk '''''{$1=$2='';print substr($0,3)}''''''
alias h='hostname'
alias h='htop'
alias h='tldr'
alias h=heroku
alias h=history
alias i='git add -p'
alias i='image-upload'
alias i='sudo apt install --yes'
alias j='fasd_cd -d'
alias j='jfe --console'
alias j='jobs -l'
alias j='jobs'
alias j='jump'
alias j='k master'
alias j='z'
alias j=just
alias j=z
alias k=':sources:clone github.com:kovetskiy'
alias k='git-smart-checkout'
alias k='k -h'
alias k='kill -9'
alias k='kill'
alias k='kubectl'
alias k='kwrapper'
alias k='ls -lh'
alias k='tree -h'
alias k='tree'
alias k=kubectl
alias l=$LS
alias l='${PAGER:-less}'
alias l='${lsflag} -lAhF ${colorflag}'
alias l='/bin/ls -lFGhL --color=auto -I $LS_IGNORE'
alias l='/bin/ls -lahF'
alias l='LC_COLLATE=C \gls -lAh --color=auto --time-style='+%Y-%m-%d +%H:%M:%S' --group-directories-first'
alias l='clear && ll'
alias l='clear && ls'
alias l='command ls -l ${ls_options:+${ls_options[*]}}'
alias l='command ls -l'
alias l='exa --all --long --header --git'
alias l='exa --long --header --all'
alias l='exa -alh --group-directories-first'
alias l='exa -la --git --time-style=long-iso --group-directories-first'
alias l='exa -la --git --time-style=long-iso'
alias l='exa'
alias l='gls -lAh --color'
alias l='gls -lhF --color'
alias l='last'
alias l='less -R'
alias l='less'
alias l='ll'
alias l='locate -i'
alias l='locate -ir'
alias l='ls $LS_OPTIONS -lA'
alias l='ls $LS_OPTIONS'
alias l='ls - CF'
alias l='ls --color'
alias l='ls --color=auto'
alias l='ls --group-directories-first --time-style=long-iso -tAlh'
alias l='ls -1A --color=auto'
alias l='ls -1A'
alias l='ls -1F'
alias l='ls -AlhF --color=auto'
alias l='ls -CF --color'
alias l='ls -CF'
alias l='ls -FC'
alias l='ls -FGhg'
alias l='ls -FL'
alias l='ls -Fhg --color=auto --group-directories-first'
alias l='ls -Glah'
alias l='ls -Glh --group-directories-first'
alias l='ls -alF'
alias l='ls -alh --color=yes'
alias l='ls -alh'
alias l='ls -hl'
alias l='ls -hl' ; compdef l=ls
alias l='ls -l'
alias l='ls -lA --group-directories-first'
alias l='ls -lF ${colorflag}'
alias l='ls -lF --color=auto'
alias l='ls -lF'
alias l='ls -lFh ${colorflag}'
alias l='ls -lFh'
alias l='ls -la'
alias l='ls -lah --color'
alias l='ls -lah'
alias l='ls -lh --group-directories-first'
alias l='ls -lh'
alias l='ls -lhF ${colorflag}'
alias l='ls -lhF'
alias l='ls -lhG'
alias l='ls -lha --color=auto'
alias l='ls -vhFl --group-directories-first --time-style=+'
alias l='ls'
alias l=ls
alias m=':sources:clone github.com:seletskiy'
alias m=':vim-merge'
alias m='cd ~/Music && ls -a'
alias m='f -e vlc'
alias m='git checkout --ours'
alias m='make -j8'
alias m='make'
alias m='makepkg -f'
alias m='man'
alias m='mate'
alias m='mkdir'
alias m='more'
alias m='mosh'
alias m='mpv --loop=inf'
alias m='mpv'
alias m='mute'
alias m='neomutt'
alias m='rake db:migrate db:rollback && rake db:migrate db:test:prepare'
alias m=make
alias m=mux
alias m=mv
alias m=mvn
alias n='DISABLE_FILE_OPEN_ON_NAV=1 nnn -l -c 6'
alias n='PROJECT_NAME='' n'
alias n='git checkout -b'
alias n='nano'
alias n='nikola'
alias n='noglob'
alias n='npm run'
alias n='npm'
alias n='nvim'
alias n='sudo netctl'
alias n=node
alias n=nodejs
alias n=nvim
alias o='$SCRIPTS/open.sh'
alias o='a -e xdg-open'
alias o='git log --graph --all \
alias o='open .'
alias o='open'
alias o='open_command'
alias o='xdg-open '
alias o='xdg-open 2>/dev/null'
alias o='xdg-open'
alias o=open
alias p=' dirs -v | head -10'
alias p='_peco-select-project'
alias p='cd ~/Documents/projects'
alias p='cd ~/Dropbox/Projects'
alias p='cd ~/Pictures && ls -a'
alias p='cd ~/Projects'
alias p='git add -p'
alias p='git-smart-push seletskiy'
alias p='gopass'
alias p='pass'
alias p='pbpaste'
alias p='ping 8.8.8.8'
alias p='ping'
alias p='popd'
alias p='ps aux | rg -i'
alias p='ptpython'
alias p='pwd'
alias p='python'
alias p='python3'
alias p='sp play'
alias p=pacman
alias p=port
alias p=pushd pp=popd
alias q='exit'
alias q='git submodule update --init --recursive'
alias q='qlmanage -p'
alias q=exit
alias r=':sources:clone github.com:reconquest'
alias r='R --quiet'
alias r='builtin cd /'
alias r='cd / && ls -a'
alias r='git-smart-remote'
alias r='rails'
alias r='rake'
alias r='ranger'
alias r='rgrep'
alias r='rm -i'
alias r='rspec'
alias r='screen -D -R'
alias r='source ~/.bash_profile 2> /dev/null && source ~/.bashrc 2> /dev/null'
alias r='source ~/.zshrc'
alias r='u && p'
alias r=radian
alias r=rails
alias r=ranger
alias r=trash
alias s='cd ~/src'
alias s='git s'
alias s='git status -s'
alias s='git status'
alias s='ls'
alias s='netstat -tanpu'
alias s='open-with-sublime-text'
alias s='screen'
alias s='spring'
alias s='ssh -l root'
alias s='ssh'
alias s='stack'
alias s='subl'
alias s='sudo '
alias s='sudo -HE'
alias s='sudo su'
alias s='sudo'
alias s='svn'
alias s='sxiv -a -q&'
alias s=screen
alias s=ssh
alias s=sudo
alias t='() { c '$@' && p ; }'
alias t='cd ~/src/terkel'
alias t='date +'%H%M%S''
alias t='ghi show -w $(ghi list --sort updated | grep -v 'open issue' | fgrep -v 'None.' | peco | awk '{ print $1 }')'
alias t='git checkout --theirs'
alias t='gittower'
alias t='phpunit --exclude-group slow'
alias t='task'
alias t='telnet'
alias t='terraform'
alias t='tig --all'
alias t='tig'
alias t='tmux -2'
alias t='tmux attach || tmux new -s Master'
alias t='tmux attach'
alias t='tmux new-session -A -s main'
alias t='tmux'
alias t='tree -C'
alias t='tree -Cfh'
alias t='tree -I 'node_modules''
alias t='tree -a --ignore '.git|node_modules|bower_components|.DS_Store' -l 3'
alias t=task
alias t=time
alias t=tmux
alias u='..'
alias u='carcosa -Sn'
alias u='cd .. && ls'
alias u='cd ..'
alias u='exec usb-shell'
alias u='git-smart-pull --rebase'
alias u='sudo -iu'
alias u='yaourt -Syu --aur'
alias v='$EDITOR'
alias v='$VISUAL'
alias v='$i'
alias v='code'
alias v='f -e $EDITOR'
alias v='f -e vim'
alias v='mvim'
alias v='nvim '
alias v='nvim --listen /tmp/nvimsocket'
alias v='nvim'
alias v='open-with-vim'
alias v='vagrant '
alias v='vagrant'
alias v='vi'
alias v='vim '
alias v='vim -R -'
alias v='vim'
alias v=e
alias v=nvim
alias v=vagrant
alias v=view
alias v=vim
alias w='/usr/bin/w -i'
alias w='echo -e '$Blue $PWD ${Red}at ${Cyan}$(whoami)${Red}@${Yellow}$(hostname -s)$Red in $Yellow${0}$Purple \$''
alias w='git diff --cached'
alias w='grc --colour=auto w'
alias x=' exit'
alias x=':context:command magalix'
alias x='_peco-find-and-open-file'
alias x='cd $HOME && startx && cd -'
alias x='exec startx'
alias x='exit'
alias x='gitx'
alias x='ranger'
alias x='screen -A -x'
alias x='startx'
alias x=/mnt/c/Windows/explorer.exe
alias x=exit
alias x=startx
alias y=''
alias y='git show'
alias y='yarn'
alias y=yaourt
alias z='exec /bin/zsh -l'
alias z='zathura --fork'
alias z='zathura'
alias z=_z_cd

番外編

global alias

zshの機能 aliasはコマンドの先頭でしか働かないが、-gオプション付きで定義すると、コマンドの途中でも展開される パイプ等でよく呼び出すコマンドで利用する TODO

suffix alias

zshの機能 コマンドの末尾を見てよろしくやってくれる TODO

所感

aws系は少ない

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment