FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 05-01-2012, 11:46 PM
Dan Hitt
 
Default How do I remove a bad file??

Handle this with great care!!

If you can remove it in the gui, do so.

That would be safest.

If you cannot, then look up the man page on rm, and make
sure that the -i flag works.

-i stands for inquire, and should ask you for each file that
it wants to remove whether to remove it or not.

When you are absolutely certain that you trust the -i flag,
and have tested it somewhere, then go to the directory
where the offending file is, and type:
(CAUTION) /bin/rm -i *

Then it will ask you for each file, and you type n for
all of them except the one with the mangled name.

(I would also wait an hour first, in case somebody
has a less scary alternative that they post.)

(Note: i may sound ridiculous talking about caution here,
but i remember years ago deleting a huge amount of
work because i was removing without checking very well.)

dan



On Tue, May 1, 2012 at 4:20 PM, Dennis Wicks <wix@mgssub.com> wrote:
> Greetings;
>
> I have a file that looks like the following in an ls list;
>
> -????????? ? ? * *? * * * * * * ? * * * * * * * *? Inbox.msf
>
> I can't do anything with it. Can't mv, rm, cp, or anything else I have
> thought of to get rid of it or write over it.
>
> Any ideas how I can get this thing out of my life??
>
> Many TIA!!
> Dennis
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject
> of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/4FA06FAB.9070808@mgssub.com
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAOphizLqQ5cWwuJsk9uri9HXxD_pwWZuZo2OS5tb7jviqy6mk w@mail.gmail.com">http://lists.debian.org/CAOphizLqQ5cWwuJsk9uri9HXxD_pwWZuZo2OS5tb7jviqy6mk w@mail.gmail.com
 
Old 05-02-2012, 12:15 AM
Indulekha
 
Default How do I remove a bad file??

On Tue, May 01, 2012 at 04:46:19PM -0700, Dan Hitt wrote:
> Handle this with great care!!
>
> If you can remove it in the gui, do so.
>
> That would be safest.
>
> If you cannot, then look up the man page on rm, and make
> sure that the -i flag works.
>
> -i stands for inquire, and should ask you for each file that
> it wants to remove whether to remove it or not.
>
> When you are absolutely certain that you trust the -i flag,
> and have tested it somewhere, then go to the directory
> where the offending file is, and type:
> (CAUTION) /bin/rm -i *
>
> Then it will ask you for each file, and you type n for
> all of them except the one with the mangled name.
>
> (I would also wait an hour first, in case somebody
> has a less scary alternative that they post.)
>
> (Note: i may sound ridiculous talking about caution here,
> but i remember years ago deleting a huge amount of
> work because i was removing without checking very well.)
>

It's always wise to alias "rm" to "rm -i" in your shell.
Also learned the hard way, when the combination of a killer
headache and time pressure caused me to delete a bunch of
things years ago...

There's a file manager called worker which is rather handy
for this sort of thing, too --very fast and light, uses only
xlibs.

--
❤ ♫ ❤ ♫ ❤ ♫ ❤
Indulekha


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120502001519.GC22104@radhesyama">http://lists.debian.org/20120502001519.GC22104@radhesyama
 
Old 05-02-2012, 12:15 AM
Go Linux
 
Default How do I remove a bad file??

--- On Tue, 5/1/12, Dennis Wicks <wix@mgssub.com> wrote:

> From: Dennis Wicks <wix@mgssub.com>
> Subject: How do I remove a bad file??
> To: debian-user@lists.debian.org
> Date: Tuesday, May 1, 2012, 6:20 PM
> Greetings;
>
> I have a file that looks like the following in an ls list;
>
> -????????? ? ?* * ?* * * *
> * ***?* * * * *
> * * * ? Inbox.msf
>
> I can't do anything with it. Can't mv, rm, cp, or anything
> else I have thought of to get rid of it or write over it.
>
> Any ideas how I can get this thing out of my life??
>
>

Have you tried to remove it via a live disk rather than from the booted system?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1335917753.16642.YahooMailClassic@web162202.mail.b f1.yahoo.com">http://lists.debian.org/1335917753.16642.YahooMailClassic@web162202.mail.b f1.yahoo.com
 
