ICode9

精准搜索请尝试: 精确搜索
  • linux 中awk命令计算同一列相邻上数值的差2022-07-19 00:01:15

      001、 root@DESKTOP-1N42TVH:/home/test5/test/test# ls a.txt root@DESKTOP-1N42TVH:/home/test5/test/test# cat a.txt 1570051 1570053 5188621 5178672 5188703 5178724 5188900 5178925 5188932 5179705 root@DESKTOP-1N42TVH:/home/test5/test/test# awk 'BEGIN

  • linux 中 sort命令 -k选项2022-07-18 13:04:37

      sort -k选项用于指定按照哪一列进行排序。   001、 root@DESKTOP-1N42TVH:/home/test5/test# ls facebook.txt root@DESKTOP-1N42TVH:/home/test5/test# cat facebook.txt google 110 5000 baidu 100 5000 guge 50 3000 sohu 100 4500 root@DESKTOP-1N42TVH:/home/test5/test

  • linux 中shell统计fasta文件中每条染色体上的碱基数目2022-07-17 23:34:19

      001、 root@DESKTOP-1N42TVH:/home/test5/test/test# ls test.fa root@DESKTOP-1N42TVH:/home/test5/test/test# cat test.fa >Chr1 ACCCTAAACCCTAAACCCTAAACCCTAAACCCTAAACCCTAACCCTAAAC ACCCTAAACCCTAAACCCTAAACCCTAAACCCTAAACCCTAACCCTAAAC >Chr2 ACCCTAAACCCTAAAC

  • linux 中删除匹配特定字符的行及其后的若干行2022-07-17 22:09:26

      001、 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt 1 01 2 02 3 AAA 4 03 5 04 6 03 7 BBB 8 06 9 07 10 BBB 11 08 12 CCC 13 09 14 AAA 15 10 16 BBB 17 33 root@DESKTOP-1N42TVH:/home/test2# sed '/AAA/d' a.tx

  • linux 中 sed命令匹配特定字符之间的数据2022-07-17 21:35:21

      001、 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt 01 02 AAA 03 04 05 BBB 06 07 08 CCC 09 10 root@DESKTOP-1N42TVH:/home/test2# sed -n '/AAA/,/BBB/p' a.txt ## 匹配AAA和BBB之间的数据 AAA 03 04 05 BBB   002、

  • linux 中 sed命令匹配特定字符之间的数据2022-07-17 21:35:20

      001、 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt 01 02 AAA 03 04 05 BBB 06 07 08 CCC 09 10 root@DESKTOP-1N42TVH:/home/test2# sed -n '/AAA/,/BBB/p' a.txt ## 匹配AAA和BBB之间的数据 AAA 03 04 05 BBB   002、

  • plink 软件中 --reference-allele 参数 用于设定参考等位基因2022-07-14 19:36:53

      001、 root@DESKTOP-1N42TVH:/home/test4# ls ## 测试数据 outcome.map outcome.ped root@DESKTOP-1N42TVH:/home/test4# cat outcome.map 1 SNP1 0 55910 1 SNP2 0 85204 1 SNP3 0 122948 1 SNP4 0

  • linux 中实现数据的每一列都对齐2022-07-13 22:33:58

      001、column -t实现 root@DESKTOP-1N42TVH:/home/test6# ls xxx.genome root@DESKTOP-1N42TVH:/home/test6# cat xxx.genome ## 测试数据 FID1 IID1 FID2 IID2 RT EZ Z0 Z1 Z2 PI_HAT PHE DST PPC RATIO 5 5 7 7 UN NA 0.433

  • linux 中awk命令实现字符串的精确匹配2022-07-08 22:01:58

      001、 root@DESKTOP-1N42TVH:/home/test3# ls test.txt root@DESKTOP-1N42TVH:/home/test3# cat test.txt ## 测试数据 AKCR02000001 df AKCR02000001 df AKCR02000001 er AKCR02000001.1 dg AKCR02000001.1 der AKCR02000001.1 fg AKCR02000001.2 ee AKCR0200

  • linux 中%.*、%%.*的意义2022-04-29 23:03:48

      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 ${a%.*} ## %.*的作用是删除变量最后一个.及其后的内容 aa.bb.cc   root@DESKTOP-1N42TVH:/ho

  • R语言中利用optparse包给函数传递参数2022-04-28 23:34:11

      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 <- list( make_option(c("-a", "--aa"), type = "character"), make_op

  • ubuntu中查看防火墙状态、关闭、开启防火墙2022-04-27 13:35:06

      1、查看状态 root@DESKTOP-1N42TVH:/home# ufw status ## 开启状态 Status: active   2、关闭防火墙 root@DESKTOP-1N42TVH:/home# ufw disable Firewall stopped and disabled on system startup root@DESKTOP-1N42TVH:/home# ufw status Status: inactive   3、

  • sshd: no hostkeys available -- exiting.2022-04-27 13:34:57

      1、问题, 在启动ssh服务是出现如下问题     2、解决方法 root@DESKTOP-1N42TVH:/home# ssh-keygen -A ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519   3、测试 root@DESKTOP-1N42TVH:/home# service ssh start * Starting OpenBSD Secure Shell server

  • QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'2022-04-27 01:01:51

      1、问题     2、解决方法 root@DESKTOP-1N42TVH:/home/test2# vim /etc/profile ## 在配置文件末尾追加如下两句 export XDG_RUNTIME_DIR=/usr/lib/ export RUNLEVEL=3   source一下: root@DESKTOP-1N42TVH:/home/test2# source /etc/profile    3、测试(刚才的问

  • linux 中调用shell脚本时指定工作目录为shell脚本所在的目录2022-04-26 23:34:22

      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:/home/test# cat /home/test2/test.sh ## shell脚本所在目录及内容 #!/bin/bash wc -l ./a.txt root@DESKTOP

  • linux 中 grep -q选项2022-04-24 18:01:18

      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 root@DESKTOP-1N42TVH:/home/test2# grep "s" a.txt ## 直接输出匹配结果

  • ubuntu: Network error: Connection refused2022-04-23 23:00:46

      1、问题: Network error: Connection refused     2、解决方法 root@DESKTOP-1N42TVH:~# /etc/init.d/ssh status * sshd is not running     3、 root@DESKTOP-1N42TVH:~# /etc/init.d/ssh restart * Restarting OpenBSD Secure Shell server sshd

  • linux 中实现每两列数据合并为一列数据2022-04-04 02:34:52

      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 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 ro

  • linux 中awk命令计算每行数据的和、平均数、最大值、最小值2022-04-04 01:01:14

      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:/home/test2# cat a.txt 3 1 4 2 1 2 6 3 2 1 3 3 root@DESKTOP-1N42TVH:/home/test2# awk '

  • 多组一列数据的处理2022-04-04 01:01:06

      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.5 chr344 0.53 0.596 0.65 0.68 root@DESKTOP-1N42TVH:/home/test3# awk -v RS='chr' 'NR!=1{

  • linux 中 awk NF的作用2022-04-04 00:39:49

      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:/home/test2# cat -A a.txt df gfdg$ $ df gg er$ ^I^I$ fd gg ww$ ^I^I$ kkkk jjjj$ root@DESKTOP-

  • linux中sed命令匹配特定字符之间的数据2022-04-04 00:08:33

      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、匹配AAA到BBB之间的数据 root@DESKTOP-1N42TVH:/home/test3# cat a.txt 01 02 AAA 03 04 05 BBB 06

  • linux中gzip解压文件并保留原始压缩文件2022-04-03 21:04:03

      1、直接解压, 不保留原始文件 root@DESKTOP-1N42TVH:/home/test# ls outcome.map.gz root@DESKTOP-1N42TVH:/home/test# gzip -d outcome.map.gz root@DESKTOP-1N42TVH:/home/test# ls outcome.map   2、解压并保留原始压缩文件 root@DESKTOP-1N42TVH:/home/test# ls outcom

  • linux 中sort命令 -k选项2022-01-10 12:31:37

    1、-k 指定域 + 位置 root@DESKTOP-1N42TVH:/home/test# ls a.txt root@DESKTOP-1N42TVH:/home/test# cat a.txt ## 测试数据 google 110 5000 baidu 100 5000 guge 50 3000 sohu 100 4500 root@DESKTOP-1N42TVH:/home/test# sort -k 1 a.txt ## 按照第一列排序 baidu 100 50

  • linux中实现将连续的多列数据合并为一列数据2022-01-08 20:35:27

    1、测试数据 root@DESKTOP-1N42TVH:/home/test# ls a.txt root@DESKTOP-1N42TVH:/home/test# cat a.txt 01 02 03 04 05 06 07 08 09 11 12 13 14 15 16 17 18 19   2、实现将连续的三列数据合并为一列数据 root@DESKTOP-1N42TVH:/home/test# ls a.txt root@DESKTOP-1N42TVH:/

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有