How to delete a file that is called "."

How to delete a file that is called "."

Post by Why? » Fri, 21 Jun 2002 08:16:12



Hi there.  Sorry I have a very stupid question. I created a file called .
(yes, that's a period). How do I delete it?  I know but I was in a beginning
Unix class and created this by mistake. Should have been paying attention...

--
Bill Pizer

"I can do all things through Christ who strengthens me" - Phi 4:13

http://home.nycap.rr.com/wpizer/

 
 
 

How to delete a file that is called "."

Post by Lekeas G » Fri, 21 Jun 2002 08:26:52


rm ./.

George


> Date: Wed, 19 Jun 2002 23:16:12 GMT

> Newsgroups: comp.unix.questions
> Subject: How to delete a file that is called "."

> Hi there.  Sorry I have a very stupid question. I created a file called .
> (yes, that's a period). How do I delete it?  I know but I was in a beginning
> Unix class and created this by mistake. Should have been paying attention...

> --
> Bill Pizer

> "I can do all things through Christ who strengthens me" - Phi 4:13

> http://home.nycap.rr.com/wpizer/


 
 
 

How to delete a file that is called "."

Post by Bill Marc » Fri, 21 Jun 2002 12:02:16


On Wed, 19 Jun 2002 23:16:12 GMT,

>Hi there.  Sorry I have a very stupid question. I created a file called .
>(yes, that's a period). How do I delete it?  I know but I was in a beginning
>Unix class and created this by mistake. Should have been paying attention...

How could you create a file called . when there is already a directory by
that name?  Perhaps the file has spaces or control characters in its name.
ls -bd *.*
rm -i *.*
 
 
 

How to delete a file that is called "."

Post by Alois Steind » Fri, 21 Jun 2002 16:35:20



> Hi there.  Sorry I have a very stupid question. I created a file called .
> (yes, that's a period). How do I delete it?  I know but I was in a beginning
> Unix class and created this by mistake. Should have been paying attention...

Hello,
since this newsgroup has an excellent FAQ, I would strongly recommend
to read it, not only for this very simple problem; especially if you
are a beginner.
Quote:

> "I can do all things through Christ who strengthens me" - Phi 4:13

Maybe we should ask the pope to include the FAQ into the bible. Would
that help?

Alois

--
Alois Steindl,                  Tel.: +43 (1) 58801 / 32558      
Inst. for Mechanics II,         Fax.: +43 (1) 58801 / 32598
Vienna University of Technology,

 
 
 

How to delete a file that is called "."

Post by Barry Margoli » Sat, 22 Jun 2002 00:44:31





>> Hi there.  Sorry I have a very stupid question. I created a file called .
>> (yes, that's a period). How do I delete it?  I know but I was in a beginning
>> Unix class and created this by mistake. Should have been paying attention...

>Hello,
>since this newsgroup has an excellent FAQ, I would strongly recommend
>to read it, not only for this very simple problem; especially if you
>are a beginner.

I know the FAQ explains how to delete files beginning with "-" (this is the
most common deletion question, and probably one of the top 3 questions
asked in general about Unix -- I think it's also the one that receives the
most *wrong* answers).  But the answers in that question don't apply to the
OP's question.  Do you disagree?

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

How to delete a file that is called "."

Post by greymau » Sat, 22 Jun 2002 02:26:50



> Hi there.  Sorry I have a very stupid question. I created a file called .
> (yes, that's a period). How do I delete it?  I know but I was in a beginning
> Unix class and created this by mistake. Should have been paying attention...

> --
> Bill Pizer

> "I can do all things through Christ who strengthens me" - Phi 4:13

> http://home.nycap.rr.com/wpizer/

AFAIK , thats covered in the faq .
Anyway , I would do it with mc

--
Greymaus;
Follow up , don't e-mail , my killfile is savage ;
Next Year In , well , wherever ;

 
 
 

How to delete a file that is called "."

Post by Alois Steind » Sat, 22 Jun 2002 17:05:20



> I know the FAQ explains how to delete files beginning with "-" (this is the
> most common deletion question, and probably one of the top 3 questions
> asked in general about Unix -- I think it's also the one that receives the
> most *wrong* answers).  But the answers in that question don't apply to the
> OP's question.  Do you disagree?

Yes, indeed!

Question 2.2 (the next one) deals with just the problem: How to remove
files with strange letters in them.
One very good advice (amongst others) is to find out the inode number
and use find to remove the file.

Alois

 
 
 

How to delete a file that is called "."

Post by <bta.. » Sat, 22 Jun 2002 18:14:33




> > I know the FAQ explains how to delete files beginning with "-" (this is the
> > most common deletion question, and probably one of the top 3 questions
> > asked in general about Unix -- I think it's also the one that receives the
> > most *wrong* answers).  But the answers in that question don't apply to the
> > OP's question.  Do you disagree?

> Yes, indeed!

> Question 2.2 (the next one) deals with just the problem: How to remove
> files with strange letters in them.
> One very good advice (amongst others) is to find out the inode number
> and use find to remove the file.

> Alois

unlink -filename

-Bill

 
 
 

How to delete a file that is called "."

Post by Ben Altma » Sat, 22 Jun 2002 21:09:46



> On Wed, 19 Jun 2002 23:16:12 GMT,

> >Hi there.  Sorry I have a very stupid question. I created a file called .
> >(yes, that's a period). How do I delete it?  I know but I was in a
beginning
> >Unix class and created this by mistake. Should have been paying
attention...

> How could you create a file called . when there is already a directory by
> that name?  Perhaps the file has spaces or control characters in its name.

Sounds like a troll.

regards,
Ben

 
 
 

How to delete a file that is called "."

Post by <bta.. » Sun, 23 Jun 2002 06:19:10



> Hi there.  Sorry I have a very stupid question. I created a file called .
> (yes, that's a period). How do I delete it?  I know but I was in a
> beginning
> Unix class and created this by mistake. Should have been paying
> attention...

I've tried creating a file called . and I can't seem to save it because
it's a directory.

If a file called . does exist, try

unlink .

-Bill

 
 
 

How to delete a file that is called "."

Post by those who know me have no need of my nam » Mon, 24 Jun 2002 19:35:34


in comp.unix.questions i read:

Quote:>rm ./.

except that such a `file' cannot exist, since the directory self-link uses
that name.  if the op is sure a file was created i suspect it has leading
or trailing whitespace, which an `ls -b' or `ls -q' or `ls | cat -t' should
reveal.

--
bringing you boring signatures for 17 years

 
 
 

How to delete a file that is called "."

Post by Ben Altma » Mon, 24 Jun 2002 21:27:00




> > Hi there.  Sorry I have a very stupid question. I created a file called
.
> > (yes, that's a period). How do I delete it?  I know but I was in a
> > beginning
> > Unix class and created this by mistake. Should have been paying
> > attention...

> I've tried creating a file called . and I can't seem to save it because
> it's a directory.

> If a file called . does exist, try

> unlink .

Don't feed the troll.

BTW. $ unlink xxx
ksh: unlink: not found

You probably mean in perl?
Ben

 
 
 

How to delete a file that is called "."

Post by Peter J. Ackl » Mon, 24 Jun 2002 22:30:59




>> If a file called . does exist, try

>> unlink .

> Don't feed the troll.

> BTW. $ unlink xxx
> ksh: unlink: not found

> You probably mean in perl?

Solaris has /usr/sbin/unlink

Peter

--
I went out of memory.  Now I can't get back in.