摘要:
1、 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt 1 2 3 4 root@PC1:/home/test2# cat a.txt | sed "H; g" 1 1 2 1 2 3 1 2 3 4 阅读全文
posted @ 2022-05-01 12:41
小鲨鱼2018
阅读(46)
评论(0)
推荐(0)
摘要:
1、 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt a b c d a b e f c d c d m n root@PC1:/home/test2# awk '{a[i++]=$0} END {for(j = i - 阅读全文
posted @ 2022-05-01 12:36
小鲨鱼2018
阅读(133)
评论(0)
推荐(0)
摘要:
1、 root@PC1:/home/test2# for num in `seq 2 100`;do if [ `factor $num|awk '{print $2}'` == $num ];then echo -n "$num ";fi done;echo 2 3 5 7 11 13 17 19 阅读全文
posted @ 2022-05-01 12:25
小鲨鱼2018
阅读(276)
评论(0)
推荐(0)
摘要:
index(x,y):返回字符y在字符串x中的位置。 示例: root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt dgfe knkds dfdf dfewf zdfj ewkhd root@PC1:/home/test2# a 阅读全文
posted @ 2022-05-01 11:59
小鲨鱼2018
阅读(2093)
评论(0)
推荐(0)
摘要:
1、 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt a d g e e j e e j r d g e e j e f f e d k r d j root@PC1:/home/test2# awk '{array[$1 阅读全文
posted @ 2022-05-01 10:38
小鲨鱼2018
阅读(159)
评论(0)
推荐(0)
摘要:
1、 root@PC1:/home/test# ls root@PC1:/home/test# touch {a..d}.txt {a..d}.csv root@PC1:/home/test# ls a.csv a.txt b.csv b.txt c.csv c.txt d.csv d.txt ro 阅读全文
posted @ 2022-05-01 10:21
小鲨鱼2018
阅读(291)
评论(0)
推荐(0)
摘要:
1、sort + uniq实现 root@PC1:/home/test# ls a.txt root@PC1:/home/test# cat a.txt 1 2 a b 1 2 1 2 o p a b m m root@PC1:/home/test# sort a.txt | uniq ## 删除重 阅读全文
posted @ 2022-05-01 09:19
小鲨鱼2018
阅读(1215)
评论(0)
推荐(0)
摘要:
1、任意位置插入列 > a <- letters[1:5] > b <- LETTERS[1:5] > c <- sample(1:10,5) > d <- sample(letters[1:10],5) > e <- data.frame(a, b, c, d) > e ## 测试data.fra 阅读全文
posted @ 2022-05-01 00:30
小鲨鱼2018
阅读(9428)
评论(0)
推荐(0)
摘要:
1、 > a <- "aaabbbcccddd" > substr(a,1,2) ## 提取字符串a的前两个字符串 [1] "aa" > a <- "aaabbbcccddd" > substr(a,3,5) ## 3-5字符 [1] "abb" > substr(a, 5,nchar(a)) ## 阅读全文
posted @ 2022-05-01 00:09
小鲨鱼2018
阅读(1309)
评论(0)
推荐(0)

浙公网安备 33010602011771号