Old 05-02-2012, 12:46 AM
"John L. Cunningham"
 
Default How do I remove a bad file??

On Tue, May 01, 2012 at 06:20:11PM -0500, Dennis Wicks wrote:
> Greetings;
>
> I have a file that looks like the following in an ls list;
>
> -????????? ? ? ? ? ? Inbox.msf
>
> I can't do anything with it. Can't mv, rm, cp, or anything else I
> have thought of to get rid of it or write over it.
>
> Any ideas how I can get this thing out of my life??

If there is no GUI available, this trick using find and the file's inode number will work:

http://www.cyberciti.biz/tips/delete-remove-files-with-inode-number.html


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120502004600.GA13529@cerulean.myhome.westell.com ">http://lists.debian.org/20120502004600.GA13529@cerulean.myhome.westell.com
 
Old 05-02-2012, 05:04 AM
Jochen Spieker
 
Default How do I remove a bad file??

Dennis Wicks:
> Greetings;
>
> I have a file that looks like the following in an ls list;
>
> -????????? ? ? ? ? ? Inbox.msf
>
> I can't do anything with it. Can't mv, rm, cp, or anything else I
> have thought of to get rid of it or write over it.
>
> Any ideas how I can get this thing out of my life??

Fsck the filesystem.

J.
--
I want to keep my skin looking good but I believe all computers do the
same job.
[Agree] [Disagree]
<http://www.slowlydownward.com/NODATA/data_enter2.html>
 
Old 05-02-2012, 09:16 AM
Andrei POPESCU
 
Default How do I remove a bad file??

On Ma, 01 mai 12, 19:15:19, Indulekha wrote:
>
> It's always wise to alias "rm" to "rm -i" in your shell.
> Also learned the hard way, when the combination of a killer
> headache and time pressure caused me to delete a bunch of
> things years ago...

I used to think so as well, but consider situations where your delete
pattern matches a lot of files, are you going to press 'y' for each and
every one of them? You will probably interrupt and add -f as well, which
may do more than what you wanted.

What if you work on another machine where 'rm' is not aliased to
'rm -i'?

What I do is always check my pattern with tab completion before pressing
Enter, even if I need -rf, because it's possible to add switches at the
end as well

Kind regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
 
Old 05-02-2012, 10:37 AM
Tom H
 
Default How do I remove a bad file??

On Wed, May 2, 2012 at 5:16 AM, Andrei POPESCU <andreimpopescu@gmail.com> wrote:
> On Ma, 01 mai 12, 19:15:19, Indulekha wrote:
>>
>> It's always wise to alias "rm" to "rm -i" in your shell.
>> Also learned the hard way, when the combination of a killer
>> headache and time pressure caused me to delete a bunch of
>> things years ago...
>
> I used to think so as well, but consider situations where your delete
> pattern matches a lot of files, are you going to press 'y' for each and
> every one of them? You will probably interrupt and add -f as well, which
> may do more than what you wanted.

You can override the aliased "-i" with a '" in front of "rm".


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAOdo=SzTrpV+7SR_co=zPqHdx5v1H9nPGt391jjePGsA5ANW9 Q@mail.gmail.com">http://lists.debian.org/CAOdo=SzTrpV+7SR_co=zPqHdx5v1H9nPGt391jjePGsA5ANW9 Q@mail.gmail.com
 
Old 05-02-2012, 01:25 PM
Arnt Karlsen
 
Default How do I remove a bad file??

On Wed, 2 May 2012 07:04:55 +0200, Jochen wrote in message
<20120502050455.GA25123@well-adjusted.de>:

> Dennis Wicks:
> > Greetings;
> >
> > I have a file that looks like the following in an ls list;
> >
> > -????????? ? ? ? ? ? Inbox.msf
> >
> > I can't do anything with it. Can't mv, rm, cp, or anything else I
> > have thought of to get rid of it or write over it.
> >
> > Any ideas how I can get this thing out of my life??
>
> Fsck the filesystem.

