- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
背景
我是一名前端 Web 开发人员,我已经开始尽可能地转向 PortableApps;至少对于我在构建机器并不得不多次重新安装 Windows 后使用的台式机 (Windows)。
将命令行与构建自动化工具、使用 CLI 测试软件等结合使用变得越来越重要。
我刚刚从我的 Dropbox 获得了 Git (Bash) 和 ConEmu 的便携版本(但理想情况下这也可以通过 USB 运行)。这意味着我可以使用 Git 在 Windows 上访问 Unix shell,但是我保存的 .bash_profile(和 .bashrc)我需要手动复制到我使用的每台机器的“~”(主)目录。
问题
有没有一种方法可以将我的可移植控制台与 不位于所用每台机器上用户主目录中的 bash 文件链接起来?
例如,当我的控制台打开并查找这些文件时,我可以要求它检查不同的目录而不在每台机器上设置任何配置吗?然后让 .bash_history 也保存在这里?
最佳答案
您可以为 .bash_profile
和 .bashrc
使用符号链接(symbolic link):
ln -s /path/to/.bashrc ~/.bashrc
ln -s /path/to/.bash_profile ~/.bash_profile
在您的 .bashrc
中,您可以定义 history file is located 的位置:
export HISTFILE=/path/to/.bash_history
我认为没有任何方法可以将 .bashrc
和 .bash_profile
放在您的主目录中。除非您使用 --rcfile
选项启动 bash:
bash --rcfile /path/to/.bashrc
还有位于 /etc/bashrc
的系统范围文件。
关于Shell (Bash) - 我可以拥有完全可移植的 .bash_profile/.bashrc/.bash_history 文件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37735200/
我经常查看我的 .bash_history 文件,看看我是如何运行程序的,或者我使用了哪些参数。问题是我的历史似乎很不完整。我会发现一些命令是我几个月前运行的,而另一些我昨天运行过但不存在。我认为问题
我使用 bash,有时我不得不为某些任务输入一些很长的命令。这些长命令不经常使用,并且在我再次使用它们时通常会在 .bash_history 文件中被覆盖。如何将某些命令永久添加到 .bash_his
您好,我正在尝试使用以下命令查看我的终端历史记录: subl .bash_history 但是当我打开 .bash_history 文件时,它看起来像这样: 2d2a 0a73 7564 6f20 6
我的代码: #include #include #include int main(void) { printf("entering main process---\n"); i
我有时会在 linux 终端中错误地输入我的 su 密码,该终端会回显输入的字符。它被记录在 ~/.bash_history 中,这让我感到不安全。有没有人有一个简短的脚本(bash one-line
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
有没有办法与 docker 容器共享 .bash_history 卷,这样每次我进入 shell 时,我的 bash 历史记录都可以滚动浏览? 如果能用 IPython 做同样的事情,那就太棒了。 最
问题 我有一个 Python 脚本,当我从命令行运行它时,我不想在 .bash_history 中记录任何内容。 这是因为脚本使用了 Python argparse 库,它允许我直接从命令行将参数传递
我知道如何记录我在 ~/.bash_history 中输入的每条命令: export PROMPT_COMMAND="history -a" 我的问题是,应用上述技巧后,如何避免长度小于5的命令被写入
我在亚马逊的 aws EC2 上有一个 linux box。我可以在这里查看用户的 bash_history: /home/ec2-user/.bash_history 但是当我 root 时: su
我想尽可能多地获取我的 bash 命令历史记录,我发现 ./bash_history 只包含最近的两千行,这是否意味着之前的那些永远丢失了?有没有办法把它取回来。 非常感谢。罗伊987 最佳答案 恐怕
最近我决定从 zsh 转移到 bash shell。有没有办法快速将我的 .zsh_history 文件转换为 .bash_history 文件? .zsh_history 片段 : 14469941
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
tmux 是否支持将在“C-b :”模式下键入的命令保存到文件中?我宁愿浏览我已经输入的命令,也不愿在手册页中查找每个命令。 最佳答案 history-file 选项可以满足您的需求。 history
我有适用于 Windows 版本的可移植 Git,并从不同机器上的 USB 内存棒运行它。我注意到当我使用 Git Bash 时,它会将 bash 历史记录保存在默认用户文件夹中,即 C:/Users
我刚刚重新安装了 MacOS (OSX 10.12),当我重做我的 IDE 时,我得到了这个奇怪的 bash_history stats 对象,它会打印到每个新的终端窗口!它让我发疯,在查看了所有首选
背景 我是一名前端 Web 开发人员,我已经开始尽可能地转向 PortableApps;至少对于我在构建机器并不得不多次重新安装 Windows 后使用的台式机 (Windows)。 将命令行与构建自
我想知道是否有一种方法可以“模仿”linux .bash_history。它会是这样的: def write_history(cmd): try: with open("/root/.pyth
我正在使用 os.system() 从我的 ubuntu 机器上调用一些 openssl 命令。我在行中指定密码,所以它看起来像: //python code os.system("openssl e
我正在使用 Windows 版 Git(版本 1.7.8-preview20111206),即使我的 HOME 文件夹中有一个 .bash_history 文件,它也不会自动更新。当我启动 Git B
我是一名优秀的程序员,十分优秀!