Browse Source

bash, aliases: cd=pushd

Maxim Likhachev 5 years ago
parent
commit
5c7924ff0f
  1. 37
      etc/shell/bash/aliases

37
etc/shell/bash/aliases

@ -6,16 +6,39 @@ @@ -6,16 +6,39 @@
alias aliases="alias | vcat -l sh"
alias ~='cd ~' #noindex
alias ..='cd ..' #noindex
alias .-='cd -' #noindex
#+ Строка прогресса:
#+ http://beatex.org/web/advancedcopy.html
#+ https://github.com/mrdrogdrog/advcpmv
# alias mv='mv -g -i -v' #noindex
# alias cp='cp -g -i -v -r' #noindex
#- Перемещение по директориям
function popd() {
local stack=$(dirs -v | wc -l)
if [ "$stack" -gt 1 ]; then
builtin popd
else
builtin cd -
fi
}
function pushd() {
if [ $# -eq 0 ]; then
builtin pushd "$HOME"
elif [ "$1" == "-" ]; then
builtin popd
else
builtin pushd "$1"
fi
}
alias cd='pushd' #noindex
alias .-='popd' #noindex
alias ~='cd ~' #noindex
alias ..='cd ..' #noindex
#- Удаление, перемещение и копирование с подтверждением
alias mv='mv -i -v' #noindex
alias cp='cp -i -v -r' #noindex
@ -38,7 +61,7 @@ alias ip='ip -color=auto' #noindex @@ -38,7 +61,7 @@ alias ip='ip -color=auto' #noindex
alias free="free -m" #noindex
alias wget='wget -c -T 5' #noindex
alias grep='grep -E -i --color=auto' #noindex
alias tree="tree -CAFa" #noindex
alias tree="tree -CF" #noindex
alias crontab_i="crontab $CRON" #noindex
alias crontab_e="$EDITOR $CRON" #noindex
alias dmenu="dmenu -fn '-*-fixed-*-*-*-*-15-*-*-*-*-*-*-*'" #noindex
@ -104,6 +127,10 @@ alias reloadx="xrdb -merge ~/.Xdefaults" #noindex @@ -104,6 +127,10 @@ alias reloadx="xrdb -merge ~/.Xdefaults" #noindex
#- Выход из сеанса
alias :q="exit" #noindex
# Редактирование предыдущей команды в vi, т.к.
# vi открывается быстрее (neo)vim
alias fc="fc -e vi"
# Другой способ: stat -c "%a %n" file(s)
#- ls с цифровым видом прав
function lls() {

Loading…
Cancel
Save