Last active
October 18, 2016 08:10
-
-
Save acro5piano/94df651492a68617347ebb1d48f36588 to your computer and use it in GitHub Desktop.
Bash/Zshで、個人的に有用だと思っているエイリアス ref: http://qiita.com/acro5piano/items/a9a1d04b280114b55b7a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias sum="awk '{a+=\$1}END{print a}'" | |
# 使い方 | |
% seq 1 10 | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
% seq 1 10 | sum | |
55 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ave="awk '{a+=\$1}END{print a/NR}'" | |
# 使い方 | |
% seq 1 10 | ave | |
5.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias cl='xsel -ib' | |
alias clp='xsel -ob' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to_dos(){ | |
iconv -f utf8 -t sjis | perl -pe 's/\n/\r\n/' < /dev/stdin | |
} | |
# 使い方 | |
% echo あ | to_dos | |
Ƃ͉ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias now='date +%Y%m%d_%H%M%S' | |
alias glook='cd $(ghq root)/$(ghq list | peco)' | |
alias ycal='cal `date +%Y`' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment