Register
It is currently Mon Sep 25, 2017 10:31 pm

Extract - is there a command?


All times are UTC


Post new topic Reply to topic  [ 13 posts ] 
Author Message
 PostPosted: Fri Feb 17, 2012 3:10 am   
Linux Guru
User avatar

Joined: Wed Jul 07, 2004 3:30 am
Posts: 7360
Location: Central Montana & Eastern Tennessee
This Linux Mint is kinda short when you do right clicks, there's no extract option on a right click when hovering over unetbootin. How do you extract from something when there is no .tar or .zip or whatever? I've got unetbootin in the Downloads folder, so if there is a CLI command to extract, I'd appreciate knowing about it. I can't find anything on the net nor in my Linux Bible.

_________________
Dell E6400 Lappy w/MX-15 LIVE
E7440 w/Debian 8


Top
 Profile  
 PostPosted: Fri Feb 17, 2012 9:49 am   
Moderator
User avatar

Joined: Sat Nov 15, 2003 10:24 pm
Posts: 2765
Location: The Diamond State
Do you have gzip?
Code:
gzip -d file.gz

Clik

_________________
openSUSE 11.4 (i586)
PCLinuxOS 2009 -2.6.26.8.tex3


Top
 Profile  
 PostPosted: Fri Feb 17, 2012 7:20 pm   
Linux Guru
User avatar

