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 11:27 AM
how to delete record in file data with index in another file? zhynxn Shell Programming and Scripting 0 07-06-2006 01:03 AM
i want to delete a file based on existing file in a directory srivsn Shell Programming and Scripting 3 04-11-2006 05:38 AM
Weird File rahulrathod UNIX for Dummies Questions & Answers 5 01-20-2006 10:28 AM
Get file from source server and delete the ftp file lweegp Shell Programming and Scripting 3 10-17-2005 03:53 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-06-2006
XZOR XZOR is offline
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 02:33 PM..
  #2 (permalink)  
Old 10-06-2006
slurp slurp is offline
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...
  #3 (permalink)  
Old 10-06-2006
Yogesh Sawant's Avatar
Yogesh Sawant Yogesh Sawant is offline Forum Staff  
Part Time Moderator and Full Time Dad
  
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 1,086
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
  #4 (permalink)  
Old 10-06-2006
Hitori's Avatar
Hitori Hitori is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2006
Posts: 360
try
rm -- filename
Closed Thread

Bookmarks

Tags
unix commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0