Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Unzipping and Unraring

  1. #1
    Join Date
    Jun 2008
    Location
    Formerly DE, now Antigua, W.I.
    Posts
    191

    Default Unzipping and Unraring

    I can unzip or unrar a file without a problem, but how can I do the same for multiple zipped or rared files, without losing some of the contents.

    When I try to do so, by selecting several zipped or rared files then right click then click on either "Extract here" or "Extract to Subfolders" the process starts without a problem. However, after everything has been extracted, and I have a look at the contents of the folders which have been extracted, I see that they are either empty or only have a few files.

    I will get zipped files, photos from my brother, with upto 200 - 300 pictures, the whole zipped or rared files ends up being about 150MB - 200MB. If I get 3 or 4 such files, as I did after he came back from his trip to Australia, and sent 10 such files with over 1500 photos, I had to unzip each file individually, since when I tried to do 2 or more at a time, I managed only to extract a few pictures per zipped file.

    Anyone know a solution?

    Thanks.

  2. #2
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: Unzipping and Unraring

    > Anyone know a solution?

    patience? (do one, look at its photos (whatever) while the second is
    unpacking, etc..)

    --
    DenverD (Linux Counter 282315) via NNTP, Thunderbird 2.0.0.14, KDE
    3.5.7, SUSE Linux 10.3, 2.6.22.18-0.2-default #1 SMP i686 athlon

  3. #3
    Join Date
    Jun 2008
    Location
    Formerly DE, now Antigua, W.I.
    Posts
    191

    Smile Re: Unzipping and Unraring

    That's what I have been doing so far. I'm patient enough now, I've had all that practice. I want to do more files and I want to do them now.

  4. #4
    Chris Maaskant NNTP User

    Default Re: Unzipping and Unraring

    silkmaze schreef:

    > I can unzip or unrar a file without a problem, but how can I do the same
    > for multiple zipped or rared files, without losing some of the contents.
    >
    >
    > When I try to do so, by selecting several zipped or rared files then
    > right click then click on either "Extract here" or "Extract to
    > Subfolders" the process starts without a problem. However, after
    > everything has been extracted, and I have a look at the contents of the
    > folders which have been extracted, I see that they are either empty or
    > only have a few files.


    I have the same problem with rar files that contain a space in the archive name.
    To unpack it I resort to the command line:
    rar x "bla bla001.rar" ~/home/chris/someplace
    --
    Chris Maaskant

  5. #5
    Join Date
    Jul 2008
    Location
    Voorhout, Netherlands
    Posts
    262

    Default Re: Unzipping and Unraring

    silkmaze wrote:
    > I can unzip or unrar a file without a problem, but how can I do the same
    > for multiple zipped or rared files, without losing some of the contents.
    > When I try to do so, by selecting several zipped or rared files then
    > right click then click on either "Extract here" or "Extract to
    > Subfolders" the process starts without a problem. However, after
    > everything has been extracted, and I have a look at the contents of the
    > folders which have been extracted, I see that they are either empty or
    > only have a few files.


    Maybe some day you develop enough courage to run an xterm with a shell
    in it, like bash, zsh or ksh.
    Then you discover that with a single line in this shell you can do tasks
    many times faster and easier than in a GUI file manager.

    > I will get zipped files, photos from my brother, with upto 200 - 300
    > pictures, the whole zipped or rared files ends up being about 150MB -
    > 200MB. If I get 3 or 4 such files, as I did after he came back from his
    > trip to Australia, and sent 10 such files with over 1500 photos, I had
    > to unzip each file individually, since when I tried to do 2 or more at a
    > time, I managed only to extract a few pictures per zipped file.
    >
    > Anyone know a solution?


    e.g. with
    for file in *.zip;do unzip "$file";done
    Or, even shorter,
    unzip *.zip
    As unzip knows how to process the files in order when supplied with a
    wildcard.

  6. #6
    Join Date
    Jun 2008
    Location
    Formerly DE, now Antigua, W.I.
    Posts
    191

    Default Re: Unzipping and Unraring

    I did the same thing with windows, but I didn't realise that I could run unzip in the command line. Can I run it in any directory or do I have to be in a specific directory, where unzip is stored, in order to run it?

    Can I do the same with rar, is there a unrar for the cli or do I use unzip to extract from rar files as well?

  7. #7
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Unzipping and Unraring

    You can run unzip from anywhere, but usually you want to be in the directory where the zip file is because the files will be unpacked underneath or in the same directory. Similarly for unrar.

    One small correction to the last post. You want to quote the wildcard:

    Code:
    unzip '*.zip'
    Otherwise unzip will treat the second and subsequent files as filenames to be extracted and of course that will not work.

  8. #8
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: Unzipping and Unraring

    > You can run unzip from anywhere, but usually you want to be in the
    > directory where the zip file is


    if unpacking multiple compressed files you have to be prepared when
    (for example) two or more archives include a file named README or
    ATT0001.JPG, then you are gonna have to make a decision to overwrite
    or skip..

    btw, if you were 'comfortable' at a M$ command line you should LOVE
    it here...much more power here (yep, will take a while to learn the
    new lingo, but POWER!!)..

    again i throw out that word: just takes a little _patience_ to learn
    the new chants...or, you can avoid the pain by stuffing what you are
    used to into /etc/bash.bashrc.local, like:

    alias cd..='cd ..'
    alias copy='cp -i'
    alias rename='mv -i'
    alias md='mkdir'
    alias rd='rmdir -i'

    [note: some (all?) of those on the left of the equal sign might not
    be from M$, since i left them in '95...maybe those are from
    Warp...don't recall now..]

    --
    see caveat: http://tinyurl.com/6aagco
    DenverD (Linux Counter 282315) via NNTP, Thunderbird 2.0.0.14, KDE
    3.5.7, SUSE Linux 10.3, 2.6.22.18-0.2-default #1 SMP i686 athlon

  9. #9
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Unzipping and Unraring

    Good thinking. Another way would be to unzip each file in its own directory so that there would be no clashes on unzipping and then you would have to reconcile any clashes later. Say you have a bunch of zip files in the current directory. First make a directory named after the zip file without the .zip, then unzip in that directory using the -d option to unzip.

    Code:
    for i in *.zip
    do
      mkdir "${i/.zip}"
      unzip -d "${i/.zip}" "$i"
    done
    The idiom ${i/.zip} means $i with .zip replaced with nothing, i.e. removed from string.

    It pays to read man pages, because you will then sometimes go ah, now I understand why that option was invented.

  10. #10
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: Unzipping and Unraring

    but, i _thought_ the purpose of his first post was to do them all at
    the same time (which is why i said 'patience')...

    hmmmmmm...i guess if i knew how to write a script i could make one
    which would 'look at' all the archive file names in a directory and
    1) make a sub directory for each, with the same name as the archive
    (as long as no directory with that name already exists) and 2) unpack
    each..

    all with ONE command....or even with one CLICK....if that click
    directed the script to look in an always used (for example)
    /home/[user]/archives_to_be_unpacked

    THEN silkmaze could get back to being impatient.. ;-)

    --
    see caveat: http://tinyurl.com/6aagco
    DenverD (Linux Counter 282315) via NNTP, Thunderbird 2.0.0.14, KDE
    3.5.7, SUSE Linux 10.3, 2.6.22.18-0.2-default #1 SMP i686 athlon

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •