-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_aliases
executable file
·56 lines (47 loc) · 1.1 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
# Functions
# Faster than doing cd ../../..
function up() {
times=$1
while [ "$times" -gt "0" ]; do
cd ..
times=$(($times -1))
done
}
# For the bash prompt
function nonzero_return() {
[ $? -ne 0 ] && echo "[$?]"
}
# Improve basic commands
alias ln='ln -iv'
alias cp='cp -iv'
alias mv='mv -iv'
alias rm='rm -iv'
alias mkdir='mkdir -pv'
alias rmdir='rmdir -v'
alias ls='ls --color --group-directories-first'
alias la='ls -lAGh --color --group-directories-first'
alias grep='grep --color'
# Clear terminal faster
alias clear='tput clear'
# Retry last command with sudo
alias please='sudo !!'
# Config editing
alias bashrc='vim $HOME/.bashrc && source $HOME/.bashrc'
alias bashalias='vim $HOME/.bash_aliases && source $HOME/.bash_aliases'
# Aptitude
alias apt='sudo apt'
alias aptar='apt autoremove'
alias apti='apt install'
alias aptr='apt remove'
alias aptu='apt update'
alias aptup='apt upgrade'
# Git
alias ga='git add'
alias gc='git commit'
alias gd='git diff'
alias gpu='git push'
alias gpl='git pull'
alias gs='git status'
alias gl='git log'
# Random
alias cowtune='fortune | cowsay -f $(shuf -n -e ~/.cows/*)'