-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_bash.aliases
119 lines (92 loc) · 3.09 KB
/
_bash.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#--------------------------------------------------------
# User specific aliases
#--------------------------------------------------------
#--------------------------------------------------------
# TODO
#--------------------------------------------------------
# Consider to use colorers:
# https://github.com/trapd00r/cope
# https://github.com/rrthomas/cw
# http://www.caliban.org/ruby/acoc.shtml
alias vi=vim
# DOS to UNIX (removing CRs on Linux based OS that use GNU extensions)
alias unix_eol="sed -i -e 's/\r$//'"
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
# TODO write a wrapper function for find
#alias find='find -print0'
#alias xargs='xargs -0'
alias ls='ls -G' # Compact view, show colors
alias la='ls -AF' # Compact view, show hidden
alias lla='ls++ -a'
alias ll='ls++'
alias l='ls'
alias l1='ls -1'
alias lh='ls++ -h'
alias ltr='ls++ -tr'
alias lrt=ltr
alias ls="ls --color=auto"
if [ `which colordiff 2>&1 | grep -q " no colordiff"; echo $?` -ge "1" ];
then alias diff='colordiff'
fi
alias tree='tree -C'
less='less -i' # ignore case
alias .='pwd'
alias ..='cd ..' # Go up one directory
alias ...='cd ../..' # Go up two directories
alias ....='cd ../../..' # Go up three directories
alias .4='cd ../../../../'
alias -- -='cd -' # Go back
# Shell History
#alias h='history'
# Undo what you just did in git
# Examples:
# * Asking for undo-ing advice.
# > git init
# > gitjk
# This created a .git folder in the current directory. You can remove it.
# sudo rm -r .git
# * Asking to fix it automatically
# >git add file.js
# >gitjk -f
# This added file.js to the changes staged for commit. All changes to file.js will
# be removed from
# staging for this commit, but remain saved in your file.
# Running... git rm -r --cached file.js
# Completed
alias gitjk="history 10 | tail -r | gitjk_cmd"
# Sends your file to the Gnome Wastebasket
#alias rm='gvfs-trash'
## pass options to free ##
alias meminfo='free -m -l -t'
## get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
# tree of processes for the $USER
alias my_pstree='ps f -u $USER'
## get top process eating cpu ##
alias pscpu='ps auxf | sort -nr -k 3'
alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
## Get server cpu info ##
alias cpuinfo='lscpu'
## Fixes zathura crash when opening entry in the index
alias zathura='env GTK_MODULES= /usr/bin/zathura'
alias open='xdg-open 2>/dev/null'
# docker
alias docker_stop='docker stop $(docker ps -q)'
alias docker_kill='docker kill $(docker ps -q)'
alias docker_rm='docker rm $(docker ps -a -q)'
alias 2epub='zip -rX "../$(basename "$(realpath .)").epub" mimetype $(ls|xargs echo|sed 's/mimetype//g')'
alias bc='bc -l'
alias path='echo -e ${PATH//:/\\n}'
alias now='date +"%T"'
alias nowtime=now
alias nowdate='date +"%d-%m-%Y"'
alias ports='netstat -tulanp'
# update on one command
#alias update='sudo apt-get update && sudo apt-get upgrade'
# distro specific - Debian / Ubuntu and friends #
# install with apt-get
#alias apt-get="sudo apt-get"
#alias updatey="sudo apt-get --yes"