终端:Shell启动文件在哪里? [英] Terminal: Where is the shell start-up file?

查看:83
本文介绍了终端:Shell启动文件在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注一个名为以正确的方式启动Django 1.4项目,其中提供了有关如何使用virtualenv和virtualenvwrapper的指导.

I'm following a tutorial called Starting a Django 1.4 Project the Right Way, which gives directions on how to use virtualenv and virtualenvwrapper, among other things.

有一个部分显示为:

如果您使用pip来安装软件包(我不知道为什么不这样做),则只需安装后者就可以同时获得virtualenv和virtualenvwrapper.

If you're using pip to install packages (and I can't see why you wouldn't), you can get both virtualenv and virtualenvwrapper by simply installing the latter.

   $ pip install virtualenvwrapper

安装后,将以下行添加到Shell的启动文件(.zshrc,.bashrc,.profile等)中.

After it's installed, add the following lines to your shell's start-up file (.zshrc, .bashrc, .profile, etc).

   export WORKON_HOME=$HOME/.virtualenvs
   export PROJECT_HOME=$HOME/directory-you-do-development-in
   source /usr/local/bin/virtualenvwrapper.sh

重新加载启动文件(例如源.zshrc),就可以开始了.

Reload your start up file (e.g. source .zshrc) and you're ready to go.

我正在运行Mac OSX,但对终端的了解不深.作者shell's start-up file (.zshrc, .bashrc, .profile, etc)到底是什么意思?我在哪里可以找到此文件,以便可以添加这三行?

I am running Mac OSX, and don't know my way around the Terminal too well. What exactly does the author mean by shell's start-up file (.zshrc, .bashrc, .profile, etc)? Where do I find this file, so that I can add those three lines?

他还说reload your start up file (e.g. source .zshrc)是什么意思?

我希望能得到针对OSX的详细答复.

I would appreciate a detailed response, specific to OSX.

推荐答案

您可能正在使用bash,因此只需将这三行添加到~/.bash_profile:

You're probably using bash so just add these 3 lines to ~/.bash_profile:

$ cat >> ~/.bash_profile
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/directory-you-do-development-in
source /usr/local/bin/virtualenvwrapper.sh
^D

其中^D表示您键入 Control + D (EOF).

where ^D means you type Control+D (EOF).

然后关闭您的终端窗口并打开一个新窗口,或者您可以像这样重新加载"您的.bash_profile:

Then either close your terminal window and open a new one, or you can "reload" your .bash_profile like this:

$ source ~/.bash_profile

这篇关于终端:Shell启动文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