Ubuntu :: Writing A Script That Unzips An Archive?

Apr 8, 2010

I'm writing a script that unzips an archive, edits it, and zips it back up.

That being said, I've got it all figured out except for the zipping it back up.

Code:
unzip file.zip -d /tmp/foobar
##regexes###

Now when i get to zipping the files back up, I don't want to include the /tmp/foobar directory I created. I want it to have the same tree as before.

I've gotten two commands to come close, but not what I want.

Code:
zip -r /tmp/file.zip /tmp/foobar/*

- this zips up the folders and files within /tmp/foobar/ however, it includes the /tmp/foobar tree.

Code:
zip -rj /tmp/file/zip /tmp/foobar/*

- this gets rid of the directories, however, it gets rid of ALL the directories, and doesn't preserve any within /tmp/foobar.

Now, by default zip will ignore /tmp/foobar if you're in that directory and running zip from there. But since this is a script I don't want to be limited to where I can run the script, or lower my standards to including changedirectory lines in my script. It seems to me like I should be able to 1-liner it.

View 9 Replies


ADVERTISEMENT

Ubuntu :: Zip File Gvfsd-archive / Archive Mounter Read Write Mode

Dec 6, 2010

I'd like to ask about archive mounter feature, can I mount zip file with read write mode? can gvfsd-archive do that?, or I must use fuse-zip to mount it? If I must use fuse-zip, how I wrap it so I can use it via nautilus or via gvfs-fuse-daemon

View 4 Replies View Related

General :: Get Error "does Not Look Like A Tar Archive" When Attempt To Verify An Archive Using Tar?

Jul 13, 2011

I am new to the world of linux and when attempting to verify a tar archive I am displayed the following error. When running the command tar cvfW archivename.tar filename directoryname does not yield any errors.

View 1 Replies View Related

Ubuntu :: Downloading Programs - The "Archive Manager" Comes Up And Says "An Error Has Occured While Loading The Archive"?

Jan 10, 2010

I'm new to Ubuntu, and everytime i've tried to download a program like iTunes, the "Archive Manager" comes up and says "An Error Has Occured While Loading the Archive". how to fix this or download programs ?

View 7 Replies View Related

Ubuntu :: How To Password An Archive?

Jan 8, 2010

I need to know, how can I make an archive passworded, that means, I will set a password for this archive and nobody can open it without this password. The archive is .tar.bz2.

View 4 Replies View Related

Ubuntu :: How To Set Up The Files Instead The Archive

Jan 31, 2011

[url] I really love that conky config. But I can't figure out how to set up the files instead the archive.

View 1 Replies View Related

Ubuntu :: Can't Install RAR Archive

Feb 17, 2011

I'm trying to extract an RAR file which has my stuff on it from university, they use Windows Vista Ultimate so i thought i would be safe when saving my work to my flash drive. So i saved my work with the program winzip. when i got home i put in my flash drive and asked Kubuntu to extract only to find i don't have a RAR program to extract so i asked to install one via the Kpackage Manager and everything seemed fine so i asked it to extract again and said cannot extract unknown file. so i went through the terminal to install again and to make sure they were no bits of the install missing and i got this.

robert@HP-COMPAQ-LINUX-KDE:~$ sudo apt-get install unrar-nonfree
[sudo] password for robert:
Reading package lists... Done
Building dependency tree
Reading state information... Done

Package unrar-nonfree is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'unrar-nonfree' has no installation candidate robert@HP-COMPAQ-LINUX-KDE:~$

Is there any other way of extracting my work as i need to get my essay open and finnish it before monday. Also why is it saying that the package is missing? and what is the other source? Is there a way to decrypt this RAR file that vista has made?

Also one more thing once ive managed to decrypt and extract my work what is the reccomended format to between vista and kubuntu so i wont get anymore issues?

View 4 Replies View Related

Ubuntu :: Error: There Is No Such Archive?

Apr 30, 2010

7-Zip 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30
p7zip Version 9.04 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)

Error: there is no such archive

this is what i got when i tried to download cinema 4d on my computer 40 mins. ago, is something im not doing that makes this happen because this happens more often than not, i go through a lengthy download and get errors, im sorry ive only been on here for 2 weeks tops and already bothered you all 4 times.

View 2 Replies View Related

Ubuntu :: How To Archive My Music Files

Feb 28, 2010

I have a ton of music that I would like to upload to an on-line storage site. Ideally, I would like to keep the file organization structure intact, but am limited to 50mb file size.

Is there a way to compress this whole directory without going through and compressing every folder individually, while maintaining less than a 50mb file size?

View 2 Replies View Related

Ubuntu :: Unable To Install RAR Archive

Apr 17, 2010

I'm trying to extract an RAR file which has my stuff on it from university, they use Windows Vista Ultimate so i thought i would be safe when saving my work to my flash drive. So i saved my work with the program winzip. when i got home i put in my flash drive and asked Kubuntu to extract only to find i don't have a RAR program to extract so i asked to install one via the Kpackage Manager and everything seemed fine so i asked it to extract again and said cannot extract unknown file. so i went through the terminal to install again and to make sure they were no bits of the install missing and i got this.

robert@HP-COMPAQ-LINUX-KDE:~$ sudo apt-get install unrar-nonfree
[sudo] password for robert:
Reading package lists... Done

[code]....

Is there any other way of extracting my work as i need to get my essay open and finnish it before monday. Also why is it saying that the package is missing? and what is the other source? Is there a way to decrypt this RAR file that vista has made? Also one more thing once ive managed to decrypt and extract my work what is the reccomended format to between vista and kubuntu so i wont get anymore issues?

View 1 Replies View Related

Ubuntu :: Can't Unrar Split Archive

Jun 18, 2010

I recently downloaded a program to find out it was in pieces. What I originally conceived as being a small problem has turned into a major time wasting dilemma.

I've tried many different things to get it to properly extract, viewing threads on these forums even, but to no avail.

The files were named:
file.part01.rar
file.part02.rar etc.

I though this was the problem so I renamed all 84 files (except the first one), removing the .rar extension. No cigar.

My final attempt of several was using 7zip:

Code:
7z x myArchive.rar -o/home/[username]/Desktop

I was in the correct folder as far as I could tell.

I have included a screenshot of the files in order to stop any confusion about my description.

View 3 Replies View Related

Ubuntu :: Extracting Archive From Cdrom

Jul 31, 2010

I am trying to install MySQL, Apache, and PHP onto my Linux Ubuntu laptop from a cdrom that I got from a teach yourself MySQL, Apache, and PHP book I bought. First off there were two steps which i think i did right. The first was to mount the CD-ROM under /mnt in my file system which i did and there seems to be no problem except for the reply "mount: block device /dev/sr0 is write-protected, mounting read-only"

now first of all there are two things I need to explain, first of all I was superuser for all of this by using the command su at the beginning of my terminal session. Second of all the symbol "|" on my line of code above looks different from the symbol in the book. It should have a small space in the middle of it. However it looks like this on my keyboard so I am assuming it is simply a difference in text font. That is it, it would be really nice to figure out what went wrong because to be honest I am curious as to why the book is giving me code that gives multiple errors.

View 4 Replies View Related

Ubuntu :: Archive Manager Not Working In 11.04?

May 2, 2011

I have upgraded from 10.10 to 11.04 and I am using the classic ubuntu interface instead of Unity. I am facing problems with the Archive Manager. My problem is that I can open archives but I can not modify them or create a new zip file with the GUI. I get an error saying:

zip error: Invalid command arguments (no such option: -)

The easiest way to reproduce it is by right-clicking on any file, pressing compress and selecting .zip in the file format.

View 1 Replies View Related

Ubuntu :: ZIP File Cannot Be Opened As Archive

Jun 20, 2011

I'm not 100% sure if this is the right spot for it, but I'm having trouble unzipping files. I've downloaded a good few fonts from dafont.com, from different authors and with different browsers and I still get errors. First I opened the .zip with Archive Manager

Code:
7-Zip 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30
p7zip Version 9.04 (locale=en_ZA.utf8,Utf16=on,HugeFiles=on,2 CPUs)
Error: /media/42E6F8E2366C0906/Fonts/panhead.zip: Can not open file as archive
Errors: 1

I then tried
Code:
ross@Ross-PC:~$ unzip /media/42E6F8E2366C0906/Fonts/panhead.zip
and got this output
Code:
Archive: /media/42E6F8E2366C0906/Fonts/panhead.zip
End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive.
unzip: Cannot find zipfile directory in one of /media/42E6F8E2366C0906/Fonts/panhead.zip or /media/42E6F8E2366C0906/Fonts/panhead.zip.zip, and cannot find /media/42E6F8E2366C0906/Fonts/panhead.zip.ZIP, period.

I do have p7zip-full installed, but it isn't a .7zip file?

View 8 Replies View Related

Ubuntu :: Zip And Jar Files Both Detected As Zip Archive?

Jun 22, 2011

As you may know JAR file are zip archive, therefor I can't set my Ubuntu to open (by defualt) JAR file with Java and ZIP files with Archive Manger.

View 6 Replies View Related

Ubuntu :: Mount An Iso With Archive Mounter?

Jul 17, 2011

I am trying to mount an iso with Archive Mounter. It works but I can't see it in /media.What's the problem with that?

View 5 Replies View Related

Ubuntu :: Recursively Deleting Files From Within Archive

Feb 2, 2010

I've got a directory of geographic data with ~2,000 archives. Each archive (e.g. foo.zip) has two files, the second of which I'd like to remove:

Now, I can remove the _num.tif file with the command:

How do I do this with ALL the files in the directory? If I try the -r (recursive) option, that fails with -d.

View 4 Replies View Related

Ubuntu :: Split A Tar Archive Into Multiple Parts ?

Feb 11, 2010

Is there any way to split a tar archive into multiple parts?

View 1 Replies View Related

Ubuntu :: Set File Roller As Default Archive App?

Mar 10, 2010

I was messing with Openbox, LXDE, and Pekwm a couple days ago to see if I liked any of them, but I ended up coming back to gnome.

But it seems that, somehow, some of my preferred apps settings got wiped during this process.

The most annoying one, is I have no default application for archives (zip, tar.gz, etc). I can tell Ubuntu to "Open With..." and that works... but it doesn't stick.

How can I return this back to normal Ubuntu behavior?

UPDATE: It appears that nearly ALL my preferred application settings are gone. Pretty much everything except couple filetypes show up with the standard "file" icon and won't open unless I use "open with".

View 6 Replies View Related

Ubuntu :: BasKet Notepad Archive Glitch?

Apr 23, 2010

I've been using BasKet Notepad for about two years now on a Dellbuntu Mini-9. I just installed Mint8 Xfce and finished installing all my preferred apps this morning, including Basket. Unfortunately, when I tried to import my archive from the old system (saved on a thumb), it fails to recognize it as an archive file. At first I thought it might be linked ot its apparent inability to recognize the thumb drive, so I transferred the file to the SSD, extracted it, etc. All the files are there, it seems, but the individual baskets are all saved as .html files. There doesn't seem to be any "archive" as such that I can import.

Now the weird thing is that I've imported the archive before, back into Basket on the dellbuntu version of 8.04, without any problem. What gives? This is my research. For my dissertation. While I'm heartened that it still exists, I am more than a little annoyed at the notion that I might have to cut and paste every damn basket into the system (which I've already done once when I tried to put the notes on my home desktop XP system. I am returning to the field in five weeks and really want these things accessible. Is there any help for this?

View 1 Replies View Related

Ubuntu :: Extract Certain File From 7z / 7zip Archive?

May 3, 2010

I have a 7zip archive and I would like to extract certain files from with it. Is there a way to do this without un-compressing the entire archive? I know these files exist in there because I am using the "7za l" command to view the files contained in the archive.

View 3 Replies View Related

Ubuntu :: Path Of Iso Mounted Using Archive Mounter?

Jul 15, 2010

O need to enter a file path into a program (happens to be AcidRip DVD Extractor) of a disc that I wish to access. I have a particular ISO image that I'm mounting (happens to be a DVD I want to watch on my TV via a USB drive so I need to rip the DVD to a video file such as xvid), but when I mount it using the Archive Mounter that comes standard in Ubuntu 10.04, I can't figure out where the ^@%! it's mounted or how to set where I want to mount it.

View 9 Replies View Related

Ubuntu :: Can't User The Location Of The Unpacked Archive?

Aug 5, 2010

I'm not sure weather it's possible or not, but would it be possible to make a script that goes the the directory typed into the terminal, as I'm making a script that is newbie-friendly for compiling software. Anyway, would it be possible to make the script unzip the package typed into the terminal when prompted, and if so, how.

EDIT: Also, if the user says they've already extracted the archive, but haven't compiled, could it ask the user the location of the unpacked archive.

View 2 Replies View Related

Ubuntu Servers :: RSYNC With Archive Backup

Sep 15, 2010

I have a Linux host acting as an ISCSI server for a Windows box. I want to keep an off site backup, so I figure rsync will keep the ISCSI server synced with an offsite Linux host. I understand that Rsync does block level incremental transfer to conserve bandwidth ok, awesome.The trick is, that I also want an archival copy kept. Say I want to go back to a revision of a file from 10 days ago, I need to be able to do that.

I was planning on using Backup Exec, since we currently have a licensed copy. Throw the archives from Backup Exec onto the ISCSI server as well, and have it keep a rotating 30 day backup, or something like that. The issue I see here is that this will be creating a deleting files as it does its daily backup rotation. I'm guessing RSYNC will see these as new files, and likely retransmit everything on a daily basis. The question then becomes, is this assumption correct, or will it still know to do a block level incremental transfer even when file names and such are changing?

View 5 Replies View Related

Ubuntu / Apple :: How To Open A .sitx Archive

Oct 13, 2010

I received a .sitx archive and cannot yet find a way to open the archive. Anyone successful at opening a .sitx? How did you do it? What did you use?

I have searched through [URL] without success. It is a guide to switching from Mac to Linux.

View 3 Replies View Related

Ubuntu :: Open Every Directory In ARCHIVE MANAGER: C?

Nov 15, 2010

Every shortcut... every program... every link... everything opens in Archive Manager. And then it reports that the archive is not supported... I gotta launch everything directory related through a terminal just to get to navigate through a window manager.

View 2 Replies View Related

Ubuntu :: Setting Automatic Archive In Evolution?

Feb 9, 2011

Is it possible to set automatic archive periodically ala outlook? My server has very limited storage so I would like to delete messages from server but keep them locally.

View 2 Replies View Related

Ubuntu :: How To Work File On Archive Manager

Feb 27, 2011

[URL]...I open the file and it shows a bunch of files and I dont know how to make it install for my login. What am I suppose to do?

View 1 Replies View Related

Ubuntu :: Open A 7z Multi Volume Archive From Gui?

Mar 6, 2011

Does anyone know of a way to open a 7z multi volume archive from gui?

View 2 Replies View Related

Ubuntu :: File Roller - Could Not Create Archive

Mar 9, 2011

I am using Ubuntu 10.10 and I started to have a kind of annoying problem with file-roller. I do not know what I attempted to unpack or pack form my USB HDD a couple of days ago, but when I did I got a message from the archive manager, the message was: "Could not create the archive, Archive type not supported." Well, I just shrugged, and continued doing whatever I was doing, but later I noticed that whenever I tried to open the HDD for whatever reason from "PLACES" in the main panel, I was getting the same error message over and over again.

It is not produced when I open the HDD from the Desktop link in my Desktop, that link will open the HDD with no problems. But if I try to access the HDD from "PLACES" in the main panel I will always get the same error message. Ok, what have I tried: since the archive manager window shows the "file-roller" logo in the menu button, I assumed that file roller is stuck with the previous process for which it produced an error, therefore I tried to "kill" any pending processes by several ways: Login-off, re-starting and turning the computer off.

That did not worked. Whenever I attempted to open the HDD from "PLACES" the same error "Could not create the archive, Archive type not supported." will return. Assuming that nautilus was stuck with the process I tried to kill any pending processes by using Alt+F2 and trying to kill the pending nautilus process using:
ps -e | grep nautilus
and then the command
kill {####}

That did not worked either. I was tired and uninstalled "file-roller" using the software manager, this solved the problem. But I actually use "file-roller" so I re-install the program and the problem returned. I tried to uninstall the program using synaptic manager using the "Mark for complete removal" option, uninstall, re-install and the problem was there. I uninstalled all the other recommended packages that were installed along with "file-roller" using synaptics and then just tried to install "file-roller" alone, the problem is still here.

Then I thought it was a problem related to the HDD. So I went ahead and re-formatted it using the EXT4 file system with no partitions. Re-booted and the problem is still here. Whatever process I started with "file-roller" or one of its companion pkgs is still active somewhere, I believe is "alive" in the system's HDD, because it returns after a complete uninstall/reboot/install process. I do not want to mess with "nautilus" itself, Do I need to uninstall/reinstall "nautilus-data" pkg?

System: Ubuntu 10.10, running solo in an EXT4 single partition.
Desktop: Gnome v2.32.0
Programs: file-roller v.2.32.0-0ununtu1; unzip v6.0-4; zip v3.0-3; xz-utils 4.999.9beta+20100527-1
USB HDD: 500GB, single partition, EXT4 file system.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved