ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [linux bash shell] bz2 풀기
    Bioinformatics solution/Linux related 2018. 8. 23. 09:48
    728x90
    반응형
    SMALL

    bz2를 bzip2로 압축해제 하는것을 추천



    bzip2 -d filename.bz2
    


    위의 명령어는 원래 파일이 없어진다.

    원래 파일을 보존하기 위해서  -k option 을 이용한다.

    bzip2 -dk filename.bz2


    -----------------------------------------------------------------------------------------------

    bzip2

    to compress and decompress files

    Examples


    compress
     files (original file will be removed after compression) 

    bzip2 myfile.txt
    bzip2 *.txt


    keep the original file (option -k)
    bzip2 -k myfile.txt

    as pipe
    bzip2 -c myfile.txt > myfile.txt.bz2


    extract/decompress
    to view the compressed file (decompress to standard output), original file keeps unchanged 
    bzcat myfile.txt.bz2

    to decompress .bz2 files, use option -d (.bz2 file will be removed)
    bzip2 -d myfile.txt.bz2  


    more bz commands
    bzgrep, bzcmp, bzdiff, bzcat, bzless, bzmore

    Seq-Examples

    compress all .fastq files
    bzip2 *.fastq

    to view the first 20 lines of a bzip2 compressed .fastq file 
    bzcat sample.fastq.bz2 | head -20

    tar.bz2

    compress all files of a directory in one compressed .tar.bz2 archive-file (option -j for bzip2 compression)
    tar -jvcf compressedFiles.tar.bz2  directory_orig_files/  # -j for bz2
    tar -zcvf compressedFiles.tar.gz directory_orig_files/    # -z for gzip
    compress a set of files (without directory)
    tar -jvcf compressedFiles.tar.bz2  file1.txt file2.txt file3.txt
    tar -jvcf compressedFiles.tar.bz2  *.txt

    join paired read sequence files into a single compressed sample file
    tar -jvcf sample.tar.bz2  sample_1.fastq  sample_2.fastq

    decompress .tar.bz2 files
    tar -jvxf sample.tar.bz2 

    to decompress in a pipe, extract files to standard output (option -O)
    tar -jxOf sample.tar.bz2 | head -20   # views the first 20 lines

    list content (all files) of a .tar.bz2 archive
    tar -tf sample.tar.bz2
    sample_1.fastq  
    sample_2.fastq


    extract single file from .tar.bz2 archive
    tar -jvxf sample.tar.bz2 sample_1.fastq
    sample_1.fastq  


    728x90
    반응형
    LIST

    댓글

Designed by Tistory.