04 2022 档案

摘要:1、 > a <- "abcde" > length(a) ## length统计向量的长度 [1] 1 > nchar(a) ## nchar统计字符串的长度 [1] 5 > a <- c("aaa", "b", "ccccc", "dd") > a [1] "aaa" "b" "ccccc" " 阅读全文
posted @ 2022-04-30 23:57 小鲨鱼2018 阅读(202) 评论(0) 推荐(0) 编辑
摘要:1、该指令只能用于查找二进制文件、源代码文件和man手册页,一般文件的定位需使用locate、find命令。 root@DESKTOP-1N42TVH:/home/test# whereis top ## 输出了二进制文件和man手册叶 top: /usr/bin/top /usr/share/ma 阅读全文
posted @ 2022-04-30 23:19 小鲨鱼2018 阅读(465) 评论(0) 推荐(0) 编辑
摘要:locate特定: 001:速度快 002:查找依赖于/var/lib/mlocate/mlocate.db 为了时效性查找,在使用locate命令之前可以先更新库: updatedb 示例: 1、locate + file root@DESKTOP-1N42TVH:/home/test# loca 阅读全文
posted @ 2022-04-30 23:05 小鲨鱼2018 阅读(405) 评论(0) 推荐(0) 编辑
摘要:1、 root@DESKTOP-1N42TVH:/home/test# echo $a root@DESKTOP-1N42TVH:/home/test# [ -z $a ] && echo "null" || echo "no null" ## -z判断变量是否为空,空返回TRUE,非空返回FALS 阅读全文
posted @ 2022-04-30 22:30 小鲨鱼2018 阅读(631) 评论(0) 推荐(0) 编辑
摘要:1、 > a <- c("a", NA, "d", "e", NA, "b") > complete.cases(a) ## 向量中不为空返回TRUE,为空则返回FALSE [1] TRUE FALSE TRUE TRUE FALSE TRUE > is.na(a) ## 向量中为空返回TRUE, 阅读全文
posted @ 2022-04-30 22:03 小鲨鱼2018 阅读(413) 评论(0) 推荐(0) 编辑
摘要:1、应用于向量 > a <- c("d", "e", NA, "k", NA, "m") > a [1] "d" "e" NA "k" NA "m" > as.character(na.omit(a)) ## 清除向量中的空值 [1] "d" "e" "k" "m" > na.omit(a)[1:l 阅读全文
posted @ 2022-04-30 21:51 小鲨鱼2018 阅读(976) 评论(0) 推荐(0) 编辑
摘要:1、下载地址:http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/ 2、赋予权限 root@DESKTOP-1N42TVH:/home/software# ll -h total 34M drwxr-xr-x 4 root root 4.0K 阅读全文
posted @ 2022-04-30 00:04 小鲨鱼2018 阅读(1413) 评论(0) 推荐(0) 编辑
摘要:1、举例 root@DESKTOP-1N42TVH:/home/test3# a="aa.bb.cc.dd" root@DESKTOP-1N42TVH:/home/test3# echo $a aa.bb.cc.dd root@DESKTOP-1N42TVH:/home/test3# echo ${ 阅读全文
posted @ 2022-04-29 23:03 小鲨鱼2018 阅读(162) 评论(0) 推荐(0) 编辑
摘要:1、举例 #*.的作用 root@DESKTOP-1N42TVH:/home/test3# a="aa.bb.cc.dd" root@DESKTOP-1N42TVH:/home/test3# echo ${a} aa.bb.cc.dd root@DESKTOP-1N42TVH:/home/test3 阅读全文
posted @ 2022-04-29 22:55 小鲨鱼2018 阅读(2737) 评论(0) 推荐(0) 编辑
摘要:1、举例%.*的作用 root@DESKTOP-1N42TVH:/home/test3# a="aa.bb.cc.dd" root@DESKTOP-1N42TVH:/home/test3# echo ${a} aa.bb.cc.dd root@DESKTOP-1N42TVH:/home/test3# 阅读全文
posted @ 2022-04-29 22:43 小鲨鱼2018 阅读(3139) 评论(0) 推荐(1) 编辑
摘要:1、 测试数据 > df <- data.frame(Age=c(22,24,25,26), Gender=c("Girl","Girl","Boy","Boy"), + City=c("Shanghai","Beijing","Guangzhou","Nanjing")) > df Age Gen 阅读全文
posted @ 2022-04-29 21:55 小鲨鱼2018 阅读(1140) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 > dat <- as.data.frame(matrix(1:100, nrow = 10)) > colnames(dat) <- 1:10 > rownames(dat) <- 1:10 > dat 1 2 3 4 5 6 7 8 9 10 1 1 11 21 31 41 51 阅读全文
posted @ 2022-04-29 21:47 小鲨鱼2018 阅读(3952) 评论(0) 推荐(0) 编辑
摘要:1、方法1 模拟200个样本, 50000个位点 nsnp <- 50000 nind <- 200 nums <- sample(1:2, nsnp * 2 * nind, replace = T) snp_matrix <- matrix(nums, nrow = 200) col_idx <- 阅读全文
posted @ 2022-04-29 18:20 小鲨鱼2018 阅读(255) 评论(0) 推荐(0) 编辑
摘要:1、R安装devtools过程中遇到如下问题: > install.packages('devtools', repos='https://mirror.lzu.edu.cn/CRAN/') 2、解决方法 sudo apt-get install libssl-dev sudo apt-get in 阅读全文
posted @ 2022-04-29 10:40 小鲨鱼2018 阅读(722) 评论(0) 推荐(0) 编辑
摘要:1、 > a <- letters[1:10] > a [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" > replace(a, c(1, 3, 5), "xxx") ## 替换指定索引的字符串为特定的字符串 [1] "xxx" "b" "xxx" &qu 阅读全文
posted @ 2022-04-29 00:20 小鲨鱼2018 阅读(1071) 评论(0) 推荐(0) 编辑
摘要:1、 root@DESKTOP-1N42TVH:/home/test2# ls a.txt test.r root@DESKTOP-1N42TVH:/home/test2# cat test.r #!/usr/bin/Rscript library(optparse) option_list <- 阅读全文
posted @ 2022-04-28 23:20 小鲨鱼2018 阅读(339) 评论(0) 推荐(0) 编辑
摘要:1、 root@DESKTOP-1N42TVH:/home/test2# ls test.r root@DESKTOP-1N42TVH:/home/test2# cat test.r ## 测试函数 argv <- commandArgs(TRUE) ## 参数收集在argv数组中 print(pa 阅读全文
posted @ 2022-04-28 22:38 小鲨鱼2018 阅读(286) 评论(0) 推荐(0) 编辑
摘要:ubuntu安装R遇到如下问题: root@DESKTOP-1N42TVH:/home/test2# apt install r-base-core 1、系统内核 root@DESKTOP-1N42TVH:/home/test2# lsb_release -a No LSB modules are 阅读全文
posted @ 2022-04-28 22:01 小鲨鱼2018 阅读(2115) 评论(0) 推荐(0) 编辑
摘要:1、自定义函数之位置参数 > testfun1 <- function(arg1, arg2){ ## 自定义函数,给与两个参数arg1、arg2 + result = arg1 - arg2 + print(result) + } > testfun1(10, 3) ## 默认就是位置参数,即ar 阅读全文
posted @ 2022-04-28 20:25 小鲨鱼2018 阅读(1496) 评论(0) 推荐(0) 编辑
摘要:001、 > a <- c("abc", "bcd", "ead") > b <- c("ead", "aya", "dbe") > c <- c("mna", "ond", "dne") > d <- data.frame(a, b, c) > d a b c 1 abc ead mna 2 bc 阅读全文
posted @ 2022-04-28 19:55 小鲨鱼2018 阅读(4934) 评论(0) 推荐(0) 编辑
摘要:1、 > sub("b", "x", c("abbc", "bbcd", "cde")) ## 三个字符串中第一个“b”被替换为了“x” [1] "axbc" "xbcd" "cde" > gsub("b", "x", c("abbc", "bbcd", "cde")) ##gsub中的g表示全局, 阅读全文
posted @ 2022-04-28 19:41 小鲨鱼2018 阅读(2127) 评论(0) 推荐(0) 编辑
摘要:1、数据框或矩阵中字符串的批量替换 > a <- c("a","d", "v", "c") > b <- c("c", "b", "a", "d") > c <- c("m", "a", "d", "b") > d <- data.frame(a, b, c) > d a b c 1 a c m 2 阅读全文
posted @ 2022-04-28 18:58 小鲨鱼2018 阅读(5427) 评论(0) 推荐(0) 编辑
摘要:1、当参考基因组 大于2G时(约20亿个核苷酸,20,0000,0000):bwa index -a bwtsw xxx.fa 小于2G时(约20亿个核苷酸,20,0000,0000):bwa index xxx.fa 2、统计参考基因组碱基数目 root@DESKTOP-1N42TVH:/home 阅读全文
posted @ 2022-04-28 00:05 小鲨鱼2018 阅读(3161) 评论(0) 推荐(0) 编辑
摘要:1、创建java安装目录 root@DESKTOP-1N42TVH:~# mkdir /usr/local/java root@DESKTOP-1N42TVH:~# cd /usr/local/java/ 2、下载jdk安装包,url:https://www.oracle.com/java/tech 阅读全文
posted @ 2022-04-27 23:37 小鲨鱼2018 阅读(4519) 评论(0) 推荐(0) 编辑
摘要:来源:https://blog.niekun.net/archives/1801.html 在升级到 wsl 2 后发现一些网络问题和之前的 wsl 不一样了,主要是 DNS 解析和 wsl 和 Windows 网络互访问题,这里介绍如何处理。 DNS 解析 wsl 2 使用的 DNS 解析服务器设 阅读全文
posted @ 2022-04-27 19:51 小鲨鱼2018 阅读(6720) 评论(2) 推荐(0) 编辑
摘要:cmd命令:wsl --shutdown 阅读全文
posted @ 2022-04-27 17:21 小鲨鱼2018 阅读(2890) 评论(0) 推荐(0) 编辑
摘要:1、putty登录出现如下报错: 2、解决方法, 修改配置文件, 重启ssh服务 root@DESKTOP-1N42TVH:/home# vim /etc/ssh/sshd_config 重启ssh服务: root@DESKTOP-1N42TVH:/home# service ssh restart 阅读全文
posted @ 2022-04-27 16:56 小鲨鱼2018 阅读(3512) 评论(0) 推荐(0) 编辑
摘要:1、问题putty无法连接ubuntu 2、检查网络连接(有ip,网络都不能正常连接) 3、查看防火墙,关闭防火墙 检查网络连接:(网络连接正常了) 4、测试putty,可以正常登录。 阅读全文
posted @ 2022-04-27 16:48 小鲨鱼2018 阅读(2039) 评论(0) 推荐(0) 编辑
摘要:1、问题, 在启动ssh服务是出现如下问题 2、解决方法 root@DESKTOP-1N42TVH:/home# ssh-keygen -A ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 3、测试 root@DESKTOP-1 阅读全文
posted @ 2022-04-27 13:08 小鲨鱼2018 阅读(4593) 评论(0) 推荐(0) 编辑
摘要:1、查看状态 root@DESKTOP-1N42TVH:/home# ufw status ## 开启状态 Status: active 2、关闭防火墙 root@DESKTOP-1N42TVH:/home# ufw disable Firewall stopped and disabled on 阅读全文
posted @ 2022-04-27 13:05 小鲨鱼2018 阅读(2715) 评论(0) 推荐(0) 编辑
摘要:1、win + r wslconfig /l 2、执行如下命令 wslconfig /u Ubuntu 3、检查 wslconfig /l 阅读全文
posted @ 2022-04-27 12:38 小鲨鱼2018 阅读(258) 评论(0) 推荐(0) 编辑
摘要:1、问题,执行apt-get update时出现如下报错: Err:1 http://archive.ubuntu.com/ubuntu focal InRelease 2、 阅读全文
posted @ 2022-04-27 12:15 小鲨鱼2018 阅读(2081) 评论(0) 推荐(0) 编辑
摘要:1、 root@DESKTOP-1N42TVH:/home/test/test2# ls Arabidopsis_thaliana.TAIR10.dna.toplevel.fa root@DESKTOP-1N42TVH:/home/test/test2# samtools faidx Arabido 阅读全文
posted @ 2022-04-27 09:54 小鲨鱼2018 阅读(801) 评论(0) 推荐(0) 编辑
摘要:1、方式1 root@DESKTOP-1N42TVH:/home/test/test2# ls Arabidopsis_thaliana.TAIR10.dna.toplevel.fa root@DESKTOP-1N42TVH:/home/test/test2# java -jar /home/sof 阅读全文
posted @ 2022-04-27 09:51 小鲨鱼2018 阅读(1685) 评论(0) 推荐(0) 编辑
摘要:1、问题 2、解决方法 root@DESKTOP-1N42TVH:/home/test2# vim /etc/profile ## 在配置文件末尾追加如下两句 export XDG_RUNTIME_DIR=/usr/lib/ export RUNLEVEL=3 source一下: root@DESK 阅读全文
posted @ 2022-04-27 00:37 小鲨鱼2018 阅读(5724) 评论(0) 推荐(0) 编辑
摘要:1、 root@DESKTOP-1N42TVH:/home/test# ls root@DESKTOP-1N42TVH:/home/test# ls /home/test2/* /home/test2/a.txt /home/test2/test.sh root@DESKTOP-1N42TVH:/h 阅读全文
posted @ 2022-04-26 23:21 小鲨鱼2018 阅读(2809) 评论(0) 推荐(0) 编辑
摘要:来源: https://blog.csdn.net/weixin_45579994/article/details/112386425 WSL2默认可以使用的内存大小为主机的80%,对于Linux而言即使装了桌面,一般的开发也没必要给这么多内存,分多了,反而有可能卡主机的Windows操作:1.打开 阅读全文
posted @ 2022-04-26 22:03 小鲨鱼2018 阅读(3425) 评论(0) 推荐(0) 编辑
摘要:001、 root@DESKTOP-1N42TVH:/home/test2# ls outcome.ped root@DESKTOP-1N42TVH:/home/test2# cat outcome.ped G G C C G G T T G G C C G G T G G G C C A A T 阅读全文
posted @ 2022-04-26 21:16 小鲨鱼2018 阅读(247) 评论(0) 推荐(0) 编辑
摘要:1、方法1 root@DESKTOP-1N42TVH:/home/test# ls hg38.fa root@DESKTOP-1N42TVH:/home/test# grep -v "^>" hg38.fa | awk 'BEGIN{sum = 0} {sum += length($0)} END 阅读全文
posted @ 2022-04-26 17:10 小鲨鱼2018 阅读(306) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test2# ls test.txt root@DESKTOP-1N42TVH:/home/test2# cat test.txt i j k s root@DESKTOP-1N42TVH:/home/test2# sed -n l 阅读全文
posted @ 2022-04-26 15:21 小鲨鱼2018 阅读(1085) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test2# ls test.txt root@DESKTOP-1N42TVH:/home/test2# cat test.txt i j k x c b z c b e g a 2、输出行序号 root@DESKTOP-1N42T 阅读全文
posted @ 2022-04-26 15:10 小鲨鱼2018 阅读(420) 评论(0) 推荐(0) 编辑
摘要:001、 > a <- c(5, 2, 7, 4) > b <- c(3, 8, 6, 5) > c <- c(7, 1, 6, 3) > dat <- list(a, b, c) ## 生成测试列表 > dat [[1]] [1] 5 2 7 4 [[2]] [1] 3 8 6 5 [[3]] [ 阅读全文
posted @ 2022-04-25 23:23 小鲨鱼2018 阅读(353) 评论(0) 推荐(0) 编辑
摘要:001、 > a <- 1:3 > b <- "xxx" > c <- c("bbb", "aaa", "ccc") > dat <- list(a, b, c) ## list函数用于生成列表 > dat [[1]] [1] 1 2 3 [[2]] [1] "xxx" [[3]] [1] "bbb 阅读全文
posted @ 2022-04-25 23:13 小鲨鱼2018 阅读(437) 评论(0) 推荐(0) 编辑
摘要:001、 > c1 <- c(8, 2, 9, 3) > c2 <- c(6, 3, 7, 4) > c3 <- c(3, 1, 7, 6) > dat <- cbind(c1, c2, c3) > dat ## 测试数据, 为数据框 c1 c2 c3 [1,] 8 6 3 [2,] 2 3 1 [ 阅读全文
posted @ 2022-04-25 22:51 小鲨鱼2018 阅读(230) 评论(0) 推荐(0) 编辑
摘要:001、 > dat1 <- c(3, 4, 1, 5, 7, 2) > dat1 <- c(3, 4, 1, 5, 7, 2) > dat2 <- c(6, 3, 2, 7, 4, 9) > dat1 %in% dat2 ## %in% 用于返回dat1中的每一个元素是否在dat2中,如果是返回T 阅读全文
posted @ 2022-04-25 22:43 小鲨鱼2018 阅读(438) 评论(0) 推荐(0) 编辑
摘要:001、 > dat <- c(3, 7, 9, 1, 2, 3, 4, 4, 7, 5) > dat [1] 3 7 9 1 2 3 4 4 7 5 > which.max(dat) ## 返回最大值的索引 [1] 3 > which.min(dat) ## 返回最小值的索引 [1] 4 > wh 阅读全文
posted @ 2022-04-25 22:28 小鲨鱼2018 阅读(1186) 评论(0) 推荐(0) 编辑
摘要:1、 > dat <- rep(4, 4) > dat [1] 4 4 4 4 > res1 <- unique(dat) > res1 [1] 4 > res2 <- rep(4,4) %>% unique() ## R语言中%>%表示管道符,即把前面数输出作为后面的输入 > res2 [1] 4 阅读全文
posted @ 2022-04-25 18:14 小鲨鱼2018 阅读(658) 评论(0) 推荐(0) 编辑
摘要:001、 > signif(0.03253, 3) ## 三位有效数字 [1] 0.0325 > signif(0.03253, 1) [1] 0.03 阅读全文
posted @ 2022-04-25 18:07 小鲨鱼2018 阅读(546) 评论(0) 推荐(0) 编辑
摘要:001、数值 > a = 3.336345 > round(a) [1] 3 > round(a, digits = 2) [1] 3.34 > round(a, digits = 3) [1] 3.336 002、适用于其他数据类型(向量、数据框;不适用于矩阵) > a <- c(3.345, 5 阅读全文
posted @ 2022-04-25 18:04 小鲨鱼2018 阅读(2101) 评论(0) 推荐(0) 编辑
摘要:001、取余数 > 5 %% 2 ## 取余数 [1] 1 > 10 %% 3 ## 取余数 [1] 1 002、除法 > 5 / 2 ## 除法 [1] 2.5 > 10 / 3 [1] 3.333333 003、地板除法 > 5 %/% 2 ## 地板除法 [1] 2 > 10 %/% 3 [1 阅读全文
posted @ 2022-04-25 17:47 小鲨鱼2018 阅读(1834) 评论(0) 推荐(0) 编辑
摘要:001、无放回抽样 > a <- 1:5 ## a为数值向量 > a [1] 1 2 3 4 5 > sample(a, 3) ## 从a中任意抽取3个 [1] 3 1 2 > sample(a, 3) ## 从a中任意抽取3个 [1] 4 1 2 默认为无放回抽样,一个元素不能抽取两次, 除非本身 阅读全文
posted @ 2022-04-25 17:20 小鲨鱼2018 阅读(876) 评论(0) 推荐(0) 编辑
摘要:列表是R的数据结构中最为复杂的一种。 一般来说,列表就是一些对象的有序集合。 对象可以是向量、矩阵、数据框、列表等,可以使用list函数来创建列表。 > g <- "xxxxx" ## 字符串 > h <- c(2, 4, 3) ## 数值向量 > j <- matrix(1:15, nrow = 阅读全文
posted @ 2022-04-25 16:46 小鲨鱼2018 阅读(271) 评论(0) 推荐(0) 编辑
摘要:数组: 不同于矩阵和数据框,维度大于2。 R中最简单的数组:3维。(行, 列, 面),如下两行、三列、四面的数组。 > dim1 <- c("a1", "a2") > dim2 <- c("b1", "b2", "b3") > dim3 <- c("c1", "c2", "c3", "c4") > 阅读全文
posted @ 2022-04-25 16:32 小鲨鱼2018 阅读(249) 评论(0) 推荐(0) 编辑
摘要:1、 > for (i in seq(1, 10)){ + var <- paste0('var', i) ## 变量名 + data <- i + 10 ## 变量值 + assign(var, data) ## 把变量值分配给变量名 + } 阅读全文
posted @ 2022-04-25 10:15 小鲨鱼2018 阅读(2565) 评论(0) 推荐(0) 编辑
摘要:1、 install.packages("devtools") library("devtools") install_github('royfrancis/pophelper') library(pophelper) 阅读全文
posted @ 2022-04-24 21:47 小鲨鱼2018 阅读(957) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt ## 测试数据 d eee j x ee u d eeeee d a e u k q j eeee sj a d 阅读全文
posted @ 2022-04-24 18:43 小鲨鱼2018 阅读(174) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt d ees j x e.s u z e s u w e s u root@DESKTOP-1N42TVH:/ho 阅读全文
posted @ 2022-04-24 18:28 小鲨鱼2018 阅读(313) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt d ees j x e.s u z e s u w e s u root@DESKTOP-1N42TVH:/ho 阅读全文
posted @ 2022-04-24 18:23 小鲨鱼2018 阅读(678) 评论(0) 推荐(0) 编辑
摘要:1、linux 中 grep -q选项表示静默输出, 即不显式匹配结果 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt ## 测试数据 d e j s q u z c b r 阅读全文
posted @ 2022-04-24 17:51 小鲨鱼2018 阅读(2834) 评论(0) 推荐(0) 编辑
摘要:1、 root@DESKTOP-1N42TVH:~# echo "/etc/init.d/ssh start" >> /etc/profile 阅读全文
posted @ 2022-04-24 13:09 小鲨鱼2018 阅读(169) 评论(0) 推荐(0) 编辑
摘要:1、问题 -bash: /mnt/c/Windows/System32/drivers/etc/hosts: Permission denied 2、解决方法 右击,选属性 选安全: 选Users: 点编辑: 点users: 选完全控制: 选应用: 选是: 3、测试效果 可以修改了。 阅读全文
posted @ 2022-04-24 10:56 小鲨鱼2018 阅读(666) 评论(0) 推荐(0) 编辑
摘要:形式1、curl xxxx > result root@DESKTOP-1N42TVH:/home/test2# curl https://s3.amazonaws.com/plink1-assets/plink_linux_x86_64_20220402.zip > a.zip 形式2:curl 阅读全文
posted @ 2022-04-23 23:59 小鲨鱼2018 阅读(1012) 评论(0) 推荐(0) 编辑
摘要:1、问题: Network error: Connection refused 2、解决方法 root@DESKTOP-1N42TVH:~# /etc/init.d/ssh status * sshd is not running 3、 root@DESKTOP-1N42TVH:~# /etc/in 阅读全文
posted @ 2022-04-23 22:54 小鲨鱼2018 阅读(616) 评论(0) 推荐(0) 编辑
摘要:1、问题 openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory 2、查找 libssl.so.1.1 文件 [ro 阅读全文
posted @ 2022-04-16 21:31 小鲨鱼2018 阅读(15660) 评论(6) 推荐(4) 编辑
摘要:1、测试函数 [root@rhel7pc1 test]# ls test.sh [root@rhel7pc1 test]# cat test.sh ## $1 为第一个参数, $2为第二个参数,其余以此类推 #!/bin/bash function fun_test { seq $1 } 2、加载测 阅读全文
posted @ 2022-04-16 18:34 小鲨鱼2018 阅读(561) 评论(0) 推荐(0) 编辑
摘要:1、创建自定义函数 格式: function name { command } [root@rhel7pc1 test]# ls test.sh [root@rhel7pc1 test]# cat test.sh ## shell中创建函数格式 #!/bin/bash function fun_te 阅读全文
posted @ 2022-04-16 18:23 小鲨鱼2018 阅读(1111) 评论(0) 推荐(0) 编辑
摘要:1、 [root@rhel7pc1 test]# ls [root@rhel7pc1 test]# a=100 ## 生成测试变量 [root@rhel7pc1 test]# echo $a 100 [root@rhel7pc1 test]# echo $SHELL ## 系统环境变量 /bin/b 阅读全文
posted @ 2022-04-16 18:01 小鲨鱼2018 阅读(2447) 评论(0) 推荐(0) 编辑
摘要:1、查看系统环境变量:env、export 2、查看自定义变量: set、declare 测试系统环境变量: [root@rhel7pc1 test]# ls [root@rhel7pc1 test]# env > a.txt && export > b.txt ## 将env和export命令的输 阅读全文
posted @ 2022-04-16 17:51 小鲨鱼2018 阅读(471) 评论(0) 推荐(0) 编辑
摘要:1、自定义变量:人为设置的变量 系统环境变量:系统默认的变量 2、查看自定义变量 和 系统环境变量 [root@rhel7pc1 test]# echo $a [root@rhel7pc1 test]# a=100 ## 自定义变量 [root@rhel7pc1 test]# echo $a 100 阅读全文
posted @ 2022-04-16 17:00 小鲨鱼2018 阅读(208) 评论(0) 推荐(0) 编辑
摘要:1、 [root@rhel7pc1 test]# cat test.sh #!/bin/bash NUM=$[RANDOM % 100 + 1] TIMES=0 while : do read -p "please input a 1~100 num: " ANS TIMES=$[TIMES+1] 阅读全文
posted @ 2022-04-16 13:58 小鲨鱼2018 阅读(234) 评论(0) 推荐(0) 编辑
摘要:1、 [root@rhel7pc1 test]# ls [root@rhel7pc1 test]# echo $a [root@rhel7pc1 test]# a=100 [root@rhel7pc1 test]# echo $a 100 [root@rhel7pc1 test]# b=a+50 [ 阅读全文
posted @ 2022-04-16 13:30 小鲨鱼2018 阅读(200) 评论(0) 推荐(0) 编辑
摘要:1、$RANDOM $RANDOM 的默认范围是 [0, 32767] [root@rhel7pc1 test]# echo $RANDOM % 100 + 1 | bc 80 [root@rhel7pc1 test]# echo $RANDOM % 100 + 1 | bc 10 [root@rh 阅读全文
posted @ 2022-04-16 11:46 小鲨鱼2018 阅读(255) 评论(0) 推荐(0) 编辑
摘要:1、linux中awk中next命令相当于循环语句中的continue [root@centos7 test2]# seq 6 1 2 3 4 5 6 [root@centos7 test2]# seq 6 | awk '$0 ~ /5/ {next}; {print $0}' ## 当前行匹配5的 阅读全文
posted @ 2022-04-15 11:41 小鲨鱼2018 阅读(397) 评论(0) 推荐(0) 编辑
摘要:1、测试 数据 [root@centos7 test2]# ls a.txt [root@centos7 test2]# cat a.txt T1 person1 person2 person3 T2 person1 person2 T3 person1 person2 person3 person 阅读全文
posted @ 2022-04-15 11:19 小鲨鱼2018 阅读(73) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@centos7 test]# ls test.fa [root@centos7 test]# cat test.fa >chr1 addgg ddges df >chr2 ertfg sdf >chr3 edret dfdff sfdfd d >chr4 iejie sdg 阅读全文
posted @ 2022-04-15 09:02 小鲨鱼2018 阅读(556) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@centos7 test3]# ls test.txt [root@centos7 test3]# cat test.txt deet dggh df 2、awk实现 [root@centos7 test3]# ls test.txt [root@centos7 test3 阅读全文
posted @ 2022-04-15 08:21 小鲨鱼2018 阅读(1132) 评论(0) 推荐(0) 编辑
摘要:1、 [root@centos7 test5]# ls test.java [root@centos7 test5]# cat test.java class Dog{ ## 类 int size; String breed; String name; void bark() { System.ou 阅读全文
posted @ 2022-04-14 18:00 小鲨鱼2018 阅读(27) 评论(0) 推荐(0) 编辑
摘要:类是对象的抽象定义,对象是类的具体实例。 类就是对象???? 对象就是类??? 阅读全文
posted @ 2022-04-14 15:59 小鲨鱼2018 阅读(105) 评论(0) 推荐(0) 编辑
摘要:java中类与方法: 阅读全文
posted @ 2022-04-14 15:21 小鲨鱼2018 阅读(22) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@centos7 test4]# ls test.txt [root@centos7 test4]# cat test.txt 3 2 7 3 2 8 7 [root@centos7 test4]# sort -u test.txt ## sort -u命令 2 3 7 8 阅读全文
posted @ 2022-04-14 14:59 小鲨鱼2018 阅读(178) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@centos7 test4]# ls test.txt [root@centos7 test4]# cat test.txt d j k j x m y e s g j i x v b d z c e t 2、统计行数和列数 [root@centos7 test4]# ls 阅读全文
posted @ 2022-04-14 14:52 小鲨鱼2018 阅读(419) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@centos7 test4]# ls test.txt [root@centos7 test4]# cat test.txt e f j f f f d x s f f d g f f d e j k i c f w f d 2、替换第一个f为xxx [root@cento 阅读全文
posted @ 2022-04-14 14:38 小鲨鱼2018 阅读(506) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@centos7 test4]# ls test.txt [root@centos7 test4]# cat test.txt e f j d i x a d g c F w 2、grep 实现 [root@centos7 test4]# ls test.txt [root@ 阅读全文
posted @ 2022-04-14 14:24 小鲨鱼2018 阅读(336) 评论(0) 推荐(0) 编辑
摘要:1、java编译报错 error: reached end of file while parsing 2、出现这种报错的原因是括号没有成对,检查源代码: 补全括号,保存退出: 3、再次编译、执行 [root@centos7 test5]# ls test.java [root@centos7 te 阅读全文
posted @ 2022-04-14 08:32 小鲨鱼2018 阅读(5796) 评论(0) 推荐(0) 编辑
摘要:1、 [root@centos7 test5]# ls first.java [root@centos7 test5]# cat first.java ## 源文件 public class first{ ##类名为first public static void main(String[] arg 阅读全文
posted @ 2022-04-13 17:03 小鲨鱼2018 阅读(18) 评论(0) 推荐(0) 编辑
摘要:1、占用内存最高的进程 [root@centos7 ne]# ps -aux | sort -k 4nr | head -n 3 2、占用cpu最高的进程 [root@centos7 ne]# ps -aux | sort -k 3nr | head -n 3 阅读全文
posted @ 2022-04-12 14:07 小鲨鱼2018 阅读(649) 评论(0) 推荐(0) 编辑
摘要:1、top或者uptime命令查看平均负载 [root@centos7 ne]# uptime ## 分别表示过去一分钟、过去五分钟、过去15分钟的平均负载 13:54:11 up 5:37, 2 users, load average: 0.00, 0.01, 0.05 2、平均负载与cpu的内核 阅读全文
posted @ 2022-04-12 14:00 小鲨鱼2018 阅读(138) 评论(0) 推荐(0) 编辑
摘要:linux中当目录具有SGID权限时, 任何用户在该目录中创见的文件将自动继承该目录的所属组。 测试。 1、普通用户家目录创建一个普通文件, 观察文件的所属组 [liujiaxin01@rhel7pc1 ~]$ ls [liujiaxin01@rhel7pc1 ~]$ whoami liujiaxi 阅读全文
posted @ 2022-04-10 18:07 小鲨鱼2018 阅读(308) 评论(0) 推荐(0) 编辑
摘要:1、问题 2、解决方法,切换至root用户,修改/etc/sudoers配置文件 [root@rhel7pc1 ~]# vim /etc/sudoers ………… ## The COMMANDS section may have other options added to it. ## ## Al 阅读全文
posted @ 2022-04-10 17:33 小鲨鱼2018 阅读(118) 评论(0) 推荐(0) 编辑
摘要:1、linux中文件或者目录的权限针对用户分为三类,即: 所有者,用u表示; 所属组,用g表示; 其他人,用o表示; 针对每一种用户,权限有可以分为三种,即: 读的权限,用r表示,也用数字4代替。 写的权限,用w表示,也用数字2代替。 执行的权限,用x表示,也用数字1代替。 2、举例 文件a.txt 阅读全文
posted @ 2022-04-10 16:45 小鲨鱼2018 阅读(2605) 评论(0) 推荐(0) 编辑
摘要:1、 -: 普通文件。 d: 目录文件。 l: 链接文件。 例如:软连接 b: 块设备文件 例如:硬盘 c: 字符设备文件 例如: 系统外设, 鼠标、键盘等。 p: 管道文件 ??? 阅读全文
posted @ 2022-04-10 16:15 小鲨鱼2018 阅读(267) 评论(0) 推荐(0) 编辑
摘要:1、 [root@rhel7pc1 test]# ls a.txt [root@rhel7pc1 test]# cat a.txt 1 k d f 2 x c g 3 z c b 4 f i j 5 e d g 6 i j e [root@rhel7pc1 test]# sed '/x/, +1d' 阅读全文
posted @ 2022-04-10 14:52 小鲨鱼2018 阅读(79) 评论(0) 推荐(0) 编辑
摘要:1、 [root@rhel7pc1 test]# ls a.txt [root@rhel7pc1 test]# cat a.txt 1 k d f 2 x c g 3 z c b 4 e w e 5 z c x 6 e d g 7 i j e [root@rhel7pc1 test]# grep - 阅读全文
posted @ 2022-04-10 14:42 小鲨鱼2018 阅读(96) 评论(0) 推荐(0) 编辑
摘要:1、 [root@rhel7pc1 test]# ls a.txt [root@rhel7pc1 test]# cat a.txt 1 k d f 2 x c g 3 z c b 4 e w e 5 z c f 6 e d g [root@rhel7pc1 test]# sed -n '/x/{n; 阅读全文
posted @ 2022-04-10 14:24 小鲨鱼2018 阅读(383) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@rhel7pc1 test]# ls a.txt [root@rhel7pc1 test]# cat a.txt ## 测试数据 1 k d f 2 x c g 3 z c b 4 e w e 5 z c f 6 e d g 2、删除匹配行及其下一行 [root@rhel7 阅读全文
posted @ 2022-04-10 14:02 小鲨鱼2018 阅读(1241) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@rhel7pc1 test]# ls test.txt [root@rhel7pc1 test]# cat test.txt e 5435.1 f d f 1 j k d f e u d j 1 j [root@rhel7pc1 test]# sed -n l test.t 阅读全文
posted @ 2022-04-09 21:00 小鲨鱼2018 阅读(246) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@centos7 test]# ls test.txt [root@centos7 test]# cat test.txt ## 测试数据 y j k j k h d j r [root@centos7 test]# sed -n l test.txt y\tj k$ \t\ 阅读全文
posted @ 2022-04-09 14:25 小鲨鱼2018 阅读(649) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@centos7 test]# ls test.txt [root@centos7 test]# cat test.txt y j k j k h d j r [root@centos7 test]# sed -n l test.txt ## 测试数据 y\t\tj k$ j 阅读全文
posted @ 2022-04-09 14:15 小鲨鱼2018 阅读(506) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@centos7 test]# ls test.txt [root@centos7 test]# cat test.txt ## 测试数据 d j m d j y i [root@centos7 test]# sed -n l test.txt ## 查看分割符 d j m$ 阅读全文
posted @ 2022-04-09 14:10 小鲨鱼2018 阅读(940) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@centos7 test]# ls test.txt [root@centos7 test]# cat test.txt ## 测试数据 k m w g h g u y [root@centos7 test]# sed -n l test.txt ## 查看tab键 k\t 阅读全文
posted @ 2022-04-09 13:38 小鲨鱼2018 阅读(615) 评论(0) 推荐(0) 编辑
摘要:1、 创建规律性计划任务: crontab -e 查看规律性计划任务:crontab -l 删除规律性计划任务:crontab -r 时间格式:分 时 月 年 星期 命令 实例: 1、创建规律性计划任务服务 [root@centos7 test]# crontab -e ## 输入该命令之后进入编辑 阅读全文
posted @ 2022-04-06 20:37 小鲨鱼2018 阅读(75) 评论(0) 推荐(0) 编辑
摘要:1、问题 paste异常 [root@centos7 test]# ls test.ped test.txt [root@centos7 test]# cat test.txt 10 YH 1 GS 11 YH [root@centos7 test]# cat test.ped 10 10 0 0 阅读全文
posted @ 2022-04-06 18:15 小鲨鱼2018 阅读(106) 评论(0) 推荐(0) 编辑
摘要:1、问题 unable to start device PNG 2、排查,进入R,输入:capabilities() 3、测试 > png("a.png") Error in .External2(C_X11, paste0("png::", filename), g$width, g$height 阅读全文
posted @ 2022-04-06 15:43 小鲨鱼2018 阅读(641) 评论(0) 推荐(0) 编辑
摘要:1、R编译安装出现如下问题: configure: error: PCRE2 library and headers are required, or use --with-pcre1 and PCRE >= 8.32 with UTF-8 support 2、系统 [root@centos7 R- 阅读全文
posted @ 2022-04-06 15:00 小鲨鱼2018 阅读(3829) 评论(0) 推荐(0) 编辑
摘要:1、创建计划任务服务 [root@centos7pc1 test2]# ls [root@centos7pc1 test2]# date Wed Apr 6 17:16:12 CST 2022 [root@centos7pc1 test2]# at now+2 min ## 设置任务时间, 2分钟后 阅读全文
posted @ 2022-04-06 09:21 小鲨鱼2018 阅读(219) 评论(0) 推荐(0) 编辑
摘要:1、 [root@centos7pc1 test2]# ls test.sh [root@centos7pc1 test2]# cat test.sh ## 测试脚本 #!/bin/bash read -p "please input an number or an letter: " KEY ca 阅读全文
posted @ 2022-04-06 08:52 小鲨鱼2018 阅读(38) 评论(0) 推荐(0) 编辑
摘要:1、 [root@centos7pc1 test2]# ls test.sh [root@centos7pc1 test2]# cat test.sh ## 脚本 #!/bin/bash for i in `seq 9` do for j in `seq 9` do echo "$i * $j" | 阅读全文
posted @ 2022-04-05 20:03 小鲨鱼2018 阅读(367) 评论(0) 推荐(0) 编辑
摘要:1、 [root@rhel7pc1 test]# echo "xxx" xxx [root@rhel7pc1 test]# echo -n "xxx" ## -n选项实现不换行输出 xxx[root@rhel7pc1 test]# 阅读全文
posted @ 2022-04-05 19:55 小鲨鱼2018 阅读(520) 评论(0) 推荐(0) 编辑
摘要:1、 [root@rhel7pc1 test]# ls test.sh [root@rhel7pc1 test]# cat test.sh #!/bin/bash NUM=10 while [ $NUM -gt 0 ] ## 循环条件 do echo "$NUM xxxx" let NUM-- ## 阅读全文
posted @ 2022-04-05 19:43 小鲨鱼2018 阅读(1163) 评论(0) 推荐(0) 编辑
摘要:1、问题 configure: error: select TLS backend(s) or disable TLS with --without-ssl. 2、解决方法,没有问题 [root@rhel7pc1 curl-7.82.0]# ./configure --with-wolfssl 参考 阅读全文
posted @ 2022-04-05 18:27 小鲨鱼2018 阅读(2387) 评论(0) 推荐(0) 编辑
摘要:1、下载地址:https://curl.se/download/ 参考:https://blog.csdn.net/wangpanbaoding/article/details/79104609 1)下载curl包(可以在这个网站上找最新的版本 http://curl.haxx.se/downloa 阅读全文
posted @ 2022-04-05 18:07 小鲨鱼2018 阅读(1725) 评论(0) 推荐(0) 编辑
摘要:1、问题如下: 2、查看ssh状态 root@DESKTOP-1N42TVH:/home/test3# ps -e |grep ssh ## 没有启动 3、启动ssh root@DESKTOP-1N42TVH:/home/test3# service ssh start * Starting Ope 阅读全文
posted @ 2022-04-04 19:42 小鲨鱼2018 阅读(298) 评论(0) 推荐(0) 编辑
摘要:1、问题 root@ubuntu01:/home/software/PopLDdecay# ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environm 阅读全文
posted @ 2022-04-04 16:25 小鲨鱼2018 阅读(914) 评论(0) 推荐(0) 编辑
摘要:1、问题 [root@rhelpc1 software]# git clone https://github.com/BGI-shenzhen/PopLDdecay.git Cloning into 'PopLDdecay'... fatal: unable to access 'https://g 阅读全文
posted @ 2022-04-04 16:07 小鲨鱼2018 阅读(358) 评论(0) 推荐(0) 编辑
摘要:1、问题安装git 过程中 make出现问题 cache.h:40:18: fatal error: zlib.h: No such file or directory #include <zlib.h> 2、解决方法 [root@rhelpc1 git-2.9.5]# yum install zl 阅读全文
posted @ 2022-04-04 15:57 小鲨鱼2018 阅读(603) 评论(0) 推荐(0) 编辑
摘要:1、问题 [root@rhelpc1 software]# git clone https://github.com/BGI-shenzhen/PopLDdecay.git bash: git: command not found... 2、解决方法(REDHAT系列) [root@rhelpc1 阅读全文
posted @ 2022-04-04 15:23 小鲨鱼2018 阅读(1953) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test3# ls a.txt root@DESKTOP-1N42TVH:/home/test3# cat a.txt e t d u e i a d g g z j c b d e w l z c b h j h 2、形式1 ro 阅读全文
posted @ 2022-04-04 01:30 小鲨鱼2018 阅读(614) 评论(0) 推荐(0) 编辑
摘要:1、 root@DESKTOP-1N42TVH:/home/test3# ls a.txt root@DESKTOP-1N42TVH:/home/test3# cat a.txt chr168 0.5 0.66 0.77 0.3 chr254 0.6 0.3 0.89 chr678 0.658 0. 阅读全文
posted @ 2022-04-04 00:42 小鲨鱼2018 阅读(52) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt 3 1 4 2 1 2 6 3 2 1 3 3 2、计算每行数据的和 root@DESKTOP-1N42TVH: 阅读全文
posted @ 2022-04-04 00:38 小鲨鱼2018 阅读(847) 评论(0) 推荐(0) 编辑
摘要:1、删除空行 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt df gfdg df gg er fd gg ww kkkk jjjj root@DESKTOP-1N42TVH 阅读全文
posted @ 2022-04-04 00:17 小鲨鱼2018 阅读(256) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test3# ls a.txt root@DESKTOP-1N42TVH:/home/test3# cat a.txt chr168 0.5 0.66 0.77 0.3 chr254 0.6 0.3 0.89 chr678 0.65 阅读全文
posted @ 2022-04-04 00:10 小鲨鱼2018 阅读(52) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test3# ls a.txt root@DESKTOP-1N42TVH:/home/test3# cat a.txt ## 测试数据 01 02 AAA 03 04 05 BBB 06 07 08 CCC 09 10 2、匹配AA 阅读全文
posted @ 2022-04-03 23:45 小鲨鱼2018 阅读(592) 评论(0) 推荐(1) 编辑
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test3# ls a.txt root@DESKTOP-1N42TVH:/home/test3# cat a.txt ## 测试数据 aaaa bbbb cccc dddd eeee ffff 2、sed实现 root@DESKT 阅读全文
posted @ 2022-04-03 23:26 小鲨鱼2018 阅读(638) 评论(0) 推荐(1) 编辑
摘要:1、直接测试 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt d g u k d g u k s d g c s d g c x v d e x v d e s q e t 阅读全文
posted @ 2022-04-03 22:55 小鲨鱼2018 阅读(168) 评论(0) 推荐(1) 编辑
摘要:1、 root@DESKTOP-1N42TVH:/home/test# ls outcome.map.gz root@DESKTOP-1N42TVH:/home/test# cat outcome.map.gz | head -n 5 ## 执行以上命令直接乱码 2、 root@DESKTOP-1N 阅读全文
posted @ 2022-04-03 21:24 小鲨鱼2018 阅读(48) 评论(0) 推荐(1) 编辑
摘要:1、 root@DESKTOP-1N42TVH:/home/test# ls outcome.map root@DESKTOP-1N42TVH:/home/test# wc -l outcome.map ## 测试文件 46827 outcome.map root@DESKTOP-1N42TVH:/ 阅读全文
posted @ 2022-04-03 21:02 小鲨鱼2018 阅读(298) 评论(0) 推荐(0) 编辑
摘要:1、直接解压, 不保留原始文件 root@DESKTOP-1N42TVH:/home/test# ls outcome.map.gz root@DESKTOP-1N42TVH:/home/test# gzip -d outcome.map.gz root@DESKTOP-1N42TVH:/home/ 阅读全文
posted @ 2022-04-03 20:50 小鲨鱼2018 阅读(1501) 评论(0) 推荐(0) 编辑
摘要:来源:https://www.jianshu.com/p/cdf7caa0714d 作者:JeremyL链接:https://www.jianshu.com/p/cdf7caa0714d来源:简书 远程连接虚拟机中ubuntu报错:Network error:Connection refused 检 阅读全文
posted @ 2022-04-03 20:04 小鲨鱼2018 阅读(656) 评论(0) 推荐(0) 编辑
摘要:1、 > a <- c(3, 8, 2, 4, 7) > b <- c(2, 9, 4, 7, 3) > a [1] 3 8 2 4 7 > b [1] 2 9 4 7 3 > pmax(a, b) ## 返回两组向量中的最大值 [1] 3 9 4 7 7 > pmin(a, b) ## 返回两组向 阅读全文
posted @ 2022-04-02 15:48 小鲨鱼2018 阅读(524) 评论(0) 推荐(0) 编辑
摘要:1、测试1 > a <- 1:10 > a [1] 1 2 3 4 5 6 7 8 9 10 > rev(a) ## 逆向输出a [1] 10 9 8 7 6 5 4 3 2 1 > a <- c("aaa", "bbb", "ccc", "ddd") > a [1] "aaa" "bbb" "cc 阅读全文
posted @ 2022-04-02 15:29 小鲨鱼2018 阅读(560) 评论(0) 推荐(0) 编辑
摘要:1、R语言中cumsum函数用于求累积和 > a <- 1:5 > a [1] 1 2 3 4 5 > cumsum(a) ## 求累积和 [1] 1 3 6 10 15 阅读全文
posted @ 2022-04-02 15:16 小鲨鱼2018 阅读(542) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@centos7pc1 test2]# cat test.txt 1 x c 2 s d 3 e t 4 d s 5 j u 6 n x 2、程序 [root@centos7pc1 test2]# cat swap.sh #!/bin/bash temp1=$(sed -n 阅读全文
posted @ 2022-04-02 14:31 小鲨鱼2018 阅读(471) 评论(0) 推荐(0) 编辑
摘要:1、直接测试 [root@centos7pc1 test3]# ls test.sh [root@centos7pc1 test3]# cat test.sh ## 测试脚本 #!/bin/bash NUM=3 while [ $NUM -gt 0 ] ## 循环条件 do echo "xxxxx" 阅读全文
posted @ 2022-04-02 13:03 小鲨鱼2018 阅读(250) 评论(0) 推荐(0) 编辑
摘要:$RANDOM 是linux中的内置变量,可以随机生成 0~32767之间的整数数字。 1、取0~9的随机数 [root@centos7pc1 test3]# ls [root@centos7pc1 test3]# expr $RANDOM % 10 7 [root@centos7pc1 test3 阅读全文
posted @ 2022-04-02 12:16 小鲨鱼2018 阅读(582) 评论(0) 推荐(0) 编辑
摘要:1、expr命令实现在命令行中的四则运算 [root@centos7pc1 test3]# ls [root@centos7pc1 test3]# expr 10 + 5 ## 数字和运算符的两侧必须有空格 15 [root@centos7pc1 test3]# expr 10+5 10+5 [ro 阅读全文
posted @ 2022-04-02 11:57 小鲨鱼2018 阅读(601) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@centos7pc1 test3]# ls a.txt [root@centos7pc1 test3]# cat a.txt ddfg uujj mmkk xxuu zzdd mmuh zzvv ddee 2、sed实现 [root@centos7pc1 test3]# l 阅读全文
posted @ 2022-04-02 11:10 小鲨鱼2018 阅读(208) 评论(0) 推荐(0) 编辑
摘要:1、直接测试 [root@centos7pc1 test3]# ls [root@centos7pc1 test3]# a=10 [root@centos7pc1 test3]# echo $a 10 [root@centos7pc1 test3]# b=a+5 ## 变量没有$则直接输出了变量名 阅读全文
posted @ 2022-04-02 10:10 小鲨鱼2018 阅读(403) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@centos7pc1 test3]# ls a.txt [root@centos7pc1 test3]# cat a.txt GGTGCAATAT GGTGCAATAT GGTGCAATAT GGTGCAATAT 2、将连续的字符转换为中间具有空格的字符 [root@cen 阅读全文
posted @ 2022-04-02 09:18 小鲨鱼2018 阅读(80) 评论(0) 推荐(0) 编辑
摘要:1、问题samtools安装报错:configure: WARNING: S3 support not enabled: requires SSL development files 2、解决方法: [root@centos7pc1 samtools-1.15]# yum install gcc g 阅读全文
posted @ 2022-04-02 08:31 小鲨鱼2018 阅读(115) 评论(0) 推荐(0) 编辑
摘要:1、问题samtools安装报错:configure: WARNING: libcurl not enabled: library not found 2、解决方法 [root@centos7pc1 samtools-1.15]# yum install libcurl-devel -y 阅读全文
posted @ 2022-04-02 08:26 小鲨鱼2018 阅读(203) 评论(0) 推荐(0) 编辑
摘要:1、问题 samtools安装报错:configure: error: liblzma development files not found 2、解决方法 [root@centos7pc1 samtools-1.15]# yum install xz-devel -y 阅读全文
posted @ 2022-04-02 08:22 小鲨鱼2018 阅读(749) 评论(0) 推荐(0) 编辑
摘要:1、问题samtools安装报错 configure: error: libbzip2 development files not found 2、解决方法 [root@centos7pc1 samtools-1.15]# yum install bzip2-devel -y 阅读全文
posted @ 2022-04-02 08:19 小鲨鱼2018 阅读(819) 评论(0) 推荐(0) 编辑
摘要:1、问题 samtools安装报错:configure: error: zlib development files not found 2、解决方法 [root@centos7pc1 samtools-1.15]# yum install zlib zlib-devel 阅读全文
posted @ 2022-04-02 08:16 小鲨鱼2018 阅读(570) 评论(0) 推荐(0) 编辑
摘要:1、问题 [root@centos7pc1 samtools-1.15]# ./configure configure: error: curses development files not found 2、解决方法 [root@centos7pc1 samtools-1.15]# yum ins 阅读全文
posted @ 2022-04-01 17:54 小鲨鱼2018 阅读(361) 评论(0) 推荐(0) 编辑
摘要:1、查看系统 [root@centos7pc1 test3]# cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) [root@centos7pc1 test3]# lsb_release -a LSB Version: :cor 阅读全文
posted @ 2022-04-01 17:46 小鲨鱼2018 阅读(454) 评论(0) 推荐(0) 编辑
摘要:1、iP清单、脚本 [root@centos7pc1 test2]# ls ip.txt test.sh [root@centos7pc1 test2]# cat ip.txt www.baidu.com xxxxx www.jd.com yyyyy www.sina.com zzzzz 192.1 阅读全文
posted @ 2022-04-01 16:15 小鲨鱼2018 阅读(199) 评论(0) 推荐(0) 编辑
摘要:1、创建用户列表 [root@centos7pc1 home]# seq -f liujiaxin%02g 2 10 liujiaxin02 liujiaxin03 liujiaxin04 liujiaxin05 liujiaxin06 liujiaxin07 liujiaxin08 liujiax 阅读全文
posted @ 2022-04-01 15:39 小鲨鱼2018 阅读(1077) 评论(0) 推荐(0) 编辑
摘要:1、linux中if条件判断语句,基本结构: if 条件判断语句 then command fi [root@centos7pc1 test2]# ls test.sh [root@centos7pc1 test2]# cat test.sh ## 脚本文件 #!/bin/bash if [ ! - 阅读全文
posted @ 2022-04-01 09:39 小鲨鱼2018 阅读(6290) 评论(0) 推荐(0) 编辑
摘要:1、查看系统中当前的所有用户 [root@centos7pc1 test2]# grep bash /etc/passwd root:x:0:0:root:/root:/bin/bash liujiaxin01:x:1000:1000:liujiaxin01:/home/liujiaxin01:/b 阅读全文
posted @ 2022-04-01 09:25 小鲨鱼2018 阅读(488) 评论(0) 推荐(0) 编辑
摘要:1、系统 [root@centos7pc1 test2]# lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-n 阅读全文
posted @ 2022-04-01 09:08 小鲨鱼2018 阅读(3382) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示