通过添加到 .bash_profile 确保始终 运行 dnvm 和 dnu 命令

Making sure to always run the dnvm and dnu commands by adding to .bash_profile

我一直在跟随 Installing ASP.NET 5 and DNX post,但我被卡住了:

Tip: Add the following to your .bash_profile and restart the Terminal. The first line will ensure that you can always run the dnvm and dnu commands. The second line works around a known bug in Mono where you may see the IOException FileSystemWatcher has reached the maximum number of files to watch when running your application.

source dnvm.sh
export MONO_MANAGED_WATCHER=disabled

我的简单问题是:

.bash_profile 是一个位于 ~/ 的文件。您应该能够使用文本编辑器打开它并添加这些命令。

您也可以在终端中执行此操作。

echo 'source dnvm.sh' >> ~/.bash_profile
echo 'export MONO_MANAGED_WATCHER=disabled' >> ~/.bash_profile

这里发生的事情是您将一段文本 'source dnvm.sh' 附加到特定文件中。

echo 命令打印文本,>> 移位运算符将文本附加到 .bash_profile 位于 ~/ 的文件。