Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing a file

Status
Not open for further replies.

elias1003

Technical User
Mar 1, 2005
25
US
Is there any way to remove a file that was named *?. I have a file that was name * (asterisk). Now if I rm * I am afraid I will remove all files in the directory. Any simple solutions to this?
Thanks,

 
Try 'escaping' the *.
First try
Code:
ls \*
to demonstrate that you are indeed picking up just the one file. If so
Code:
rm \*

Columb Healy
 
I like to use ksh arrays for this.

#set -A files $(ls .)
#print ${files[@]}

find your file - ksh starts counting at 0 (zero). Then:
#rm ${files[7]} - if 7 was the count of your *? filename.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top