Shell 是一个用 C 语言编写的程序,它是用户使用 Linux 的桥梁。Shell 既是一种命令语言,又是一种程序设计语言。Shell 是指一种应用程序,这个应用程序提供了一个界面,用户通过这个界面访问操作系统内核的服务。Ken Thompson 的 sh 是第一种 Unix Shell,Windows Explorer 是一个典型的图形界面 Shell。
1、标准输入重定向0,通常省略;标准输出重定向1,通常省略;标准错误输出重定向2,不能省略 创建测试数据 [root@linuxprobe test]# echo 'this is a tes
1、创建测试数据 [root@linuxprobe test]# cat a.txt e i j s e f s d g e d d 2、利用grep命令统计字符e出现的次数 [root@linuxp
1、运行python程序遇到下面问题,python版本3.6.8 ModuleNotFoundError: No module named 'scipy' 2、 pip3 instal
1、利用xargs进行行列转换 [root@linuxprobe test2]# seq 512345[root@linuxprobe test2]# seq 5 | xargs ## xargs 默
1、基本用法,直接运行date 显示系统当前时间 [root@linuxprobe test]# date Mon Oct 5 20:03:00 CST 2020 2、以特定格式输出,如“年-月-日
1、创建测试数据 [root@linuxprobe test]# cat a.txt ## 随机创建测试数据 fr dfg rte er hdf fgh dg fgd rtw er ewr scf y
1、运行python程序,遇到下面报错,python版本3.6.8 import numpy as np ModuleNotFoundError: No module named 'numpy
1、创建测试数据 [root@linuxprobe test]# dd if=/dev/zero bs=1024 count=40000 of=c.txt [root@linuxprobe test]
1、简单用法,直接加数字 [root@linuxprobe test]# seq 10 ## 输出1到10列表 1 2 3 4 5 6 7 8 9 10 2、设置起点、终点 [root@linuxpr
1、创建测试数据 [root@linuxprobe test]# echo "aaa.bbb.ccc.ddd" > a.txt [root@linuxprobe test]#
1、linux系统中case主要用于选择执行、在需要进行多重分支的情况下使用,case在多个范围内匹配数据,若匹配成则执行相关的命令并结束整个条件测试。 简单示例: [root@linuxprobe
1、-eq 表示等于 [root@linuxprobe test]# [ 3 -eq 4 ] [root@linuxprobe test]# echo $? 1 [root@linuxprobe te
1、查看系统、java安装情况 [root@linuxprobe ~]# cat /etc/system-release Red Hat Enterprise Linux release 8.0 (O
1、 [root@linuxprobe test]# ls ## 测试数据 a.txt [root@linuxprobe test]# cat a.txt fd gfd fgd fsdafds dfs
1、linux系统中read命令用于从标准输入中读取数据,进而给变量赋值。 简单用法: [root@linuxprobe test]# echo $var1 ## 首先查看未赋值前变量,发现是空值 [
1、一次性计划任务服务顾名思义只执行一次,直接测试 [root@linuxprobe test]# date ## 查看系统当前日期 Mon Oct 19 12:45:10 CST 2020 [roo
1、查看系统版本及当前java环境 [root@linuxprobe home]# cat /etc/system-release ## 查看系统版本 Red Hat Enterprise Linux
1、测试数据 [root@linuxprobe test]# ls ## 测试数据 a.txt [root@linuxprobe test]# cat a.txt fd gfd fgd fsdafds
1、Linux系统中文件测试语句用于判断文件是否存在、是文件或者目录、或者权限判断 linux系统中 echo $? 用于判断上一句是否成功执行,成功返回0,不成功返回其他数字, 简单示例: [roo
1、linux系统中let命令在bash中用于计算,变量名前不用加$,可以实现自加和自减操作 简单用法 [root@linuxprobe test]# a=3 [root@linuxprobe tes
1、linux系统中字符串比较语句用来判断字符串是否相等、或者字符串的代表的变量是否被赋值过 = 表示字符串是否相同 [root@linuxprobe test]# a=xxx [root@linux
1、系统版本、java环境查看 [root@linuxprobe home]# cat /etc/system-release ## 查看系统版本 Red Hat Enterprise Linux r
1、&& 表示与,上一句执行成功则执行下一句;|| 表示或,上一句执行失败则执行下一句 [root@linuxprobe test]# touch a.txt [root@linuxp
1、linux系统中expr命令实现命令行中的四则运算 简单示例: [root@linuxprobe test]# expr 5 + 3 ## 在命令行中实现加法运算 8 2、中间必须有空格 [roo
1、linux中$random用于生成0—32767的随机数 简单示例: [root@linuxprobe r_toy_par]# echo $RANDOM ## 取随机值 (小概率一样) 23603
1、case命令选择执行 [root@linuxprobe test]# ls test.sh [root@linuxprobe test]# cat test.sh ## 查看脚本 #!/bin/b
1、linux系统中while循环示例 [root@linuxprobe test]# ls test.sh [root@linuxprobe test]# cat test.sh #!/bin/ba
1、id命令用于反馈用于ID,所属组ID,(所属组名 ?) 使用root测试结果: [root@linuxprobe home]# whoami ## root用户 root [root@linuxp
1、crontab命令用于创建系统能够周期性、有规律地执行某些具体的任务 直接测试:crontab -e 进行创建、编辑任务 [root@linuxprobe test]# ls ## 查看测试文件
linux系统中,一切文件都是从跟目录“/”开始,按照文件系统层次化标准(FHS)采用树形结构来存放文件,并规定了常见目录的用途。 在早期的 UNIX 系统中,各个厂家各自定义了自己的 UNIX 系统