top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to create compressed tar file using bzip2 in Linux?

+3 votes
288 views
How to create compressed tar file using bzip2 in Linux?
posted Sep 30, 2013 by Vivek Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

bzip2 is another compression option we have which we can use with Linux tar command. its exactly similar with our earlier option of compressing using gzip but instead of "z" option we need to use "j" tar option to create bzip2 file as shown in below example of tar command in Linux.

$ tar -jcvf trading.tar.bz2 * currency equity
 stocks/ stocks/online_stock_exchanges.txt

$ ls -lrt trading.tar.bz2
 -rw-r--r--  1 stock_trader Domain Users 593 sep 18 13:11 trading.tar.bz2

.tar.bz2 is used to denote a tar file with bzip2 compression. for viewing contents of bzip2 tar file and extracting content we can use as shown in example of LINUX tar command with gzip compression, just replace "-z" with "-j" for bzip2.

answer Sep 30, 2013 by Arvind Singh
...