Shell 是一个用 C 语言编写的程序,它是用户使用 Linux 的桥梁。Shell 既是一种命令语言,又是一种程序设计语言。Shell 是指一种应用程序,这个应用程序提供了一个界面,用户通过这个界面访问操作系统内核的服务。Ken Thompson 的 sh 是第一种 Unix Shell,Windows Explorer 是一个典型的图形界面 Shell。
1、问题 [root@localhost home]# yum install httpd Loaded plugins: langpacks, product-id, subscription-ma
1、查看当前系统: [root@rhel8 home]# cat /etc/redhat-release Red Hat Enterprise Linux release 8.3 (Ootpa) [r
1、测试1 [root@centos7 test2]# for ((i=1; i<=5; i++)); do echo "100"; done 100 100 100 100
1、基本shell脚本 #!/bin/bash command 2、参数的变量 $0:脚本名称 $#:参数的数目 $*:参数 $1:第一个参数 $2:第二个参数 $3:第三个参数 $?:上一条命令执行
1、for语句 [root@centos7 test2]# cat test.sh #!/bin/bash sum=0 for i in `seq $1` do let sum+=$i done ec
1、和 [root@centos7 test]# cat a.txt 3 8 9 4 2 4 8 1 9 8 4 2 8 5 3 2 [root@centos7 test]# sed -n '
1、测试1 [root@centos7 test2]# ls a.txt [root@centos7 test2]# if [ -e a.txt ]; then echo "exist&qu
1、测试1 [root@centos7 test2]# cat test.sh #!/bin/bash read -p "please input an character: "
linux系统中sort命令。 1、测试数据 [root@centos7 test2]# cat a.txt google 110 5000 baidu 100 5000 guge 50 3000 s
1、while语句 #include <stdio.h> int main(void) { int i = 2, j; puts("please input an integer
linux shell脚本中流程控制语句 if、for、while、case 1、if语句 [root@centos7 test2]# ls test.sh [root@centos7 test2]#
1、测试数据 [root@centos7 test3]# cat b.txt e t s e s g m x w d g i d t e g x g e w 2、打印匹配w的行 [root@cento
1、 [root@centos7 test]# ls a.txt [root@centos7 test]# cat a.txt i e s m u w e i p q x z u n k e c b
1、测试1 [root@centos7 test2]# i=0 [root@centos7 test2]# max=5 [root@centos7 test2]# while((i<max));
1、read从键盘读入 [root@centos7 test]# echo $a [root@centos7 test]# read a 123456 [root@centos7 test]# ech
1、测试数据,测试1 [root@centos7 test2]# seq -f %02g 10 > a.txt [root@centos7 test2]# ls a.txt [root@cent
1、测试for cat [root@PC3 test]# cat a.txt 01 02 03 06 07 08 11 12 13 16 17 18 [root@PC3 test]# for i in
1、测试数据 [root@PC3 test]# cat a.txt e i e s d e t q s g e g 2、 [root@PC3 test]# cat a.txt e i e s d e
linux系统中条件测试语句分为4类: 1、文件测试语句 2、逻辑测试语句 3、整数值比较语句 4、字符串比较语句 一、文件测试语句 -e :是否存在 -f :是否为文件 -d:是否为目录文件 -r:
1、隐藏光标 echo -e "\033[?25l" 2、显示光标 echo -e "\033[?25h" 来源:https://blog.csdn.net/w
1、测试数据 测试1 [root@centos7 test2]# cat a.txt 01 02 03 04 05 06 07 08 09 10 2、测试2 [root@centos7 test2]#
1、测试1 求1-100的和 [root@centos7 test2]# cat test.sh #!/bin/bash sum=0 a=1 while [ $a -le 100 ] do let s
1、默认情况下root不能登录ssh 2、修改ssh服务配置文件 root@ubuntu01:~/Desktop# whoami root root@ubuntu01:~/Desktop# vim /
1、问题 (1)、传输工具 2、安装ssh服务 liujiaxin01@liujiaxin01-virtual-machine:~$ whoami liujiaxin01 liujiaxin01@li
linux系统中如何删除文件的最后几行 1、 [root@centos79 test]# cat a.txt a g e d c j i x a e i r x v b x e w [root@cen
linux系统awk命令拆分文件。 1、 [root@centos7 test2]# ls file.txt [root@centos7 test2]# cat file.txt -rw-r--r--
1、测试数据 [root@centos79 test]# ls a.txt [root@centos79 test]# cat a.txt a g e u c j alike i x k like w
以centos7.9为例。 1、 [root@centos7 test]# uname -a Linux centos7 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 1
1、测试数据如下 [root@centos79 test]# ls a.txt [root@centos79 test]# cat a.txt a g r e i x k like a f g lik
1、问题 [root@localhost ~]# systemctl restart network Failed to restart network.service: Unit network.s