ll命令无法使用
2011-11-16 19:10
225 查看
因为之前执行过:echo 'export HISTTIMEFORMAT="%F %T `whoami` "' > /etc/profile
谁知到 导致/etc/profile中的文件内容全没了,只剩下导入的这条:
export HISTTIMEFORMAT="%F %T `whoami` "
记录如下:
[root@lvs2 ~]# history >1.txt
[root@lvs2 ~]# ll
-bash: ll: command not found
[root@lvs2 ~]# ls
1.txt install.log keepalived-1.2.2 network-conf
anaconda-ks.cfg install.log.syslog keepalived-1.2.2.tar.gz
[root@lvs2 ~]# vi /etc/profile
# /etc/profile
# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
# It's NOT good idea to change this file unless you know what you
# are doing. Much better way is to create custom.sh shell script in
# /etc/profile.d/ to make custom changes to environment. This will
# prevent need for merging in future updates.
pathmunge () {
case ":${PATH}:" in
*:"$1":*)
;;
*)
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
esac
}
if [ -x /usr/bin/id ]; then
if [ -z "$EUID" ]; then
# ksh workaround
EUID=`id -u`
UID=`id -ru`
fi
USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
fi
# Path manipulation
if [ "$EUID" = "0" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
else
pathmunge /usr/local/sbin after
pathmunge /usr/sbin after
pathmunge /sbin after
fi
HOSTNAME=`/bin/hostname 2>/dev/null`
HISTSIZE=1000
if [ "$HISTCONTROL" = "ignorespace" ] ; then
export HISTCONTROL=ignoreboth
else
export HISTCONTROL=ignoredups
fi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
if [ "$PS1" ]; then
. $i
else
. $i >/dev/null 2>&1
fi
fi
done
unset i
unset pathmunge
LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
export HISTTIMEFORMAT="%F %T `whoami` "
"/etc/profile" 74L, 1568C written
[root@lvs2 ~]# ll
-bash: ll: command not found
[root@lvs2 ~]# source /etc/profile
[root@lvs2 ~]# ll
婊绋?288
-rw-r--r-- 1 root root 16860 11?16 19:01 1.txt
-rw-------. 1 root root 1334 11?12 13:05 anaconda-ks.cfg
-rw-r--r--. 1 root root 7934 11?12 13:05 install.log
-rw-r--r--. 1 root root 2964 11?12 13:04 install.log.syslog
drwxr-xr-x 7 1000 1000 4096 11?12 16:22 keepalived-1.2.2
-rw-r--r-- 1 root root 249557 1?17 2011 keepalived-1.2.2.tar.gz
drwxr-xr-x 2 root root 4096 11?12 15:15 network-conf
[root@lvs2 ~]#
本文出自 “虫子的博客” 博客,请务必保留此出处http://xlogin.blog.51cto.com/3473583/716310
谁知到 导致/etc/profile中的文件内容全没了,只剩下导入的这条:
export HISTTIMEFORMAT="%F %T `whoami` "
记录如下:
[root@lvs2 ~]# history >1.txt
[root@lvs2 ~]# ll
-bash: ll: command not found
[root@lvs2 ~]# ls
1.txt install.log keepalived-1.2.2 network-conf
anaconda-ks.cfg install.log.syslog keepalived-1.2.2.tar.gz
[root@lvs2 ~]# vi /etc/profile
# /etc/profile
# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
# It's NOT good idea to change this file unless you know what you
# are doing. Much better way is to create custom.sh shell script in
# /etc/profile.d/ to make custom changes to environment. This will
# prevent need for merging in future updates.
pathmunge () {
case ":${PATH}:" in
*:"$1":*)
;;
*)
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
esac
}
if [ -x /usr/bin/id ]; then
if [ -z "$EUID" ]; then
# ksh workaround
EUID=`id -u`
UID=`id -ru`
fi
USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
fi
# Path manipulation
if [ "$EUID" = "0" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
else
pathmunge /usr/local/sbin after
pathmunge /usr/sbin after
pathmunge /sbin after
fi
HOSTNAME=`/bin/hostname 2>/dev/null`
HISTSIZE=1000
if [ "$HISTCONTROL" = "ignorespace" ] ; then
export HISTCONTROL=ignoreboth
else
export HISTCONTROL=ignoredups
fi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
if [ "$PS1" ]; then
. $i
else
. $i >/dev/null 2>&1
fi
fi
done
unset i
unset pathmunge
LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
export HISTTIMEFORMAT="%F %T `whoami` "
"/etc/profile" 74L, 1568C written
[root@lvs2 ~]# ll
-bash: ll: command not found
[root@lvs2 ~]# source /etc/profile
[root@lvs2 ~]# ll
婊绋?288
-rw-r--r-- 1 root root 16860 11?16 19:01 1.txt
-rw-------. 1 root root 1334 11?12 13:05 anaconda-ks.cfg
-rw-r--r--. 1 root root 7934 11?12 13:05 install.log
-rw-r--r--. 1 root root 2964 11?12 13:04 install.log.syslog
drwxr-xr-x 7 1000 1000 4096 11?12 16:22 keepalived-1.2.2
-rw-r--r-- 1 root root 249557 1?17 2011 keepalived-1.2.2.tar.gz
drwxr-xr-x 2 root root 4096 11?12 15:15 network-conf
[root@lvs2 ~]#
本文出自 “虫子的博客” 博客,请务必保留此出处http://xlogin.blog.51cto.com/3473583/716310
相关文章推荐
- linux服务器上使用ftp命令可以登录,但是vsftpd无法登录
- zipalign命令无法使用的问题
- CentOS 7无法使用ifconfig命令修复
- 解决profile 无修改导致命令无法使用的方法
- 解决kali linux中无法使用RPM命令
- 无法使用命令/usr/bin/xdpyinfo自动检查显示器颜色
- FLEX 应用---无法使用MXMLC命令解决方案
- 虚拟机装的linux,打开终端后无法使用ifconfig命令查看ip地址
- mac terminal下无法使用 at 命令 - unix/linux
- linux创建新用户后shell无法自动补全命令或使用基本的shell命令
- Mac 下配置环境变量造成命令行命令无法使用的解决方法
- CentOS 7 - 最小化安装后,解决无法使用yum命令问题
- 配置完jdk环境变量后无法使用系统命令
- linux as6.3安装Oracle11g:“无法使用命令/usr/bin/xdpyinfo自动检查显示器颜色”
- linux 环境下使用shutdown.sh命令无法关闭tomcat 进程
- bashrc文件中环境变量配置错误,导致linux命令无法正常使用的解决方案
- pyhton 27 pip命令无法使用 没有Scripts文件夹 的解决方法
- Linux系统命令无法使用
- java在linux系统下开机启动无法使用sudo命令的原因
- 解决无法使用locate命令的方法