事实证明,这可能更简单。可以在启动mc之前将MC_HOME变量设置为备用路径。手册页不是您可以立即找到答案的东西=)
运作方式如下:-一般方式
[jsmith@wstation5 ~]$ mc -F
Root directory: /home/jsmith
[System data]
<skipped>
[User data]
Config directory: /home/jsmith/.config/mc/
Data directory: /home/jsmith/.local/share/mc/
skins: /home/jsmith/.local/share/mc/skins/
extfs.d: /home/jsmith/.local/share/mc/extfs.d/
fish: /home/jsmith/.local/share/mc/fish/
mcedit macros: /home/jsmith/.local/share/mc/mc.macros
mcedit external macros: /home/jsmith/.local/share/mc/mcedit/macros.d/macro.*
Cache directory: /home/jsmith/.cache/mc/
以及另一种方式:
[jsmith@wstation5 ~]$ MC_HOME=/tmp/MCHOME mc -F
Root directory: /tmp/MCHOME
[System data]
<skipped>
[User data]
Config directory: /tmp/MCHOME/.config/mc/
Data directory: /tmp/MCHOME/.local/share/mc/
skins: /tmp/MCHOME/.local/share/mc/skins/
extfs.d: /tmp/MCHOME/.local/share/mc/extfs.d/
fish: /tmp/MCHOME/.local/share/mc/fish/
mcedit macros: /tmp/MCHOME/.local/share/mc/mc.macros
mcedit external macros: /tmp/MCHOME/.local/share/mc/mcedit/macros.d/macro.*
Cache directory: /tmp/MCHOME/.cache/mc/
此功能的用例:
您必须在远程服务器上共享相同的用户名(可以通过rsa键取消访问),并且想要使用自己喜欢的mc配置而不覆盖它。并发会话不会互相干扰。
这是https://github.com/Russell91/sshrc中描述的sshrc方法的一部分,效果很好