Joined: Wed Jul 07, 2004 3:30 am
Posts: 7360
Location: Central Montana & Eastern Tennessee
{I have downloaded p7zip, which the instructions said to use ......}
{Just checked, I don't have gzip ....... :wink:}

Sorry, I was doing that from my new antiX-base install - now I'm on the LM7 and it does have gzip :super:

I used gparted to format my USB drive, and there was no option for a vfat filesystem, only fat 32 - yet when I try to mount my USB (for some reason it won't automount like it did with LMDE) it tells me that fat32 is an unknown filesystem. Is there a command that I can use to remove the fat32 and change the filesystem to vfat?

_________________
Dell E6400 Lappy w/MX-15 LIVE
E7440 w/Debian 8


Top
 Profile  
 PostPosted: Sat Feb 18, 2012 8:59 pm   
Linux Guru
User avatar

Joined: Sat Apr 03, 2004 12:39 am
Posts: 12226
Location: Clinton Township, Michigan
JP, I am really surprised that you do not have gzip on your system. If you have a GNU tar implementation on your system, chances are it has some kind of zip included with it. Most systems that have a full set of utilities include compress and uncompress, but they also include zip and unzip, usually in the form of gzip and gunzip, which frequently are bundled with GNU Tar as well.

If you are using a Debian based system that does not directly include these packages, they are MOST CERTAINLY included in the Debian repositories, so they are a click away!

_________________
Brian Masinick
Distros: MX-16, antiX, Debian


Top
 Profile WWW YIM  
 PostPosted: Sun Feb 19, 2012 1:07 am   
Linux Guru
User avatar

Joined: Wed Jul 07, 2004 3:30 am
Posts: 7360
Location: Central Montana & Eastern Tennessee
masinick wrote:
JP, I am really surprised that you do not have gzip on your system. If you have a GNU tar implementation on your system, chances are it has some kind of zip included with it. Most systems that have a full set of utilities include compress and uncompress, but they also include zip and unzip, usually in the form of gzip and gunzip, which frequently are bundled with GNU Tar as well.

If you are using a Debian based system that does not directly include these packages, they are MOST CERTAINLY included in the Debian repositories, so they are a click away!


I installed it from the repos, so it's there now. I've finally got it extracted (I don't know how I did it, I started all over and skipped the extract part and away we went!). I'm having another difficulty right now, but I'm working on it. Soon, I hope to have Mepis on here and then I can start building the antiX core into a custom, like you show on your blog!

_________________
Dell E6400 Lappy w/MX-15 LIVE
E7440 w/Debian 8


Top
 Profile  
 PostPosted: Mon Feb 20, 2012 12:55 am   
Linux Guru
User avatar

Joined: Sat Apr 03, 2004 12:39 am
Posts: 12226
Location: Clinton Township, Michigan
Good deal; hope that takes care of your concern. Drop me a note if there are issues. One thing our forum usually does not include is Email for various threads. There are advantages to that - less excess Email, but disadvantages, too. If you miss a day here, you may miss something where someone is asking a relevant question. I've been busy lately, so I've missed several conversations until days later...

_________________
Brian Masinick
Distros: MX-16, antiX, Debian


Top
 Profile WWW YIM  
 PostPosted: Mon Feb 20, 2012 1:35 am   
Linux Guru
User avatar

Joined: Wed Jul 07, 2004 3:30 am
Posts: 7360
Location: Central Montana & Eastern Tennessee
It's all taken care of now, I finally installed antiX base, and when I did, for some reason the extract option showed up on the LM7, so I was able to finish the USB bootable Mepis drive. I also downloaded gparted and burned a live disk of that, saved all of my files on the 5Gb storage partition to CD,and used the gparted disk to wipe out all the different partitions out and start over on a clean hard drive. Now, I have a 50MB partition for a persistant Grub (next project :wink:) 1.5Gb parttition for swap, 5Gb partition for antiX core custom (thanks for the easy-to-follow tutorial), and a 30Gb partition for Mepis. It was a Sunday job and everything is working fine so far. After playing with the antiX install for a while, I may make some changes, and then start over with a clean install again .... we'll see! That was the most fun I've had since trying the Arch install, which went very smoothly, IIRC.

THANKS FOR YOUR HELP!
JP

_________________
Dell E6400 Lappy w/MX-15 LIVE
E7440 w/Debian 8


Top
 Profile  
 PostPosted: Tue Feb 21, 2012 4:24 am   
Linux Guru
User avatar

Joined: Sat Apr 03, 2004 12:39 am
Posts: 12226
Location: Clinton Township, Michigan
My pleasure, JP. Glad that all is well now.

_________________
Brian Masinick
Distros: MX-16, antiX, Debian


Top
 Profile WWW YIM  
 PostPosted: Thu Jun 09, 2016 1:06 pm   
Linux Guru
User avatar

Joined: Sat Apr 03, 2004 12:39 am
Posts: 12226
Location: Clinton Township, Michigan
A technique I use with one of the archive tools, "tar", is to pipe the contents of one file system to another. I can use this to backup a system, to restore a system, or to copy certain files, a group of files, a directory, or even a file system, from one location (internal or external) to another.

The basic syntax is:

(cd src && tar -cf - .) | (cd dest && tar -xpf -)

Even better, I found an article online that breaks all of this down nicely; I hope that it is helpful:

http://blog.extracheese.org/2010/05/the-tar-pipe.html

_________________
Brian Masinick
Distros: MX-16, antiX, Debian


Top
 Profile WWW YIM  
 PostPosted: Tue Jun 21, 2016 7:54 pm   
Site Admin
User avatar

Joined: Thu Apr 17, 2003 3:44 am
Posts: 12298
Location: Iowa
Put this in your .bashrc file...


Code:
extract ()
{
     if [ -f $1 ] ; then
         case $1 in
             *.tar.bz2)   tar xvf $1     ;;
             *.tar.gz)    tar xvf $1     ;;
             *.bz2)       bunzip2 $1      ;;
             *.rar)       unrar x $1      ;;
             *.gz)        gunzip $1       ;;
             *.tar)       tar xvf $1      ;;
             *.tbz2)      tar xvf $1     ;;
             *.tgz)       tar xvf $1     ;;
             *.zip)       unzip $1        ;;
             *.Z)         uncompress $1   ;;
             *.7z)        7z x $1         ;;
             *)           echo "'$1' cannot be extracted via >extract<" ;;
         esac
     else
         echo "'$1' is not a valid file"
     fi
}

