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
du -sh ./* | sort -nr |
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
touch $(date +%Y-%m-%d-%H-%M).bak |
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
git log --reverse | |
# show branch tag etc | |
git log --reverse --decorate |
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
tree -aF |
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
# カレントディレクトリのディレクトリのみ表示 | |
ls -aF | grep -E '[^\.]+/$' |
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
# bash | |
# <と(の間はスペースが入らない | |
diff <(command1) <(command2) | |
# bash以外 | |
command1 | ( command2 | diff /dev/fd/3 -) 3<&0 |
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
# マッチした最初の文字を置換 | |
cat hoge.txt | ruby -pe '$_.sub!("hoge", "fuge")' > fuge.txt | |
# マッチした全ての文字を置換 | |
cat hoge.txt | ruby -pe '$_.gsub!("hoge", "fuge")' > fuge.txt |
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
var c = {name: 'hoge'}; | |
(function() {this.echo = function() {console.log(this);};}).call(c); | |
c.echo(); |
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
$ ls | ruby -nle '$_.scan(/\d{8}/) {|m| File.rename(m, m.sub(/(\d{4})(\d{2})(\d{2})/) {"#{$1}_#{$2}_#{$3}"})}' |
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
$ psql dbname -U username -F ',' -A -c 'select * from users limit 10' |