常用的alias

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

alias -- -='cd -'
alias ..='func() { S=$1; if [[ ! -n "$S" ]]; then cd ..; else cd ../$S; fi }; func'
alias ...='func() { S=$1; if [[ ! -n "$S" ]]; then cd ../..; else cd ../../$S; fi }; func'
alias ....='func() { S=$1; if [[ ! -n "$S" ]]; then cd ../../..; else cd ../../../$S; fi }; func'
alias cdf='func() { N=$1; if [[ ! -n "$N" ]]; then N=1; fi; cd `ls -1dh */ | head -n $N | tail -1`; }; func'
alias cdl='func() { N=$1; if [[ ! -n "$N" ]]; then N=1; fi; cd `ls -1dh */ | tail -n $N | head -1`; }; func'
alias ll='ls -alh'
alias l='ls -1'
alias p='func() { S=$1; if [[ ! -n "$S" ]]; then pwd; else echo `pwd`/$S; fi }; func'
posted @ 2022-11-22 10:56  DeviLeo  阅读(21)  评论(0编辑  收藏  举报