Make sure you have the binaries installed for those, and then you can just type "extract SOMECOMPRESSEDFILE"  ;)

_________________

Zbook (Laptop)- Mint 18 64-bit - I7-4800mq - 32GB ram
Phantom (Desktop)- Mint 64-bit - i7-5770 - 32GB ram
Nas4Free (NAS) - 6X3TB File Server.
Sky (HP BladeCenter) - 16 blades - 536 GB ram-G7/G6/G5 blades.


Top
 Profile WWW  
 PostPosted: Wed Jun 22, 2016 12:42 pm   
Linux Guru
User avatar

Joined: Sat Apr 03, 2004 12:39 am
Posts: 12226
Location: Clinton Township, Michigan
Your extract routine is a handy one; thanks Dave! :-)

Keep in mind readers that you still need to have the various tools and utilities installed on your system in order for the bash extract module to work. Some distributions have packages with names like binutils that install some of the packages. Other stuff, like 7z compression utilities, usually come from elsewhere, and the details may vary, depending on the distribution and the specific archive format being used. If you review the utility packages you have either installed or available, it's generally possible to obtain tools that can support any of the formats that Dave has scripted above.

If you can't figure it out, let us know which system you are using and as much as you can about what is installed, and we'll work with you to figure it out and get it right.

_________________
Brian Masinick
Distros: MX-16, antiX, Debian


Top
 Profile WWW YIM  
 PostPosted: Thu Jul 21, 2016 4:59 pm   
. . . .
User avatar

Joined: Mon Apr 21, 2003 3:56 pm
Posts: 8229
My last download of Unetbootin (about July 4, 2016, direct from https://unetbootin.github.io/) was a single file executable, sent with permissions stripped back. I only had to chmod 770 and then Unetbootin worked just fine, although the graphics were a bit Windows 3.1-ish.

_________________
eMachines T5246 AMD 64 X2 w/Point Linux 3.2 Mate desktop for AMD64
EeePC 900A w/ Kubuntu 14.04 32 bit
Dell Inspiron 1545 w/Devuan Jesse 1.0RC2


Top
 Profile  
 PostPosted: Fri Jul 22, 2016 12:37 pm   
Linux Guru
User avatar

Joined: Sat Apr 03, 2004 12:39 am
Posts: 12226
Location: Clinton Township, Michigan
A few "take away" comments from the overall discussion:

1. IF you are planning to perform any archive or extract functions on files with any of the extensions listed in Dave's script, make sure you have at least the minimal number of programs available to perform the tasks. To me, I'd want to see GNU tar installed, as well as gzip (which should also include gunzip), and as you can see, the list really ought to include: tar, bunzip2, unrar, (un)compress, as well as the 7zip and traditional zip and unzip. No need for these unless you are actually going to use them, but what about the cases where you don't usually use or need such tools, except "in an emergency"? I'd at least keep a "tool-based" distribution, maybe a "Swiss Army Knife" distribution like KNOPPIX available on DVD or USB to cover those special cases.

2. When you want to run any kind of program, typically that program should have "the executable bit - 'x'" enabled. File permissions such as 700, 750, or 755 allow execution by the user, user and group, or user, group and world, and the chmod command will add the permissions necessary. A chmod +x followed by the filename is one way to do it, but that may not provide the correct permission grade on certain system files, where, for security purposes, only user (with that user usually root or another privileged account) is granted executable access, and in some cases, that privileged account gets the ONLY access. Read and research to make sure that you understand what these statements mean and imply. (NO group or world access is allowed when restricted access must be maintained).

_________________
Brian Masinick
Distros: MX-16, antiX, Debian


Top
 Profile WWW YIM  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Powered by phpBB © 2012 phpBB Group
© 2003 - 2012 USA LINUX USERS GROUP