Linux下bash的一些总结
关于“.bash_profile”和“.bashrc”区别的总结
更新操作
- 打开terminal(终端)
- cd ~ ( 进入当前用户的home目录)
- open .bash_profile (打开.bash_profile文件,如果文件不存在就 创建文件:touch .bash_profile 编辑文件:open -e bash_profile)
- 直接更改弹出的.bash_profile文件内容
- command + s 保存文件,然后关闭
- 在terminal(终端)中输入 source .bash_profile (使用刚才更新之后的内容)
其他
/etc/profile: 此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行.并从/etc/profile.d目录的配置文件中搜集shell的设置. /etc/bashrc: 为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取. ~/.bash_profile: 每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件. ~/.bashrc: 该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该该文件被读取. ~/.bash_logout: 当每次退出系统(退出bash shell)时,执行该文件. 另外,/etc/profile中设定的变量(全局)的可以作用于任何用户,而~/.bashrc等中设定的变量(局部)只能继承/etc/profile中的变量,他们是"父子"关系.
文件 范围 触发节点 备注 /etc/profile 全员 第一次登陆 每次更新需要source /etc/bashrc 全员 每次打开shell ~/.bash_profile 个人 第一次登陆 每次更新需要source ~/.bashrc 个人 每次打开shell ~/.bash_login 个人 每次登陆shell ~/.bash_logout 个人 每次登出shell PS:/.bash_profile读取/.bashrc...
Linux下bash的一些总结的更多相关文章
- Linux下Bash入门学习笔记
学习好shell编程是很有用的,可以使用shell脚本轻巧地完成有趣的工作. 本文地址:http://www.cnblogs.com/yhLinux/p/4047516.html 1. Bash实例, ...
- Linux下Bash shell学习笔记
原文地址: http://www.cnblogs.com/NickQ/p/8870423.html 1.shell下没有变量类型和定义的概念. 变量直接使用不用定义 所有值都视为字符串. 在对变量取值 ...
- Linux 下 Bash配置文件读取
Linux安装时可能要修改的配置文件:/etc/profile./etc/bashrc(ubuntu没有这个文件,对应地,其有/etc/bash.bashrc文件.我用的是ubuntu系统,所以下面将 ...
- linux下bash脚本语法
1.shell中的变量定义和引用(1)变量定义和初始化.shell是弱类型语言(语言中的变量如果有明确的类型则属于强类型语言:变量没有明确类型就是弱类型语言),和C语言不同.在shell编程中定义变量 ...
- Linux下bash: scp: command not found问题 或者装ssh包时报错 Requires: libedit.so.0()(64bit)
一.用scp命令从物理主机向CentOS 6.1虚拟机传送文件,提示以下错误:bash: scp: command not found到CentOS 6.1虚拟机查看也缺少scp命令.该虚拟机 ...
- Linux 下 -bash: mysql: command not found解决办法
-bash: mysql: command not found 1.vim ~/.bash_profile 最下面写 export PATH=$PATH:/usr/local/mysql/bin(你的 ...
- Linux下bash的快捷键
Ctrl + A :切换到命令行开始 Ctrl + E :切换到命令行末尾 Ctrl + L : 清屏,相当于clear Ctrl + U :清除剪切光标前的内容 Ctrl + K :剪切清除光标后 ...
- Linux 下 Bash 脚本对拍
背会... #!/bin/bash i= while true ;do ./maker > data.in ./a <data.in> data.out ./b <data.i ...
- Linux下-bash: Permission denied 或者 sudo: command not found 错误
有时候执行一个脚本或者运行一个可执行文件时,如执行脚本./foo.sh,会报错-bash: ./foo.sh: Permission denied,你会再试sudo ./foo.sh,发现继续报错su ...
随机推荐
- day 29
Let the dead have the immortality of fame, but the living the immortality of love. 让逝者拥有不朽的荣誉,让生者拥有不 ...
- thinkphp5.0学习(九):TP5.0视图和模板
原文地址:http://blog.csdn.net/fight_tianer/article/details/78602711 一.视图 1.加载页面 1.继承系统控制器类 return $this- ...
- spring cloud gateway网关启动报错:No qualifying bean of type 'org.springframework.web.reactive.DispatcherHandler'
网关配置好后启动报错如下: org.springframework.context.ApplicationContextException: Unable to start web server; n ...
- BeanCreationException: Error creating bean with name 'classPathFileSystemWatcher'之解决办法
错误关键信息: BeanCreationException: Error creating bean with name 'classPathFileSystemWatcher' 错误原因:Idea不 ...
- Scala 准引用 - Quasiquote介绍
Quasiquotes are a neat notation that lets you manipulate Scala syntax trees with ease: scala> val ...
- Python【每日一问】38
问: 基础题: 设计一个经营杠杆系数函数DOL,它包含三个参数,S为营业收入,C为变动成本总额,F为固定成本的总额. 已知2018年的S为20,C为11,F为3,求2019年的经营杠杆系数. 提高题: ...
- snap应用多版本卸载
Ubuntu18.04新增了几个内置软件使用Snap格式.同样的沙箱式处理方式,除了Canonical主推的Snap,还有Fedora的Flatpak和AppImage.一般正常使用没问题,就是第一次 ...
- python--unittest测试框架
unittest中最核心的四个概念是:test case, test suite, test runner, test fixture
- Kafka学习笔记之Kafka背景及架构介绍
0x00 概述 本文介绍了Kafka的创建背景,设计目标,使用消息系统的优势以及目前流行的消息系统对比.并介绍了Kafka的架构,Producer消息路由,Consumer Group以及由其实现的不 ...
- 匿名方法是怎样演变到Lambda表达试过程
一. "Lambda 表达式"(lambda expression)是一个匿名函数,Lambda表达式基于数学中的λ演算得名,直接对应于其中的lambda抽象(lambda ab ...