You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
2.6 KiB
94 lines
2.6 KiB
14 years ago
|
# The 'ls' family
|
||
|
# ------------------------------------------------------------------------------
|
||
14 years ago
|
if [[ "$DISABLE_COLOR" != 'true' ]]; then
|
||
|
if (( ${+commands[dircolors]} )); then
|
||
|
dircolors="${commands[dircolors]}"
|
||
|
fi
|
||
|
if (( ${+commands[gdircolors]} )); then
|
||
|
dircolors="${commands[gdircolors]}"
|
||
|
fi
|
||
|
if [[ -x "$dircolors" ]] && [[ -e "$HOME/.dir_colors" ]]; then
|
||
|
eval $("$dircolors" "$HOME/.dir_colors")
|
||
|
alias ls='ls -hF --group-directories-first --color=auto'
|
||
|
else
|
||
|
export CLICOLOR=1
|
||
|
export LSCOLORS="exfxcxdxbxegedabagacad"
|
||
|
alias ls='ls -G -F'
|
||
|
fi
|
||
|
fi
|
||
14 years ago
|
|
||
14 years ago
|
alias ll='ls -lh' # Show human readable.
|
||
|
alias la='ls -lhA' # Show hidden files.
|
||
|
alias lx='ls -lhXB' # Sort by extension.
|
||
|
alias lk='ls -lhSr' # Sort by size, biggest last.
|
||
|
alias lc='ls -lhtcr' # Sort by and show change time, most recent lasa.
|
||
|
alias lu='ls -lhtur' # Sort by and show access time, most recent last.
|
||
|
alias lt='ls -lhtr' # Sort by date, most recent last.
|
||
|
alias lm='ls -lha | more' # Pipe through 'more'.
|
||
|
alias lr='ls -lhR' # Recursive ls.
|
||
|
alias sl='ls' # I often screw this up.
|
||
14 years ago
|
|
||
|
# General
|
||
|
# ------------------------------------------------------------------------------
|
||
|
alias rm='nocorrect rm -i'
|
||
|
alias cp='nocorrect cp -i'
|
||
|
alias mv='nocorrect mv -i'
|
||
|
alias ln='nocorrect ln -i'
|
||
|
alias mkdir='nocorrect mkdir -p'
|
||
|
alias du='du -kh'
|
||
|
alias df='df -kh'
|
||
|
alias pu='pushd'
|
||
|
alias po='popd'
|
||
15 years ago
|
alias _='sudo'
|
||
14 years ago
|
alias e="$EDITOR"
|
||
|
alias history='fc -l 1'
|
||
|
alias get='curl -C - -O'
|
||
14 years ago
|
alias afind='ack -il'
|
||
14 years ago
|
alias type='type -a'
|
||
|
alias ssh='ssh -X'
|
||
|
alias print-path='echo -e ${PATH//:/\\n}'
|
||
14 years ago
|
alias t="t --task-dir ~/.tasks --list todo.txt --delete-if-empty"
|
||
15 years ago
|
|
||
14 years ago
|
if [[ -x "${commands[htop]}" ]]; then
|
||
|
alias top=htop
|
||
|
else
|
||
|
alias topm='top -o vsize'
|
||
|
alias topc='top -o cpu'
|
||
|
fi
|
||
15 years ago
|
|
||
14 years ago
|
if [[ "$DISABLE_COLOR" != 'true' ]]; then
|
||
|
if [[ -x "${commands[colordiff]}" ]]; then
|
||
|
alias diff='colordiff'
|
||
|
fi
|
||
|
|
||
|
if [[ -x "${commands[colormake]}" ]]; then
|
||
|
alias make='colormake'
|
||
|
fi
|
||
|
fi
|
||
15 years ago
|
|
||
14 years ago
|
# Terminal Multiplexer
|
||
14 years ago
|
# ------------------------------------------------------------------------------
|
||
14 years ago
|
local screenrc tmuxconf
|
||
|
if [[ "$TERM" == 'xterm-color' ]]; then
|
||
|
if [[ -e "$HOME/.screenrc" ]]; then
|
||
|
screenrc="-c '$HOME/.screenrc'"
|
||
|
tmuxconf="-f '$HOME/.tmux.conf'"
|
||
|
fi
|
||
|
fi
|
||
|
|
||
|
if [[ "$TERM" == 'xterm-256color' ]]; then
|
||
|
if [[ -e "$HOME/.screenrc256" ]]; then
|
||
|
screenrc="-c '$HOME/.screenrc256'"
|
||
|
tmuxconf="-f '$HOME/.tmux256.conf'"
|
||
|
fi
|
||
|
fi
|
||
|
|
||
14 years ago
|
alias screen="screen $screenrc"
|
||
|
alias sl="screen $screenrc -list"
|
||
|
alias sr="screen $screenrc -a -A -U -D -R"
|
||
|
alias S="screen $screenrc -U -S"
|
||
15 years ago
|
|
||
14 years ago
|
alias tmux="tmux $tmuxconf"
|
||
|
alias tls="tmux list-sessions"
|
||
14 years ago
|
|