-
Notifications
You must be signed in to change notification settings - Fork 1
/
_bash_aliases
30 lines (25 loc) · 1.23 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
alias chat="LANGUAGE=en:fr xchat > /dev/null 2>&1"
# Reapeat the previous command with command under sudo
alias !!!="sudo !!"
# Work around an LXC limitation
# https://github.com/lxc/lxd/issues/936
alias lxc-tmux="script -qfc tmux /dev/null"
# dircolors... make sure that we have a color terminal, dircolors exists, and ls supports it.
if $TERM_IS_COLOR && ( dircolors --help && ls --color ) &> /dev/null; then
# For some reason, the unixs machines need me to use $HOME instead of ~
# List files from highest priority to lowest. As soon as the loop finds one that works, it will exit.
for POSSIBLE_DIR_COLORS in "$HOME/.dir_colors" "/etc/DIR_COLORS"; do
[[ -f "$POSSIBLE_DIR_COLORS" ]] && [[ -r "$POSSIBLE_DIR_COLORS" ]] && eval `dircolors -b "$POSSIBLE_DIR_COLORS"` && break
done
alias ls="ls --color=auto"
alias ll="ls --color=auto -l"
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
else
# No color, so put a slash at the end of directory names, etc. to differentiate.
alias ls="ls -F"
alias ll="ls -lF"
fi
# pwdgen provides some random strings that could be used for password
alias pwdgen="head -c 1000 /dev/urandom | tr -dc 'a-zA-Z0-9~,;!@#$%^&*_-' | fold -w20 | head -10"