.bash_profile 类似于编程中的构造函数,当登录shell时,shell会寻找该文件做环境初始化。
.bashrc 是.bash_profile的替补。
.bash_logout 类似于编程中的析构函数,当登录shell退出时,shell会寻找该文件,并按其指示办事。
.bash_profile文件
.bash_profile是
原创
2013-03-22 17:35:55
1012阅读
目录.bash_history.bash_logout.bash_profile.bashrc每个用户的根目录下都有四个这样的 bash文件,他们是隐藏文件,需要使用-a参数才会显示出来.bash_history...
原创
2022-07-18 16:51:35
100阅读
一 、此次漏洞分析1 nginx HTTP/2漏洞[nginx-announce] nginx安全公告(CVE-2018-16843,CVE-2018-16844)在nginx HTTP / 2实现中发现了两个安全问题,漏洞对服务器的影响: 可能会导致过多的内存消耗(CVE-2018-16843)和CPU使用率(CVE-2018-16844)。影响范围: 这些问题会影响使用ngx_http_v2_
转载
2024-05-09 23:38:19
1011阅读
目录.bash_history.bash_logout.bash_profile.bashrc每个用户的根目
转载
2021-11-12 11:11:40
808阅读
最简单的例子 —— Hello World!几乎所有的讲解编程的书给读者的第一个例子都是 Hello World 程序,那么我们今天也就从这个例子出发,来逐步了解 BASH。用 vi 编辑器编辑一个 hello 文件如下:#!/bin/bash# This is a very simple exampleecho Hello World这样最简单的一个 BASH 程序就编写完了。这里有
转载
精选
2008-07-29 10:44:19
4672阅读
系统应该是Alpine Linux LXD(Linux容器),那么入股在其中安装 bash shell呢apk updateapk upgradeapk add bash# 安装 bash 文档apk add bash-doc# 安装 bash 自动命令补全apk add bash-completion# 使用 bash 作为 shellbash# 需要从主机登录到 Alpine Linux LXD 虚拟机,比如我从kubernets进去kubectl exec -it .
原创
2021-06-17 12:25:10
2633阅读
系统应该是Alpine Linux LXD(Linux容器),那么入股在其中安装 bash shell呢apk updateapk upgradeapk add bash# 安装 bash 文档apk add bash-doc# 安装 bash 自动命令补全apk add bash-completion# 使用 bash 作为
原创
2022-03-10 10:33:40
1795阅读
Author: Daniel Robbins ([email]drobbins@gentoo.org[/email]), 总裁兼 CEO, Gentoo Technologies, Inc.
Bash $ echo $myvar
foo
我们希望回显 "fooThis is my environment variable!bar",但却不是这样。错在哪里?简单地说,bash
转载
2007-10-15 14:57:49
659阅读
bash
转载
精选
2015-08-20 14:14:51
684阅读
其实编辑完bash脚本后,可以用过bash -n -x 两个选项进行脚本检查,不一定非要运行程序的时候才发现需要修改脚本。bash不仅有运行脚本的意思。没有消息就是好消息。我现在稍微修改下原来的脚本-n的效果我现在演示不出来,之前是可以直接指出语法错误的这个是之前的效果。-x 可以将指令和输出内容区分 -v不可以-x 和 -v都是细致化的命令调试工具,他们
原创
2018-03-23 23:15:00
976阅读
点赞
We can create a single folder by doing: If we want to create nested folder we need to add '-p' flag: It creates three folders 'a', 'b', 'c'.
转载
2018-10-12 17:55:00
482阅读
2评论
本文为Bash Scripting Full Course 3 Hours学习笔记 (此基础上补充)(base) lighthouse@VM-8-2-ubuntu:~$ cat /etc/shells # 所有可用shell
# /etc/shells: valid login shells
/bin/sh
/bin/bash
/usr/bin/bash
/bin/rbash
/usr/bin/
转载
2023-12-11 20:49:00
79阅读
前些时候看有人定义Bash函数时,用return返回自定义的数值,1表示是,0表示否,这是用对其他语言函数的理解来定义Bash函数,这种思路在Bash里是有问题的。 下面用一个例子来给说明这种方法会碰上什么问题。定义一个简单的函数,如果输入字符串的长度大于等于8返回1,否则返回0。 function validate() {
if [ ${#1} -ge 8 ]; then
转载
2024-03-19 17:01:23
165阅读
CTRL 键相关的快捷键:
Ctrl + w - 删除最后输入的单词
Ctrl + a
Ctrl + e
Ctrl + b
Ctrl + f
Ctrl + d
Ctrl + h
Ctrl + u
Ctrl + k
Ctrl + r
Ctrl + l
Ctrl + c
Ctrl + z, jobs, bg, fg
ALT 键相关的快捷键:
平
转载
精选
2011-05-27 18:16:20
768阅读
CentOS6yum update bash--Version bash-4.1.2-15.el6_5.2.x86_64CentOS5 x86-64wget http://mirrors.aliyun.com/centos/5/updates/x86_64/RPMS/bash-3.2-33.el5_10.4.x86_64.rpm && rpm -
原创
2014-09-28 08:40:25
1226阅读
Bash脚本基础 BASH = GNU Bourne-Again Shell,BASH 是 GNU 组织开发和推广的一个项目。Bash脚本类似批处理,简单来讲就是把许多的指令集合在一起,并提供循
原创
2017-06-15 20:32:16
590阅读
bash中命令介绍
原创
2017-10-27 18:02:51
590阅读
Bash shell 的算术运算有四种方式:1:使用 expr 外部程式加法 r=`expr 4 + 5`echo $r注意! '4' '+' '5' 这三者之间要有空白r=`expr 4 * 5` #错误乘法 r=`expr 4 \* 5`2:使用 $(( ))r=$(( 4 + 5 ))echo...
转载
2014-04-17 17:15:00
227阅读
bash n xxx.sh 检查脚本的语法格式, bash x xxxx.sh 显示脚本的执行顺序
转载
2019-10-22 08:20:00
589阅读
2评论
Knowing how conditionals work in bash open up a world of scripting possibilities. We’ll learn the basic syntax, including if, else, and elif. Then we'
转载
2021-02-09 03:04:00
606阅读
2评论