系统自动屏蔽了vi/cp/rm等命令,并且按下TAB键后自动补全功能无法使用
第一步:
/usr/bin/vi ~/.bashrc
用#注释掉如下内容(Esc后i编辑),然后Esc后:wq!保存退出
#if [[ "$0" == "-bash" ]]; then
#alias rm='echo "-bash: rm: command not found"'
#alias rpm='echo "-bash: rpm: command not found"'
#alias which='echo "-bash: which: command not found"'
#alias grep='echo "-bash: grep: command not found"'
#alias mv='echo "-bash: mv: command not found"'
#alias vi='echo "-bash: vi: command not found"'
#alias vim='echo "-bash: vim: command not found"'
#alias ps='echo "-bash: ps: command not found"'
#alias top='echo "-bash: top: command not found"'
#alias bash='echo "-bash: bash: command not found"'
#alias sh='echo "-bash: sh: command not found"'
#alias find='echo "-bash: find: command not found"'
#alias yum='echo "-bash: yum: command not found"'
#alias dd='echo "-bash: dd: command not found"'
#alias chmod='echo "-bash: chmod: command not found"'
#fi
第二步:
/usr/bin/vi ~/.inputrc
或者做完第一步后直接vi ~/.inputrc
on改为off,修改完成后,exit或logout重新登录即可使用tab自动补全功能。
set disable-completion off
echo 'export HISTSIZE= 65535' >> ~/.bashrc
echo 'export HISTFILESIZE=65535' >> ~/.bashrc
export HISTSIZE= 65535
export HISTFILESIZE=65535
sudo sed -i 's/ on$/ off/' ~/.inputrc
sudo cat > .bashrc <<EOF
alias ln='ln -i'
alias grep='grep -ir --exclude-dir={dev,proc,sys} --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias ..='cd ..'
alias ...='cd ../../..'
alias ....='cd ../../../..'
alias .....='cd ../../../..'
alias .2='cd ../..'
alias .3='cd ../../..'
alias .4='cd ../../../..'
alias .5='cd ../../../../..'
alias cd..='cd ..'
alias mkdir='mkdir -pv'
alias now='date "+%Y-%m-%d %H:%M:%S.%s"'
alias ports='netstat -tulaonp'
alias du1='du -h -d 1'
alias du2='du -h -d 2'
alias du3='du -h -d 3'
alias meminfo='free -h -l -t'
alias cpuinfo='lscpu'
alias tf='tail -f '
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
enable -n alias
EOF
(0)
grep的alias写得有问题,更正如下:
export HISTSIZE= 65535
export HISTFILESIZE=65535
sudo sed -i 's/ on$/ off/' ~/.inputrc
sudo cat > .bashrc <<EOF
alias ln='ln -i'
alias grepir='grep -ir --exclude-dir={dev,proc,sys} --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias ..='cd ..'
alias ...='cd ../../..'
alias ....='cd ../../../..'
alias .....='cd ../../../..'
alias .2='cd ../..'
alias .3='cd ../../..'
alias .4='cd ../../../..'
alias .5='cd ../../../../..'
alias cd..='cd ..'
alias mkdir='mkdir -pv'
alias now='date "+%Y-%m-%d %H:%M:%S.%s"'
alias ports='netstat -tulaonp'
alias du1='du -h -d 1'
alias du2='du -h -d 2'
alias du3='du -h -d 3'
alias meminfo='free -h -l -t'
alias cpuinfo='lscpu'
alias tf='tail -f '
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
enable -n alias
export HISTSIZE= 65535
export HISTFILESIZE=65535 EOF
(0)
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作