比如在进行cd之后,自动进行ls操作
1、在终端中打开用户首页(cd ~)
2、编辑.bashrc
补充以下内容:
cd()
{
builtin cd "$@" && ls
}
退出保存: wq
3、重载: source .bashrc