..first, umount it right _now!_

..if Inbox.msf is your email, you will now learn why, how etc
back-ups are nice. And you _may_ want to learn how to retrieve
bad data tha's been removed by fsck to save the file system.

..depending on how valuable your data is, be careful, "fsck
-N /dev/bad.disk.part" is a safe start if you're in a hurry,
it makes you slow down and verify you understood "man fsck".

--
..med vennlig hilsen = with Kind Regards from Arnt Karlsen
...with a number of polar bear hunters in his ancestry...
Scenarios always come in sets of three:
best case, worst case, and just in case.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120502152543.594a38ce@celsius.lan">http://lists.debian.org/20120502152543.594a38ce@celsius.lan
 
Old 05-02-2012, 01:52 PM
Paul E Condon
 
Default How do I remove a bad file??

On 20120501_204601, John L. Cunningham wrote:
>
> On Tue, May 01, 2012 at 06:20:11PM -0500, Dennis Wicks wrote:
> > Greetings;
> >
> > I have a file that looks like the following in an ls list;
> >
> > -????????? ? ? ? ? ? Inbox.msf
> >
> > I can't do anything with it. Can't mv, rm, cp, or anything else I
> > have thought of to get rid of it or write over it.
> >
> > Any ideas how I can get this thing out of my life??
>
> If there is no GUI available, this trick using find and the file's inode number will work:
>
> http://www.cyberciti.biz/tips/delete-remove-files-with-inode-number.html
>

To OP:

Use find to do the whole job:
1. cd into the directory in which the file with the bad name is lodged,
2. find . -maxdepth 1 -ls
3. look at output and add restrictions to the search criteria of find,
4. repeat 2. until the bad file is the only one found. Then go to 5.
5. add -delete to the end of the find command that was developed by the
above, and run it.

You might want to skim the find man page to see what -maxdepth does.
I would add a test that the file name not have an initial letter that
is the same as the initial letter of any good file in the directory.

! -name '[a-zA-Z0-9]*'

This should make pretty much everything but your bad file drop out of
the find output. If not tweak the find command some more, but don't
add the -delete until the bad file is the only one present in the trial
runs. Don't assume that you know the regular expression rules. Find has
its own regex rules. They are similar to other regex, but for cleanup
work like this, the game of not adding the delete until you are sure
the the whole of the command is right is a strategy that will save you
from a lot of grief.

But if you don't have .history working in your xterm, all of this is
largely worthless. Don't try it with the find command and changes to
it are recorded with pencil on a note pad!!!

--
Paul E Condon
pecondon@mesanetworks.net


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120502135208.GA13647@big.lan.gnu">http://lists.debian.org/20120502135208.GA13647@big.lan.gnu
 
Old 05-02-2012, 07:39 PM
"Dan B."
 
Default How do I remove a bad file??

Arnt Karlsen wrote:
On Wed, 2 May 2012 07:04:55 +0200, Jochen wrote in message
<20120502050455.GA25123@well-adjusted.de>:



Dennis Wicks:

Greetings;

I have a file that looks like the following in an ls list;

-????????? ? ? ? ? ? Inbox.msf

I can't do anything with it. Can't mv, rm, cp, or anything else I
have thought of to get rid of it or write over it.

Any ideas how I can get this thing out of my life??

Fsck the filesystem.


..first, umount it right _now!_

..if Inbox.msf is your email,...


That looks like a Mozilla SeaMonkey or Thunderbird mail _index_ file.

If it is, it can be deleted and SeaMonkey/Thunderbird will re-create
it (from the corresponding mail data file) the next time the
corresponding mail folder is opened/viewed.

In my experience (as a long-time Mozilla user and occasional mail file
hacker--but _not_ developer or expert), the only thing the OP might lose
is his or her choice of display order (by date vs. sender, etc., and
whether threaded display or not).



Daniel



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4FA18D59.9010404@kempt.net">http://lists.debian.org/4FA18D59.9010404@kempt.net
 

Thread Tools




All times are GMT. The time now is 03:32 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org