summaryrefslogtreecommitdiffstats
path: root/bashrc/common/alias.sh
blob: a915ec367c9395c5d47eb97dddae20d1fc29480a (plain) (blame)
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
# command aliases

# ls helpers
alias ll="ls -l"
alias la="ls -la"
alias l="ls -lh"

# cd helpers
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."

# make default what should be default
alias sudo="sudo -H"

# mkdir + chdir
mkcd() {
	mkdir -p $1 && cd $1
}

# create tarball of one directory
mktar() {
	[[ -z "$1" ]] && return 1
	tar cjvf "${1%%/}.tar.bz2" "${1%%/}/"
}

# rar -> unrar
alias rar=unrar

unzip() {
	[[ ! -r "./${1}" ]] && return 1
	mkcd "${1%%.zip}" && /usr/bin/unzip "../${1}"
}