坚持开放的别名和宏

发布于 2025-01-31 11:30:32 字数 142 浏览 2 评论 0原文

在OpenStack“ Shell”模式下使用OpenStack客户端时,我非常想念常见任务的别名。我看到您可以添加带有“ Alias Add ...”或“ Macro Add ...”的别名或宏。但是,在外壳会话之间,这些别名并不持续。 有一些文件可以配置这些文件吗?

When using the OpenStack client in the openstack "shell" mode, I miss aliases for common tasks a lot. I see that you can add aliases or macros with "alias add ..." or "macro add ...". However the aliases are not persisted between shell sessions.
Is there some file where I can configure those ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

早乙女 2025-02-07 11:30:32

您可以在/etc/profile 〜/.bashrc 和其他文件中设置持续的别名,并在 /etc/profile.d/中设置其他文件。

  • /etc/profile :为所有用户设置
  • 〜/.bashrc :为当前用户设置为是用户$ home < /code>目录
  • /etc/profile.d/:在/etc/profile显示时,目录将
if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

在更新之后重新登录时,目录将生效。文件。

You could set persisted alias in /etc/profile or ~/.bashrc and others file in /etc/profile.d/.

  • /etc/profile: set for all users
  • ~/.bashrc: set for current user as ~ is the user $HOME directory
  • /etc/profile.d/: where directory will be imported as /etc/profile shows:
if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

All this method take effect when you re login after update these files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文