Linux Bash 总结 1. Bash 概念 主要有 4 种 shell 语言,Bash 是其中一种。四种 shell 分别是: - bash (Bourne Again SHell) - csh (C SHell) - ksh (KornSHell) - zsh 2. Bash 变量 定义变量 1 2 VAR="Hello World" VAR=123 注意:"=" 前后不要有空格 使用变量 1 2 $VAR ${VAR} ...
HISTFILE:持久保存命令历史的文件,当退出登录的时候,此次的命令历史才会被写入到HISTFILE中 [root@localhost dev]#echo$HISTFILE/root/.bash_history [root@localhost dev]#cat/root/.bash_history ss-tnlifconfigvi/etc/sysconfig/network-scripts/ifcfg-ens33 reboot systemctl stop firewalld systemctl disable fire...
例如,在bash提示符下输入CTRL-R会进入反向搜索模式(按ESC键退出)。 2.17 File Modes and Permissions(文件模式和权限) Every Unix file has a set of permissions that determine whether you can read, write, or run the file. Running ls -l displays the permissions. Here’s an example of such a disp...
/ root directory 5、# Comment or Trim Strings(注释符号或修剪字符串) 5.1、注释(comment) 多数情况下,您使用符号(#),在终端中或者shell脚本中注释相关内容,该内容将被bash shell忽视 ,但是这并不是被真正的忽视,而是被存在你命令历史当中,我们可以通过history名令进行查看。 zsh history 5.2 也可以使用#符号,...
#123123[root@xie-02grep]# grep'r.o'passwd//. 表示任意一个字符,就是把符合r与o之间有一个任意字符的行打印出来root:x:0:0:root:/root:/bin/bashoperator:x:11:0:operator:/root:/sbin/nologin[root@xie-02grep]# grep'ooo*'passwd//‘ooo*’ 表示oo, ooo, oooo ... 或者更多的 ‘o’root...
-bash: test: >=: binary operator expected 可以看到,test 1 '>' 2命令返回 1,判断结果正确。 这其实是一个判断字符串的条件表达式。 而test 1 '>=' 2命令则执行报错,因为判断字符串的条件表达式不支持>=这个操作符。 同样也不支持<=操作符。
2.操作系统(Operator System) 概念 任何计算机系统都包含一个基本的程序集合,称为操作系统 (OS) 。笼统的理解,操作系统包括: 内核(进程管理,内存管理,文件管理,驱动管理) 其他程序(例如函数库, shell 程序等等) 设计OS的目的 与硬件交互,管理所有的软硬件资源 ...
MODE可以分成如下3块: [who] operator [permission] [ugoa]*([-+=]([rwxXst]*|[ugo]))+ who的含义是: u 属主权限 g 属组权限 o 其它用户权限 a 所有用户(all 表示所有,缺省就是all) operator的含义: + 增加权限 - 取消权限 = 设定权限 ...
-bash: test: Permission denied [wangshibo@ops-server4 ~]$ vim test [wangshibo@ops-server4 ~]$ ll total 4 -rw-r--r--. 1 wangshibo wangshibo 15 Dec 3 10:48 test [wangshibo@ops-server4 ~]$ cat test 123456 wangshibo 三、chattr隐藏权限,这个很重要!通常用于锁定文件 ...
-l 2 $ cat /tmp/passwd.tmp root:x:0:0:root:/root:/bin/bash operator:x:11:0:operator:/...