红联Linux门户
Linux帮助

alias 保存位置。

发布时间:2012-05-04 11:42:00来源:红联作者:pzhu_ye
问题: 在2.6.18-128.el5,Red hat中,使用alias 结果如下+
alias cp='cp -i'
alias l.='ls -d .* --color=tty'
alias ll='ls -l --color=tty'
alias ls='ls --color=tty'
alias mv='mv -i'
alias rm='rm -i'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
在~/.bashrc中内容如下
# .bashrc

# User specific aliases and functions

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

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi


请问: 除了~./bashrc中的别名记录,其他的几条记录是保存在哪儿的呢?
文章评论

共有 4 条评论

  1. erqie 于 2012-05-05 13:11:15发表:

    建议在~/.bashrc中设定。

  2. 相思爱文 于 2012-05-04 14:26:44发表:

    系统启动,用户登录,都会自动加载运行配置文件。
    登录后,会运行的脚本,可用google搜索“bash shell 的设定档案
    系统设定值:/etc/profile、/etc/bashrc
    个人设定值:~/.bash_profile、~/.bashrc

    除了在配置文件中直接设置,还可以在配置文件中引用其他文件运行

  3. pzhu_ye 于 2012-05-04 14:07:22发表:

    求答复,本人新手,还望赐教

  4. 于 2012-05-04 12:31:33发表:

    /etc/profile