YXF-biostar 基本命令

作者: 大宝贝喜欢徐先生 | 来源:发表于2017-10-28 19:26 被阅读15次

Example in this note: home/yxf/edu/lecture

The Unix bootcamp

  1. ls: list of files and directories in home directories
  2. pwd: Which directory you are working at
  3. mkdir: make new directory
    mkdir edu
  4. cd: change directory A to directory B.
    cd edu----change current directory to edu directory
  5. Back to home: cd / (cd /, cd ~ is same)
    cd home
    cd yxf
    or: cd /home/yxf
  6. cd .. : Navigate upward directory
    cd edu
    pwd: /home/yxf/edu
    cd ..
    pwd: /home/yxf
  7. Absolute path: No /
    Relative path:
  8. manual command: man ls
    man cd
    man man
  9. rm: remove directories
    rm ~/edu/lecture/
    rmdir data
    cd ..
    rmdir lecture
  10. touch: creat new empty file
    cd edu
    touch heaven.txt
    touch earth .txt
    ls
  11. mv(1): move file
    mkdir temp
    mv heaven.txt temp
    mv earth.txt temp
    ls temp
  12. mv(2): remame file (another function)
    tough rags
    ls
    mv rags temp/riches
    ls temp
  13. mv(3): move directories
    mv temp temp2
    ls temp2
  14. rm: remove file
    cd templs
    rm -i earth.txt heaven.txt rags (Function of "i" command-line option is to ask for confirmation)
  15. cp: copy files
    touch file1
    cp file1 file2 ---in same directory
    ls
    touch ~/edu/file3
    cp ~edu/file3 ~/edu/lecture/
  16. echo: put text in a file and view it
    ecoh "call me king"
    call me king
    ecoh "call me king" > oening_line.txt
    ls
    more opening_line.txt-----view content of file
  17. cat: combine multiple files
    echo "the primroses were over." >> opening_line.txt
    cat opening_line.txt

Data analysis

  1. Download data online (file name is "SGD_features.tab")
    At first make a new directory (lec03) and then download data in new directory
  2. View data
    more SGD_features.README
  3. Open stream from data
    cat SGD_features.tab
  4. Check how many lines in the file
    cat SGD_features.tab | wc -l
    "cat SGD_features.tab | wc" or "wc -l SGD_features.tab" will check the number of lines, words and characters
  5. Search desired data:
    grep: which lines match a certain pattern
    cat SGD_features.tab | grep YAL060W ----Find information on gene YAL060W
    cat SGD_features.tab | grep YAL060W --color=always | head ----Highlight the matched pattern
  6. Search data without a given pattern
    cat SGD_features.tab | grep -v Dubious | wc -l ---- the number of lines which not contain "Dubious"
  7. Store result in a new file
    ">" character is redirection
    cat SGD_features.tab | grep YAL060W > match.tab
  8. How to select gene
    "cut" is used to select certain colimn of gene
    cat SGD_features.tab | cut -f 2 | head ----select data of column 2
    cat SGD_features.tab | cut -f 2 | grep ORF | wc -l ----how many ORF gene
    cat SGD_features.tab | cut -f 2,3,4 | grep ORF | head ----select multiple columns
  9. How many feature types are in this data
    Make a new file for this feature type(ORF): cat SGD_features.tab | cut -f 2 > types.txt
    ?sorting
    ?unique

Compressed files and directories

  1. Compressed format
    Single file : .gz, .bz, .bz2, .zip
    Multiple files: .tar.gz, .tar.bz2
  2. How to compress or uncompress a file
    data: AF086833.fa
    compress: gzip AF086833
    uncompress: gunzip AF086833.fa.gz
  3. How to compress or uncompress multiple files
    data: AF086833.fa, AF086833.gb
    Compress format: tar czfv archive-name list-of-files-that-go-into-the-archive
    czfv: creat a compressed file in verbose mode
    tar czfv sequences.tar.gz AF086833.fa AF086833.gb
    Or: tar czvf sequences.tar.gz AF086833.*
    Better way: mkdir sequences
    mv AF086833.* aequences/
    tar czvf sequences.tar.gz sequences/*

管道命令:就是多个命令联用,上一个命令的输出是下一个命令的输入。通俗来讲就是命令A的数据结果就是命令B的输入数据,两个命令之间以管道符“|”连接

相关文章

  • YXF-biostar 基本命令

    Example in this note: home/yxf/edu/lecture The Unix bootc...

  • linux常用命令

    命令基本格式 文件处理命令 文件搜索命令 帮助命令 压缩与解压缩命令 关机和重启命令 其他常用命令 命令的基本格式...

  • Linux基本命令分类

    目录 Linux基本命令 一、文件基本操作命令 1. ls命令 2. pwd命令 3. mkdir命令 4. ...

  • Lesson 004 —— Linux 基本命令

    Lesson 004 —— Linux 基本命令 Linux 命令格式 一些基本的命令 ls: list,列出当前...

  • MongoDB基本命令

    MongoDB基本命令 help命令: db.help()命令:

  • 基本命令

    Linux 基本命令(linux命令是用户告诉计算机去执行什么操作的指令) 命令的格式 命令的分类 基本命令 1....

  • docker 基本命令

    一,关于docker镜像操作的基本命令 二,关于docker容器操作的基本命令 三,关于docker仓库操作的基本命令

  • ZK zookeeper客户端命令行操作

    1 基本语法 命令基本语法功能描述help显示所有操作命令ls path [watch]使用 ls 命令来查看当前...

  • MongoDB--周国康笔记

    1. MongoDB命令帮助系统 2. 基本命令及实例 一基本命令 二基本DDL和DML 三启动与终止 四安全管理...

  • 基于简书的Markdown语法的测试文章-命令行与git的阶段性

    目录 命令行、git与github的基本概念 命令行的常用命令 git的基本命令 什么是命令行 维基-命令行界面 ...

网友评论

    本文标题:YXF-biostar 基本命令

    本文链接:https://www.haomeiwen.com/subject/tswspxtx.html