Skip to main content

How to Extract/Uncompress/Unarchive file in linux.

This is a no-frills Linux command line guide/cheat sheet that will help you extract or unarchive or uncompress just about any file that you’re bound to come across. If you’d like to have more options, read the man pages! Also, the opposite to this guide about creating/compressing/archiving files in Linux can be found here.
Preliminary:
Most compressed or archived files that you’ll come across already have built-in support under popular distributions (Ubuntu, Fedora, Suse, etc…), but some of them aren’t. I would recommend installing this group of packages using apt-get, yum, or an equivalent before using this guide (unless of course you already know what you need):

[root@localhost]# yum install -y unzip p7zip unrar bzip2 gzip lzma

1. *.tar
[root@localhost]# tar xvf filename.tar

2. *.tar.gz
[root@localhost]# tar xzvf filename.tar.gz

3. *.tgz
[root@localhost]# tar xvzf filename.tgz

4. *.tar.bz2 (Or maybe we mean *.tar.gz2)
[root@localhost]# tar xjvf filename.tar.bz2

5. *.tar.bz
[root@localhost]# tar xjvf filename.tar.bz

6. *.tbz
[root@localhost]# tar xjvf filename.tbz

7. *.tar.Z
[root@localhost]# zcat file.tar.Z | tar xvf -

8. *.tar.xz
[root@localhost]# lzcat filename.tar.xz | tar xvf -

9. *.gz
[root@localhost]# gunzip filename.gz

10. *.gz2 (Or maybe we mean *.bz2. It's the same way like untar *.bz2 above)

11. *.bz
[root@localhost]# bunzip filename.bz

12. *.bz2
[root@localhost]# bunzip2 filename.bz2

13. *.Z
[root@localhost]# uncompress filename.Z

14. *.xz
[root@localhost]# unlzma filename.xz

15. *.zip
[root@localhost]# unzip filename.zip

16. *.7z
[root@localhost]# 7z x filename.7z

17. *.rar
[root@localhost]# unrar x filename.rar

18 *.dmg
This isn’t a file that can be ‘extracted’ but you can mount and save the files using:
[root@localhost]# mkdir /mnt/source
[root@localhost]# mount -o loop -t hfs filename.dmg /mnt/source
[root@localhost]# cp /mnt/source/* /home/username/destination/

19. *.img, *.dd
These aren’t files that can be ‘extracted’ but you can mount and save the files using:
[root@localhost]# mkdir /mnt/source
[root@localhost]# mount -o loop -t iso9660 filename.img /mnt/source
[root@localhost]# cp /mnt/source/* /home/username/destination/

NOTES: "*" means to your filename which will to unpack. Example "testsource-12.1.0-1.tar.gz".

Comments

Popular posts from this blog

Karakteristik TCP dan UDP

Kali ini kita akan membahas tentang TCP dan UDP. Pada bagian ini, kita akan membahas tentang karakteristik masing-masing dari TCP dan UDP. Dengan mengenal TCP dan UDP, kita dapat tahu kapan kita akan menempatkan suatu protokol yang tepat dalam implementasi jaringan. 1.Kapan menggunakan TCP dan UDP?? DNS menggunakan TCP dan UDP di port komputer 53 untuk melayani permintaan DNS. Nyaris semua permintaan DNS berisi permintaan UDP tunggal dari klien yang diikuti oleh jawaban UDP tunggal dari server. Dan pada saat kapan protocol TCP digunakan? Umumnya TCP dipergunakanhanya ketika ukuran data jawaban melebihi 512 byte, atau untuk pertukaran zona DNS zone transfer. DNS zone transfer adalah sebuah mekanisme untukmereplikasi DNS data dari satu DNS ke DNS server lain. Zone transfer digunakan pada saat kita ingin mereplikasi DNS data pada DNS server kita dalam upaya menghemat bandwidth, untuk meningkatkankecepatan terhadap suatu permintaaan atau untuk membuat DNS data selalu tersedia pada saat
Did you ever got this error message, "Could not start the "application" Service service on Local Computer. Error 1069 : The Service did not start due to a logon failure.” I ever got this message when i try to start an application on windows server 2003 or NT. I try to retype the password in "services" menu. But, it still did not work. Now, i check the permission on file that refer to path that show in "services". And i set it to full access for everyone. And then, i back to the "services" menu again, and starting this. And it's working now. This issue show, it cannot to access the file on windows services. It needs to make sure that the files is able to execute. So if you got this message, try to register in Control Panel > Administrative > Services. And Type the password and start it after you put your password.