How to unzip .bz2 files in UNIX Server ?
*Make sure your server got bzip2, or Install bzip2 first.
- Install bzip2 in UNIX
# cd /usr/ports/archivers/bzip2
# make install clean
# rehash
- Go to the file path and run this command:
# bzip2 -d filename.bz2
*
This will an uncompressed file in the current directory called ‘file’ and will delete the original bz2 archive. If you want to keep the original file, add the -k option like:
# bzip2 -dk filename.bz2
A useful option for bzip2 is the -c switch which causes bzip2 to write the uncompressed output to stdout which can easily be redirected to another option. For instance, to search the compressed file file.bz2 for the string tech-recipes, use:
bzip2 -dc file2.bz2 | grep tech-recipes
How to unzip .bz2 in Linux Server?
- Go to the file path and run this command:
# nohup bunzip2 filename.bz2 &
0 comments:
Post a Comment