在Mac的哪里可以找到bashrc文件? [英] Where do I find the bashrc file on Mac?

查看:3340
本文介绍了在Mac的哪里可以找到bashrc文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在关注页面.我的Mac,以便可以设置Django / Eclipse开发环境.
但是我不太确定如何执行此步骤:

Hello I am following this page.. I'm installing Python onto my mac so that I can set up a Django / Eclipse development environment.
However I am not too sure how to go about executing this step:

  • 该脚本将说明它将进行哪些更改并提示您 在安装开始之前.
  • 一旦您安装了Homebrew, 将Homebrew目录插入PATH环境变量的顶部.
  • 您可以通过在您的底部添加以下行来执行此操作 〜/.bashrc文件

  • The script will explain what changes it will make and prompt you before the installation begins.
  • Once you’ve installed Homebrew, insert the Homebrew directory at the top of your PATH environment variable.
  • You can do this by adding the following line at the bottom of your ~/.bashrc file

导出PATH =/usr/local/bin:$ PATH

export PATH=/usr/local/bin:$PATH

在Mac上的哪里可以找到bashrc文件,在哪里可以找到自制目录?

Where do I find the bashrc file on my mac and where do I find the homebrew directory?

我正在使用OS 10.8.5运行macbook专业版.

I am running a macbook pro with OS 10.8.5.

推荐答案

.bashrc文件位于您的主目录中.

The .bashrc file is in your home directory.

因此从命令行执行:

cd
ls -a

这将显示主目录中的所有隐藏文件. "cd"将带您回家,而ls -a将列出所有".

This will show all the hidden files in your home directory. "cd" will get you home and ls -a will "list all".

通常,当您看到〜/时,tilda斜杠指的是您的主目录.因此〜/.bashrc是包含.bashrc文件的主目录.

In general when you see ~/ the tilda slash refers to your home directory. So ~/.bashrc is your home directory with the .bashrc file.

Homebrew的标准路径在/usr/local/中,因此,如果您:

And the standard path to homebrew is in /usr/local/ so if you:

cd /usr/local
ls | grep -i homebrew

您应该看到homebrew目录(/usr/local/homebrew). 来源

you should see the homebrew directory (/usr/local/homebrew). Source

是的,有时可能需要创建此文件,.bashrc文件的典型格式为:

Yes sometimes you may have to create this file and the typical format of a .bashrc file is:

# .bashrc

# User specific aliases and functions
. .alias
alias ducks='du -cks * | sort -rn | head -15'

# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

PATH=$PATH:/home/username/bin:/usr/local/homebrew
export PATH

如果您创建自己的.bashrc文件,请确保以下行位于〜/.bash_profile中

If you create your own .bashrc file make sure that the following line is in your ~/.bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

这篇关于在Mac的哪里可以找到bashrc文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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