03 2022 档案
摘要:1、逻辑与&&: 在前面语句执行成功时才执行后面的语句 [root@rhelpc1 test]# ls a.txt [root@rhelpc1 test]# wc -l a.txt 0 a.txt [root@rhelpc1 test]# wc -l a.txt && echo OK ## 逻辑与&
阅读全文
摘要:1、 $0: 当前的shell文件名 $#: 一共包含几个参数 $*: 所有的参数 $?:上一步执行的结果,成功执行返回0,不成功执行返回1或其他 $1: 第一个参数 $2:第二个参数 $3: 第三个参数 测试: [root@rhelpc1 test]# ls test.sh [root@rhelp
阅读全文
摘要:1、测试 [root@rhelpc1 test2]# ls [root@rhelpc1 test2]# seq 10 > a.txt [root@rhelpc1 test2]# ls a.txt [root@rhelpc1 test2]# cat a.txt ## 测试数据 1 2 3 4 5 6
阅读全文
摘要:1、行选择 vim file打开文件,在命令模式下输入大写V即可: 按方向键或数字+j/k可以实现行的选择。 2、列选择 vim file打开文件,命令模式下输入ctrl + v即可: 按方向键可以实现列选择。
阅读全文
摘要:1、 删除当前行: dd 删除当前行及向下3行:3dd 或者 d3j 删除当前行及向上3行:d3k 删除当前行及到第1行:d1G 或者 d+gg 删除当前行到最后1行:dG 删除光标所在位置及到行末:d$ 或者D 删除光标所在位置到行首:d0 删除当前字符:x, 相当于delete键 删除当前字符:
阅读全文
摘要:1、Shell 的变量,可以分为“环境变量”和“自定义变量”两种类型,两者的区别在于作用范围不同。环境变量可以在其进程的子进程中继续有效,而自定义变量的势力范围则无法延伸到其进程的子进程中。 [root@localhost test]# ls [root@localhost test]# A=100
阅读全文
摘要:1、直接使用type命令进行判断 [root@localhost test]# type pwd ## pwd是内部命令 pwd is a shell builtin [root@localhost test]# type plink ## plink是外部命令 plink is hashed (/
阅读全文
摘要:1、创建别名命令 [root@localhost test]# pwd /home/test [root@localhost test]# abc bash: abc: command not found... [root@localhost test]# alias abc=pwd ## 创建别名
阅读全文
摘要:双引号“”:不进行转义,保留变量属性。 单引号‘’:进行转义,使其成为单纯的字符串。 [root@localhost test]# A=10 [root@localhost test]# echo $A 10 [root@localhost test]# echo "number is $A" ##
阅读全文
摘要:?:表示匹配任意一个。 *:表示匹配0个或任意多个 [root@localhost test]# ls ab ab1 ab12 ab123 [root@localhost test]# ls -l ab* ## *表示匹配0个或任意多个 -rw-r--r--. 1 root root 0 Mar 2
阅读全文
摘要:1、redhat(centos)中 [root@localhost Desktop]# hostnamectl Static hostname: localhost.localdomain Icon name: computer Chassis: n/a Machine ID: 7dcb3b04ae
阅读全文
摘要:1、标准输出重定向:1>, 1可以省略 root@ubuntu01:/home/test# ls a.txt root@ubuntu01:/home/test# ls -l a.txt -rw-r--r-- 1 root root 6 3月 27 19:52 a.txt root@ubuntu01:
阅读全文
摘要:1、在当前路径直接查找 root@ubuntu01:/home/test# ls 01.txt 02.csv 02.txt 03.csv 04.txt root@ubuntu01:/home/test# find 02.csv 02.csv root@ubuntu01:/home/test# fin
阅读全文
摘要:1、测试数据 root@ubuntu01:/home/test# ls outcome.map outcome.ped root@ubuntu01:/home/test# ll -h total 80M drwxr-xr-x 2 root root 4.0K 3月 27 15:58 ./ drwxr
阅读全文
摘要:1、问题 -bash: unrar: command not found 2、系统 root@ubuntu01:/home/test# hostnamectl Static hostname: ubuntu01 Icon name: computer-vm Chassis: vm Machine I
阅读全文
摘要:1、测试数据 root@PC1:/home/test2# ls a.txt b.txt c.txt root@PC1:/home/test2# md5sum a.txt b.txt c.txt 3b0332e02daabf31651a5a0d81ba830a a.txt 3b0332e02daabf
阅读全文
摘要:1、测试数据 root@ubuntu01:/home/test# ls a.txt root@ubuntu01:/home/test# stat a.txt File: a.txt Size: 15 Blocks: 8 IO Block: 4096 regular file Device: 805h
阅读全文
摘要:1、使用stat命令获取atime、mtime、ctime root@ubuntu01:/home/test# ls a.txt root@ubuntu01:/home/test# stat a.txt File: a.txt Size: 10 Blocks: 8 IO Block: 4096 re
阅读全文
摘要:1、问题 root@ubuntu01:/home/test# ls a.txt root@ubuntu01:/home/test# stat a.txt ## 统计a.txt最后访问的时间 File: a.txt Size: 10 Blocks: 8 IO Block: 4096 regular f
阅读全文
摘要:1、测试数据 root@ubuntu01:/home/test# ls log2013.log log2014.log root@ubuntu01:/home/test# cat log2013.log ## 测试数据 2013-01 2013-02 2013-03 2013-04 2013-05
阅读全文
摘要:1、问题, windows中文件上传linux中出现^M, 如下: root@ubuntu01:/home/test# ls outcome.map root@ubuntu01:/home/test# cat -A outcome.map 1^Is64199.1^I0^I55910^M$ 1^IOA
阅读全文
摘要:1、测试数据 root@ubuntu01:/home/test# ls a.txt b.txt root@ubuntu01:/home/test# cat a.txt sss eee rrr 555 888 333 bbb 777 yyy root@ubuntu01:/home/test# cat
阅读全文
摘要:1、测试数据 root@ubuntu01:/home/test# ls a.txt root@ubuntu01:/home/test# cat a.txt ## 测试数据 a g b d a b b d c b 2、统计重复项 root@ubuntu01:/home/test# ls a.txt r
阅读全文
摘要:1、测试数据 root@ubuntu01:/home/test# ls ## 测试数据 a.txt b.txt root@ubuntu01:/home/test# cat a.txt a b c d e root@ubuntu01:/home/test# cat b.txt c d e f g 2、
阅读全文
摘要:1、硬链接 在Linux中,每个文件都有一个索引节点号(Inode index); 多个文件名指向同一索引节点是存在的。一般这种连接就是硬连接。 硬连接的作用是允许一个文件拥有多个有效路径名,这样用户就可以建立硬连接到重要文件,以防止“误删”的功能。因为只删除一个连接并不影响索引节点本身和其它的连接
阅读全文
摘要:1、/boot: 开机所需文件 内核、开机菜单以及所需配置文件等; 内核、开机启动项 2、/dev:以文件形式存放任何设备与接口; 硬盘、设备 3、/etc:配置文件; 配置文件 4、/home: 用户家目录; 普通用户家目录 5、/bin:存放单用户模式下还可以操作的命令; 命令 6、/lib:开
阅读全文
摘要:1、内存 (1)、 [root@localhost home]# cat /proc/meminfo | head -n 5 MemTotal: 2035624 kB ## 总的内存大小 MemFree: 824528 kB MemAvailable: 1221384 kB Buffers: 178
阅读全文
摘要:1、系统 root@utuntu01:/home# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.4 LTS Release: 20.04 Codename:
阅读全文
摘要:主要分为两大类型: 1、redhat 系列: 包括: fedora、 centos stream、 redhat、 centos 2、debian系列:包括: debian、ubuntu、mint 3、其他:openSUSE、 补充:
阅读全文
摘要:1、关机、重启,不停按del键, 进入bios设置界面,如下, 首先设置语言: 2、选择简体中文 3、点击setting 4、选择高级 5、选择唤醒事件设置 6、全部设置为允许或任意键 7、按F10保存配置并退出
阅读全文
摘要:1、测试数据 root@PC1:/home/test# ls test.map test.ped root@PC1:/home/test# cat test.map ## 测试数据中一共包含有5个位点 2 snp1 0 209225353 2 snp2 0 209233002 2 snp3 0 20
阅读全文
摘要:1、测试数据 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt 01 02 03 04 05 06 07 08 09 10 2、head 实现 root@PC1:/home/test2# ls a.txt root@PC1:
阅读全文
摘要:1、系统及测试文件 (1)ubuntu系统 root@PC1:/home/test2# ls outcome.map outcome.ped root@PC1:/home/test2# hostnamectl Static hostname: PC1 Icon name: computer-vm C
阅读全文
摘要:1、问题 ping: www.baudu.com: Temporary failure in name resolution 2、解决方法 在/etc/resolv.conf配置文件末尾追加:nameserver 8.8.8.8 root@ubuntu201:/home/test# tail -n
阅读全文
摘要:1、测试数据 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
阅读全文
摘要:1、测试数据 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
阅读全文
摘要:1、测试数据 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
阅读全文
摘要:1、测试数据 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt i 3 a d g x 8 6 k m x a a y n 2、awk实现 (1)、每一行后添加空行 root@PC1:/home/test2# ls a.tx
阅读全文
摘要:1、测试数据 root@PC1:/home/test# ls a.txt root@PC1:/home/test# cat a.txt i u k f 2 3 8 7 s j 9 4 2、利用for循环转置 root@PC1:/home/test# ls a.txt root@PC1:/home/t
阅读全文
摘要:1、测试数据 root@PC1:/home/test# ls a.txt root@PC1:/home/test# cat a.txt ## 测试数据 i u k f 2 3 8 7 s j 9 4 形式一、按行排列 2、xargs实现 root@PC1:/home/test# ls a.txt r
阅读全文
摘要:1、测试数据 root@PC1:/home/test# ls a.txt root@PC1:/home/test# cat a.txt i u k f 2 3 8 7 s j 9 4 2、形式1(按照行进行排列) root@PC1:/home/test# ls a.txt root@PC1:/hom
阅读全文
摘要:1、生成测试数据 root@PC1:/home/test# ls a.txt root@PC1:/home/test# cat a.txt ## 测试数据 1 2 3 4 5 2、xargs实现 root@PC1:/home/test# ls a.txt root@PC1:/home/test# c
阅读全文
摘要:1、选种需要注释的代码, ctrl + shift + c进行注释, 再次选中,执行ctrl + shift + c则取消注释 (1)选中: (2)、执行ctrl + shift + c进行注释 (3)选中 4、执行ctrl + shift + c,取消注释
阅读全文
摘要:1、测试1 >>> seq = 'ATGTGACCCTGATTTTGAATGatgAtgAtGaTGaTg' ## 定义测试字符串 >>> type(seq) <class 'str'>= 使用find查找: >>> seq.find('ATG') ## 返回查找字符串的第一个索引 0 >>> se
阅读全文
摘要:1、测试文件 root@PC1:/home/test3# ls root@PC1:/home/test3# touch a.txt b.txt ## 测试文件 root@PC1:/home/test3# ls a.txt b.txt root@PC1:/home/test3# lsattr a.tx
阅读全文
摘要:1、测试 > par(mfrow=c(2,2)) > plot(1:10, main = "001") > plot(1:10, main = "002", xaxt = "n") ## 去除x轴 > plot(1:10, main = "003", yaxt = "n") ## 去除y轴 > pl
阅读全文
摘要:1、 #ECDF指的是Emperical Cumulative Density Function,即经验累积概率密度函数 > test <- rnorm(1000,mean=172,sd=12) ## 生成符合随机正态分布的1000个数, 平均值为172, 标准差为12 > length(test)
阅读全文
摘要:1、直接测试 > layout(matrix(c(0,1,2,3),2,2,byrow=TRUE)) ## matrix划分画布,按行排列,两行两列的矩阵, 0表示空出来,然后按照数字顺序进行绘图 > plot(1:10,main = "001") > plot(1:10,main = "002")
阅读全文
摘要:1、空白 > x <- 1:10 > y <- x^2 > plot(x,y) 2、expression用于上标 > x <- 1:10 > y <- x^2 > plot(x,y, ylab = expression(x^y)) ## 用于上标 3、用于下标 > plot(1:10, ylab =
阅读全文
摘要:1、测试1 当前目录下文件 > getwd() [1] "C:/Users/75377/Desktop/r_test2" > dir() ## 查看当前目录下文件 [1] "a.txt" > file.exists("a.txt") ## 判断当前目录下是否存在a.txt [1] TRUE > fi
阅读全文
摘要:1、quantile生成分位数 > data1 <- c(0, 10) > quantile(data1, c(0.2, 0.5)) ## 取0-10 20%和50%点的数值 20% 50% 2 5 > data2 <- c(1, 23) > quantile(data2, c(0.2, 0.5))
阅读全文
摘要:1、测试1 直接生成文件 > dir() character(0) > cat("aaa", "bbb", file = "test.txt") ## 直接生成文件 > dir() [1] "test.txt" 2、在文件上追加 > cat("1111", "222", file = "test.t
阅读全文