linux配置文件_.bashrc

#by skange

#带保险的rm
alias rm='trash'
alias rl='trashlist'
alias ur='undelfile'
trash()
{ 
    mv $@ ~/.trash/ 
} 
#显示回收站中垃圾清单 
trashlist() 
{ 
    ls -alt ~/.trash 
} 
#找回回收站相应文件 
undelfile() 
{ 
    mv -i ~/.trash/$@ ./ 
} 
#清空回收站 
cleartrash() 
{ 
    echo -ne "Clear all files in ~/.trash, Sure?[y/n]" 
    read confirm 
    if [ $confirm == 'y' -o $confirm == 'Y'  ] ;then 
        /bin/rm -rf ~/.trash/* 
        /bin/rm -rf ~/.trash/.* 2>/dev/null 
    fi 
}

#现在最常用的文件夹
export J="/home/skange/code/haizeicourse/structure/"

#复制覆盖询问
alias cp='cp -i'

#移动覆盖询问
alias mv='mv -i'

#中英文man手册
alias eman='man -M /usr/share/man/'
alias man='man -M /usr/share/man/zh_CN/ '

#删除可执行文件
alias clearallx='mv -i `ls  -F | grep \* | cut -d \* -f 1 | grep -v ".sh" `  ~/.trash'

#cd默认路径
export CDPATH=.:~:~/code:~/code/haizeicourse/

#sh文件加可执行权限
alias vimsh='touchsh'
touchsh() 
{
    touch $1
    echo "#!/bim/bash" > $1 
    chmod u+x $1
    vim $1
}


#原生命令
alias nativerm='/bin/rm'

你可能感兴趣的:(linux,学习历程)