首页 > 解决方案 > 像第一次运行一样重置 cygwin 环境

问题描述

需要明确的是,我不是在谈论如何重置 cygwin 的终端字符。

我想要实现的是,如何将 cygwin 重新运行为 "First run"

背景:我不小心删除了我所有的主目录文件,所以所有配置文件都不见了。我希望 cygwin 再次为我重新生成/重新初始化它,就像它的“首次运行/重新开始”一样

谢谢

标签: initializationcygwinreset

解决方案


感谢@matzeri 的诀窍。这绝对有效!

所以,要像第一次运行一样重新初始化我的 cygwin,我要做的是:

username@computername ~
$ pwd
/home/username

username@computername ~
$ cd /home

username@computername ~
$ mv username username-old

username@computername ~
$ exit

退出所有 cygwin 终端,然后从开始菜单再次运行 cygwin。您将看到以下输出意味着您的配置文件已重新创建。

These files are for the users to personalise their cygwin experience.

They will never be overwritten nor automatically updated.

'./.bashrc' -> '/home/username//.bashrc'
'./.bash_profile' -> '/home/username//.bash_profile'
'./.inputrc' -> '/home/username//.inputrc'
'./.profile' -> '/home/username//.profile'

恢复我的工作数据:

username@computername ~
$ cd /home

username@computername ~
$ ls 
username   username-old

username@computername ~
$ mv username-old/mydata username/

推荐阅读