Skip to content

Commit 8b81a1c

Browse files
committed
🔨 chore: updated git-bash aliases
1 parent b0b554f commit 8b81a1c

File tree

1 file changed

+35
-11
lines changed

1 file changed

+35
-11
lines changed

config/bash/.bash_aliases

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,41 @@
1-
# general aliases
2-
alias reload="exec $SHELL -l"
1+
# clear
32
alias c='clear'
3+
alias cls='clear'
4+
5+
# exit
6+
alias q='exit'
7+
alias quit='exit'
48

59
alias cp='cp -i'
610
alias mv='mv -i'
711
alias ln='ln -i'
812
alias rm='rm -i'
913
alias mkdir='mkdir -p'
14+
15+
# list declared aliases, functions, paths
16+
alias aliases="alias | sed 's/=.*//'"
17+
alias functions="declare -f | grep '^[a-z].* ()' | sed 's/{$//'"
1018
alias paths='echo $PATH | tr ":" "\n"'
1119

20+
# reload shell
1221
alias reload='exec $SHELL -l'
1322

14-
mkcd() {
15-
mkdir "$@" && cd "$@" || exit
16-
}
23+
# clear history
24+
alias hist-clr='echo "" > ~/.bash_history'
1725

1826
# common locations
1927
alias dotf="cd $DOTFILES"
20-
alias docs="cd $USERPROFILE/Documents"
21-
alias desktop="cd $USERPROFILE/Desktop"
22-
alias downloads="cd $USERPROFILE/Downloads"
23-
alias home="cd $USERPROFILE"
28+
alias docs="cd ~/Documents"
29+
alias desktop="cd ~/Desktop"
30+
alias downloads="cd ~/Downloads"
31+
32+
# disk usage
33+
alias dux='du -x --max-depth=1 | sort -n'
34+
alias dud='du -d 1 -h'
35+
alias duf='du -sh *'
36+
37+
# ip address
38+
alias ip="curl -s ipinfo.io | jq -r '.ip'"
2439

2540
# chmod:
2641
# Stolen from: - https://github.com/ohmybash/oh-my-bash/blob/master/aliases/chmod.aliases.sh
@@ -53,7 +68,16 @@ else
5368
alias lm='ls -al | more'
5469
alias ll='ls -lAFh'
5570
alias la='ls -Al'
71+
fi
72+
73+
# lr: Full Recursive Directory Listing
74+
alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\'' | less'
5675

57-
# lr: Full Recursive Directory Listing
58-
alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\'' | less'
76+
# urlencode / urldecode
77+
if command -v node >/dev/null 2>&1; then
78+
alias urlencode='node -e "console.log(encodeURIComponent(process.argv[1]))"'
79+
alias urldecode='node -e "console.log(decodeURIComponent(process.argv[1]))"'
80+
else
81+
alias urlencode='python3 -c "import sys; del sys.path[0]; import urllib.parse as up; print(up.quote_plus(sys.argv[1]))"'
82+
alias urldecode='python3 -c "import sys; del sys.path[0]; import urllib.parse as up; print(up.unquote_plus(sys.argv[1]))"'
5983
fi

0 commit comments

Comments
 (0)