The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Weird Ascii characters in file names yamsin789 Shell Programming and Scripting 2 10-07-2007 07:27 AM
how to delete record in file data with index in another file? zhynxn Shell Programming and Scripting 0 07-05-2006 09:03 PM
i want to delete a file based on existing file in a directory srivsn Shell Programming and Scripting 3 04-11-2006 01:38 AM
Weird File rahulrathod UNIX for Dummies Questions & Answers 5 01-20-2006 07:28 AM
Get file from source server and delete the ftp file lweegp Shell Programming and Scripting 3 10-16-2005 11:53 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-05-2006
Registered User
 

Join Date: Jul 2006
Posts: 10
How to delete a weird file name

Hi,
How do I delete a file name that starts with a hypen?
e.g. -unix_file_2006_10_3
I always get an erroe when I use rm command. I am using Solaris.
Thanks,

Hi,
One of the Unix books I read to remove this weird file suggest to use:
"rm ./-unix_file_2006_10_3"
which I did today and file went away.
According to the book the "./" just say " in this directory" that is all it does -without it Unix thinks that the dash is an option of some unix commands that was erroneuosly entered.

Thanks you all for responding.

Last edited by XZOR; 10-06-2006 at 10:33 AM.
Reply With Quote
Forum Sponsor
  #2  
Old 10-05-2006
Registered User
 

Join Date: Oct 2006
Posts: 7
Don't know about solaris, I am using RHEL.
I did it like this:
in GNOME locate the file.
press the almighty del key...
it does it...
Reply With Quote
  #3  
Old 10-05-2006
Yogesh Sawant's Avatar
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 798
Quote:
Originally Posted by XZOR
Hi,
How do I delete a file name that starts with a hypen?
e.g. -unix_file_2006_10_3
I always get an erroe when I use rm command. I am using Solaris.
Thanks,
have you tried:
rm "-unix_file_2006_10_3"

if that does not work, try:
rm \-unix_file_2006_10_3

if you still get the error, post the error here
Reply With Quote
  #4  
Old 10-05-2006
Hitori's Avatar
Registered User
 

Join Date: Jun 2006
Posts: 360
try
rm -- filename
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0