Hi. I had a zip file which i needed to extract. This zip file contains a base folder in which there are a few subfolders, etc... I opened the zip file with file roller, which naturally showed me the base folder (the one i just mentioned). Then I set it to extract this file under /usr/. Specifically, this was the Eclipse project file. The zip file contains a base folder called eclipse in which are all the subfolders and project files. Then i thought that file roller would extract the files to me in a way that i would maitain the same hierarchy. So, i thought i would have the folder /usr/eclipse and under /usr/eclipse i would have the other subfolders and files. The problem is that when i told it to extract, file roller simply extract all FILES of the original zip file undre /usr/. So now i got hundreds of file under my /usr/ directory. Addionally, file roller didn't create any of the subfolders of the eclipse base folder (which, as said, was not created either). What could i do to "undo" this process? I'm very new to linux. Is there a way i to delete files created at some specific date??? So i just would go with this. For example: Delete all files created after saturday 30.
Also, i could delete only all FILES from my /usr/ dir, which before the whole thing only had subfolders. Maybe i could use rm for that, but as i'm a linux beginner i'm not sure which comannda line options to use. Maybe: rm -/usr/*
Well, any help is appreciated.
On Sun, 30 Jan 2005, Leandro Melo wrote:
Hi. I had a zip file which i needed to extract. This zip file contains a base folder in which there are a few subfolders, etc... I opened the zip file with file roller, which naturally showed me the base folder (the one i just mentioned). Then I set it to extract this file under /usr/. Specifically, this was the Eclipse project file. The zip file contains a base folder called eclipse in which are all the subfolders and project files. Then i thought that file roller would extract the files to me in a way that i would maitain the same hierarchy. So, i thought i would have the folder /usr/eclipse and under /usr/eclipse i would have the other subfolders and files. The problem is that when i told it to extract, file roller simply extract all FILES of the original zip file undre /usr/. So now i got hundreds of file under my /usr/ directory. Addionally, file roller didn't create any of the subfolders of the eclipse base folder (which, as said, was not created either). What could i do to "undo" this process? I'm very new to linux. Is there a way i to delete files created at some specific date??? So i just would go with this. For example: Delete all files created after saturday 30.
Also, i could delete only all FILES from my /usr/ dir, which before the whole thing only had subfolders. Maybe i could use rm for that, but as i'm a linux beginner i'm not sure which comannda line options to use. Maybe: rm -/usr/*
Well, any help is appreciated.
"rm /usr/*" will delete only files in the directory /usr. Directories will remain intact. To recursively delete directories and their contents, use "rm -r <path>". If you are getting prompts for every file, use "\rm /usr/*". Read "man rm" carefully.
FYI, here's the contents of my /usr/ dir:
$ ls /usr bin etc include kerberos libexec lost+found share tmp doc games java lib local sbin src X11R6
(I added the symlink /usr/doc -> /usr/share/doc. /usr/java is installed by Java. lost+found appears in every partition. The rest are FC directories (well, tmp is a symlink).)
I use unzip from the command line to unpack .zip files. Never tried the file roller, to be honest.
There are Eclipse RPMs at Jpackage (www.jpackage.org), although it takes some setting up to get it all to work together.
Matthew Saltzman wrote:
On Sun, 30 Jan 2005, Leandro Melo wrote:
Hi. I had a zip file which i needed to extract. This zip file contains a base folder in which there are a few subfolders, etc... I opened the zip file with file roller, which naturally showed me the base folder (the one i just mentioned). Then I set it to extract this file under /usr/. Specifically, this was the Eclipse project file. The zip file contains a base folder called eclipse in which are all the subfolders and project files. Then i thought that file roller would extract the files to me in a way that i would maitain the same hierarchy. So, i thought i would have the folder /usr/eclipse and under /usr/eclipse i would have the other subfolders and files. The problem is that when i told it to extract, file roller simply extract all FILES of the original zip file undre /usr/. So now i got hundreds of file under my /usr/ directory. Addionally, file roller didn't create any of the subfolders of the eclipse base folder (which, as said, was not created either). What could i do to "undo" this process? I'm very new to linux. Is there a way i to delete files created at some specific date??? So i just would go with this. For example: Delete all files created after saturday 30.
Also, i could delete only all FILES from my /usr/ dir, which before the whole thing only had subfolders. Maybe i could use rm for that, but as i'm a linux beginner i'm not sure which comannda line options to use. Maybe: rm -/usr/*
Well, any help is appreciated.
"rm /usr/*" will delete only files in the directory /usr. Directories will remain intact. To recursively delete directories and their contents, use "rm -r <path>". If you are getting prompts for every file, use "\rm /usr/*". Read "man rm" carefully.
FYI, here's the contents of my /usr/ dir:
$ ls /usr bin etc include kerberos libexec lost+found share tmp doc games java lib local sbin src X11R6
(I added the symlink /usr/doc -> /usr/share/doc. /usr/java is installed by Java. lost+found appears in every partition. The rest are FC directories (well, tmp is a symlink).)
I use unzip from the command line to unpack .zip files. Never tried the file roller, to be honest.
There are Eclipse RPMs at Jpackage (www.jpackage.org), although it takes some setting up to get it all to work together.
If you were do delete the /usr directory, you will end up reinstalling Linux. I recommend the following:
unzip -t <insert zip file name here> > filelist.txt
list out filelist.txt to a printer.
You can then use this file as input to a script file which can then step through the file and rm (remove) the files that were extracted in the /usr directory by accident
On Sun, 30 Jan 2005, James McKenzie wrote:
Matthew Saltzman wrote:
On Sun, 30 Jan 2005, Leandro Melo wrote:
"rm /usr/*" will delete only files in the directory /usr. Directories will remain intact. To recursively delete directories and their contents, use "rm -r <path>". If you are getting prompts for every file, use "\rm /usr/*". Read "man rm" carefully.
FYI, here's the contents of my /usr/ dir:
$ ls /usr bin etc include kerberos libexec lost+found share tmp doc games java lib local sbin src X11R6
If you were do delete the /usr directory, you will end up reinstalling Linux.
Why? There are usually no regular files in /usr (and the OP knew he had none). "rm *" removes only regular files in the current directory. It doesn't delete or descend directories. Deleting directories requires "rm -r". (Sure, you do have to be careful, but if you don't do it wrong, you won't be screwed.)
If you are nervous, you could "rm *.*". That would probably get most files and no directories (as none have extensions). Then clean up the rest by hand.
I recommend the following:
unzip -t <insert zip file name here> > filelist.txt
list out filelist.txt to a printer.
You can then use this file as input to a script file which can then step through the file and rm (remove) the files that were extracted in the /usr directory by accident
This will work, but it seems overly paranoid in this case.
Matthew Saltzman wrote:
On Sun, 30 Jan 2005, James McKenzie wrote:
Matthew Saltzman wrote:
On Sun, 30 Jan 2005, Leandro Melo wrote:
"rm /usr/*" will delete only files in the directory /usr. Directories will remain intact. To recursively delete directories and their contents, use "rm -r <path>". If you are getting prompts for every file, use "\rm /usr/*". Read "man rm" carefully.
FYI, here's the contents of my /usr/ dir:
$ ls /usr bin etc include kerberos libexec lost+found share tmp doc games java lib local sbin src X11R6
If you were do delete the /usr directory, you will end up reinstalling Linux.
Why? There are usually no regular files in /usr (and the OP knew he had none). "rm *" removes only regular files in the current directory. It doesn't delete or descend directories. Deleting directories requires "rm -r". (Sure, you do have to be careful, but if you don't do it wrong, you won't be screwed.)
I've been the victim of a rm -rf * gone wrong.
I would be very careful when using the rm command in any directory which is required by the operating system.
However, you are right, rm * should only remove the files put there by the misuse of the unzip program.
I would definitely backup the subdirectories in the /usr directory before running the rm command, just in case something goes wrong.
On Sun, 2005-01-30 at 14:04 -0200, Leandro Melo wrote:
Hi. I had a zip file which i needed to extract. This zip file contains a base folder in which there are a few subfolders, etc... I opened the zip file with file roller, which naturally showed me the base folder (the one i just mentioned). Then I set it to extract this file under /usr/. Specifically, this was the Eclipse project file. The zip file contains a base folder called eclipse in which are all the subfolders and project files. Then i thought that file roller would extract the files to me in a way that i would maitain the same hierarchy. So, i thought i would have the folder /usr/eclipse and under /usr/eclipse i would have the other subfolders and files. The problem is that when i told it to extract, file roller simply extract all FILES of the original zip file undre /usr/. So now i got hundreds of file under my /usr/ directory. Addionally, file roller didn't create any of the subfolders of the eclipse base folder (which, as said, was not created either). What could i do to "undo" this process? I'm very new to linux. Is there a way i to delete files created at some specific date??? So i just would go with this. For example: Delete all files created after saturday 30.
Also, i could delete only all FILES from my /usr/ dir, which before the whole thing only had subfolders. Maybe i could use rm for that, but as i'm a linux beginner i'm not sure which comannda line options to use. Maybe: rm -/usr/*
Well, any help is appreciated.
A simple script to do it may be: This does a listing of the contents of the directory, and if it is a regular file it will delete it. It thus ignores subdirectories and their contents. This can also be entered in this way at the command line with the same effect. You may want to add the -f option to the rm command since by default root has rm aliased to "rm -i".
for i in `ls /usr` do if [ -f /usr/$i ] ; then rm /usr/$i fi done
For future use of file roller, there is a check box on the extract screen that sets the option to recreate folders.
-- Leandro