LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-26-2005, 08:59 AM   #1
voyciz
Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 425

Rep: Reputation: 40
Unkown file! Help please!


OK, for some reason I now have a file named "-f" in my home directory. I can't seem to remove it, I've tried "rm -f", "rm \-f", and "rm *f". This is a 77 byte file owned by root. If I use "ls *f" and it enter, it won't show up, but if I enter the same thing and keep hitting tab for auto-completion it will. Someone help. Does this mean someone's gotten in? Help please!
 
Old 01-26-2005, 09:13 AM   #2
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slack`er-current
Posts: 845

Rep: Reputation: 31
Quote:
This is a 77 byte file owned by root.
As root try...

Code:
rm -rf yourfile
 
Old 01-26-2005, 09:25 AM   #3
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
I'd try to remove it, as root
#rm -rf *f
if there aren't any other files or directories that end with an f.
 
Old 01-26-2005, 09:25 AM   #4
voyciz
Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 425

Original Poster
Rep: Reputation: 40
No good.
 
Old 01-26-2005, 09:37 AM   #5
voyciz
Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 425

Original Poster
Rep: Reputation: 40
I used "file *f" and it made funny sounds and said "cannot allocate memory"...
 
Old 01-26-2005, 10:48 AM   #6
LasseW
Member
 
Registered: Oct 2004
Distribution: Fedora 7, OpenSuse 10.2
Posts: 108

Rep: Reputation: 15
Try

rm ./-f
 
Old 01-26-2005, 11:05 AM   #7
ColKurtz
Member
 
Registered: Jan 2005
Location: Earth
Distribution: Fedora
Posts: 40

Rep: Reputation: 15
There might be a space in the filename, maybe before the dash? Try rm " -f" (there's a space before the dash there).
 
Old 01-26-2005, 11:44 AM   #8
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
How about trying to remove it using a file manager like Konqueror or nautilus?
 
Old 01-26-2005, 12:11 PM   #9
wpn146
Member
 
Registered: Jan 2005
Distribution: Solaris, Linux Fedora Core 6
Posts: 170

Rep: Reputation: 30
"rm ./-f" as stated above should work. The "./" will keep the "-f" from being considered an argument. If it doesn't work, there may be more funny characters in the file name, like trailing spaces. try an "ls -b" to display unprintable characters.

I once had a file named "*.*" in a Dos directory that was difficult to safely remove.
 
Old 01-26-2005, 12:13 PM   #10
Padma
Member
 
Registered: Aug 2003
Location: Omaha, NE, USA
Distribution: PCLinuxOS 2007
Posts: 808

Rep: Reputation: 30
Try renaming it in Konq or Nautilus.

I seem to recall running into a similar problem many years ago. I was able to rename the file, and then I could properly delete it.
 
Old 01-26-2005, 04:11 PM   #11
voyciz
Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 425

Original Poster
Rep: Reputation: 40
It's gone! "rm ./-f" did it, thank you all. This will really help in the future, because I've had some other oddly named files that I had trouble with.
 
Old 08-13-2010, 01:50 AM   #12
sulekha
Member
 
Registered: Dec 2004
Location: India
Distribution: ubuntu 10.04 , centos 5.5 , Debian lenny, Freenas
Posts: 324

Rep: Reputation: 36
try this

the solution i could find was

use rm -- argument to tell that everything that follows is a file name and not an option

ex:- rm -r -- -f

Last edited by sulekha; 08-13-2010 at 01:56 AM.
 
1 members found this post helpful.
Old 08-13-2010, 08:10 AM   #13
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,311

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
The other trick is to cp out all other files in that dir, then rm -rf the dir .
 
Old 08-13-2010, 09:19 AM   #14
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,076
Blog Entries: 52

Rep: Reputation: Disabled
Look at the date on the original post - it's a 5 year old thread.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unkown symbol Error shogun1234 Linux - General 1 08-17-2005 05:45 AM
Unkown Host CloudBuilder Linux - Networking 3 05-08-2005 10:39 AM
wacom.ko has unkown symbol? bobbens Debian 0 01-16-2005 07:14 AM
Unkown Host Error- internet malikk Linux - Newbie 3 05-24-2004 11:57 AM
[RH 9] Unkown socket type bob44 Linux - Networking 0 03-17-2004 05:37 PM


All times are GMT -5. The time now is 02:13 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration