-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
87 lines (69 loc) · 3 KB
/
.aliases
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
81
82
83
84
85
86
87
# Dawid Ferenczy 2014
# http://github.com/ferenczy/dotfiles
# .aliases: Common aliases shared between shells
# safety, interactive operation...
alias rm='rm -I --preserve-root' # prompt before removing more than 3 files or recursive
alias cp='cp -i'
alias mv='mv -i'
alias ln='ln -i'
# forbid permissions change on /
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'
# default to human readable figures
alias df='df -h'
alias du='du -h'
alias duf='du -s *'
alias dud='du --max-depth=1'
# misc
alias less='less -r --LINE-NUMBERS' # raw control characters, show line numbers
alias whence='type -a' # where, of a sort
# enable color support
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias grep='grep --line-number --color=auto' # show differences in color and display line numbers
# convert GREP_OPTIONS environment variable to an alias and unset it since it's deprecated
if [[ -n ${GREP_OPTIONS+x} ]]; then
alias grep='grep $GREP_OPTIONS' # set GREP_OPTIONS as grep alias
unset GREP_OPTIONS
fi
alias egrep='egrep --color=auto' # show differences in color
alias fgrep='fgrep --color=auto' # show differences in color
alias ls='ls -hF --color=auto' # all listings in color, classified, human readable
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
# use colordiff as diff (requires colordiff installed)
if [ -x /usr/bin/colordiff ]; then
alias diff='colordiff'
fi
else
alias ls='ls -hF' # classified, human readable
fi
# some shortcuts for different directory listings
alias ll='ls -l' # long list
alias la='ls -lA' # long list, show almost all
alias lr='ls -tR' # sort by date, recursive
alias lt='ls -lt' # long list, sorted by date (newest first)
alias lart='ls -1cart' # sort by date (oldest first), show all
alias lrt='ls -1crt' # sort by date (oldest first)
alias ldot='ls -ld .*'
alias lS='ls -1Ss' # sort by size
# find
alias fd='find . -type d -name' # find directory
alias ff='find . -type f -name' # find file
# directory up shortcuts
alias ..='cd ../'
alias ...='cd ../../'
# format PATH
alias path='echo -e ${PATH//:/\\n}'
# calendar - defaults to print 3 months with week starting by Monday
alias cal='cal -3m'
# Git
alias gits='git status -s' # short status
alias gitd='git diff --color-words' # diff of unstaged changes
alias gitdc='gitd --cached' # diff of staged changes
# git log pretty
alias gitlp='git log --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%an>%Creset" --abbrev-commit --date=default'
alias gitls='gitlp --graph' # git log short (with graph)
alias gitl='gitlp --name-status' # git log with changed files
alias gitld='gitlp -p --color' # git log with diffs