像第一次运行一样重置cygwin环境

时间:2018-11-19 16:50:24

标签: initialization cygwin reset

要清楚,我不是在谈论如何重置cygwin的终端字符。

我想实现的是,如何将cygwin重新运行为“首次运行”

背景:我不小心删除了所有主目录文件,因此所有配置文件都消失了。 我希望cygwin为我重新生成/重新初始化它,例如它的“首次运行/重新开始”

谢谢

1 个答案:

答案 0 :(得分:0)

感谢@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/