Linux 创建一个基本的 .bashrc 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9349108/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 04:40:03  来源:igfitidea点击:

Create a basic .bashrc file

linuxbashshellterminallinux-mint

提问by Lynob

I don't have .bashrcfile, I want to create one but how? And what does a basic .bashrcfile contains? I am on Linux Mint 12

我没有.bashrc文件,我想创建一个,但如何创建?基本.bashrc文件包含什么?我在Linux Mint 12 上

I want to have a .bashrcfile, because i have created a folder for virtualenvand I want to load virtualenvwrapper

我想要一个.bashrc文件,因为我已经创建了一个文件夹virtualenv,我想加载virtualenvwrapper

采纳答案by sverre

A .bashrcfile contains whatever default settings you want to use when you are using bash. If you don't have any particular preferences then leave it blank for now.

一个.bashrc文件包含您在使用bash. 如果您没有任何特别的偏好,那么暂时将其留空。

Typical contents of a .bashrc file includes aliases of commands you find yourself using a lot.

.bashrc 文件的典型内容包括您经常使用的命令的别名。

回答by ThiefMaster

Why do you want one if you don't know what to put in there? You only need a .bashrc(or .profileor .bash_profile) if you actually have something you want to execute in every shell (or login shell).

如果你不知道在那里放什么,你为什么想要一个?如果您确实想要在每个 shell(或登录 shell)中执行某些操作,则只需要一个.bashrc(or .profileor .bash_profile)。

But you can basically put any bash commands in those files.

但是您基本上可以将任何 bash 命令放在这些文件中。