尝试理解bash文件设置/结构

p5cysglq  于 2021-05-27  发布在  Hadoop
关注(0)|答案(1)|浏览(365)

这是对前面提出的问题的扩展:哪些常见的hdfs命令可以Map到bash文件中?
我注意到最初提供给我的.bashrc和.bash\u概要文件与您提供的略有不同。这是可以的还是其他的模式?
开始时复制的文件如下:

.bashrc
.bash_profile

bashrc先生

source /etc/bashrc 

...and a lot of other folder mappings

.bash\u配置文件


# .bash_profile

# Get the aliases and functions

# if [ -f ~/.bashrc ]; then

# .    ~/.bashrc

# fi

source ~/.bashrc

我按照您的建议创建了.bash别名文件。
.bash\u别名

alias h="hdfs dfs"

我已经修改了 .bashrc 文件如下
.bashrc-已修改

source /etc/bashrc 

...and a lot of other folder mappings

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi
yiytaume

yiytaume1#

这个 .bashrc 代码将在新shell启动之前执行。其中的代码并不重要,只要它是有效的bash。
其他文件(bash\u别名)仅用于将不同文件中的命令分开。
本文对此进行了很好的解释:https://ss64.com/bash/syntax-bashrc.html
所以回答你的问题,它不会引起任何问题。重要的是它的做法让你满意。

相关问题