Skip to content

Commit 2543500

Browse files
committed
docs(tool): add note about the differences between profile and bashrc
1 parent ef2dd1b commit 2543500

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

shell/linux.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,15 @@ awk '/keywords/{print $5,$6}' access_log* | head -10 // 查找包含keywords的
154154
> 65535怎么来的
155155
计算机是按照二进制储存数据的,一般用 unsigned int 这种数据类型来储存正整数
156156
在计算机中,每个整数都是用 16 位 2 进制数来表示的,所以最大的数就是 16 个 1,也就是 11111111 11111111
157-
把二进制数 11111111 11111111 转化位十进制数就是 65535
157+
把二进制数 11111111 11111111 转化位十进制数就是 65535
158+
159+
> Linux下profile和bashrc区别
160+
1. /etc/profile
161+
用来设置系统环境参数,比如$PATH. 这里面的环境变量是对系统内所有用户生效的。
162+
2. /etc/bashrc
163+
这个文件设置系统bash shell相关的东西,对系统内所有用户生效。只要用户运行bash命令,那么这里面的东西就在起作用。
164+
3. ~/.bash_profile
165+
用来设置一些环境变量,功能和/etc/profile 类似,但是这个是针对用户来设定的,也就是说,你在/home/user1/.bash_profile 中设定了环境变量,那么这个环境变量只针对 user1 这个用户生效.
166+
4. ~/.bashrc
167+
作用类似于/etc/bashrc, 只是针对用户自己而言,不对其他用户生效。
168+
另外/etc/profile中设定的变量(全局)的可以作用于任何用户,而~/.bashrc等中设定的变量(局部)只能继承/etc/profile中的变量,他们是”父子”关系.

tool/maven.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ tar -zxvf apache-maven-3.5.3-bin.tar.gz /usr/local/
33
vi ~/.bashrc
44
export M2_HOME=/usr/local/apache-maven-3.5.3
55
export PATH=${M2_HOME}/bin:$PATH
6-
6+
source ~/.bashrc
7+
mvn -v
78
### 添加阿里镜像
89
找到.m2/settings.xml文件
910

0 commit comments

Comments
 (0)