Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 19/20 > Security and Privacy
FedoraForum Search

Forgot Password? Join Us!

Security and Privacy Sadly, malware, spyware, hackers and privacy threats abound in today's world. Let's be paranoid and secure our penguins, and slam the doors on privacy exploits.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 30th April 2012, 08:26 AM
mps2006 Offline
Registered User
 
Join Date: Sep 2006
Posts: 170
linuxfirefox
How to delete a file starting with .#?

In my home directory I have found a file with a name .#<someletters>.txt.

I have no idea where it came from.

I cannot cat or delete the file - it says "file not found", even though tab compeletion in the shell works!

escaping the characters ie \.\# doesn't work either - it gets automatically re-set to the original name.

Any suggestions? Should I be worried?

thanks
M.
Reply With Quote
  #2  
Old 30th April 2012, 09:52 AM
bonedome Offline
Registered User
 
Join Date: Apr 2010
Location: uk
Posts: 727
windows_98_nt_2000ie
Re: How to delete a file starting with .#?

Hello
can you read it, what are its properties ?
__________________
fedora 14 fluxbox and gnome2 hp compaq nx9030 laptop 2Gb ram, helicopter landing pad, jacuzzi, mini fridge, gateway to alternative dimension
Reply With Quote
  #3  
Old 30th April 2012, 10:16 AM
Dutchy Offline
Registered User
 
Join Date: Aug 2011
Posts: 928
linuxsafari
Re: How to delete a file starting with .#?

What about wrapping the filename in double quotes?
Reply With Quote
  #4  
Old 30th April 2012, 10:19 AM
aleph Offline
Banned (for/from) behaving just like everybody else!
 
Join Date: Jul 2007
Location: Beijing, China
Posts: 1,307
linuxfirefox
Re: How to delete a file starting with .#?

If the filename contain unintelligible or otherwise very strange characters, here's a method to delete them.

First, use the "ls -i" method to list the files and the inode numbers, and copy the offending file's inode num.

After that, use the command "find" to deal with them. For example, if you want to delete it, pass the rm command to the -exec option

Code:
find . -inum INODE_NUMBER -exec rm {} \;
where INODE_NUMBER is the one you got from "ls -i". This will descend from the current directory to find the matching file.

This could be very slow, if "find" has to go across filesystem boundaries. To prevent this, add the "-mount" option so that filesystem boundaries are not crossed.

Code:
find . -mount -inum INODE_NUMBER -exec rm {} \;
Of course you can use other commands, such as "mv", to rename them.
__________________
I believe in nerditarianism. I read FedoraForum for the Fedora-related posts.
Reply With Quote
  #5  
Old 30th April 2012, 03:20 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 31
Posts: 2,750
linuxfirefox
Re: How to delete a file starting with .#?

Can you see the file in a file manager such as Nautilus or mc, if you enable "show hidden files" (Ctrl+H in Nautilus)? Can you delete it then? A file management program should make the unlink system calls directly, bypassing any shell interpretation etc.
Reply With Quote
  #6  
Old 30th April 2012, 03:38 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,669
linuxfirefox
Re: How to delete a file starting with .#?

rm ?rest_of_the_name
Reply With Quote
  #7  
Old 2nd May 2012, 08:23 AM
bensonparis Offline
Registered User
 
Join Date: Apr 2012
Location: UK
Posts: 5
windows_7firefox
Re: How to delete a file starting with .#?

All above information are right
It is a common methods
Reply With Quote
  #8  
Old 3rd May 2012, 02:03 AM
Doug G Offline
Registered User
 
Join Date: Jul 2005
Posts: 640
windows_7firefox
Re: How to delete a file starting with .#?

If you use mc from the command line I think it will handle deleting files with weird filenames.
__________________
======
Doug G
======
Reply With Quote
  #9  
Old 3rd May 2012, 03:57 AM
kurtdriver Offline
Registered User
 
Join Date: Jul 2005
Location: Vancouver Canada
Posts: 1,349
linuxfirefox
Re: How to delete a file starting with .#?

You type rm .#filename.txt using file completion and get an error meassage of "File not found"? Is this correct? You might try temporary move all other .txt file in that directory to another directory and the try again with
rm *.txt.
But you haven't told us if you can display the contents, also if you don't what it is, google the name and see what come up. I did that a few years ago and it turned out to be the conficker worm.

Last edited by kurtdriver; 3rd May 2012 at 02:54 PM.
Reply With Quote
  #10  
Old 3rd May 2012, 12:10 PM
sea Online
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Confoederatio Helvetica (Swissh)
Age: 34
Posts: 3,086
linuxfirefox
Re: How to delete a file starting with .#?

Not quite sure, but ":" requires to have an \ previous in order to use it for filenames.
I assume the same works for #...
Asuming that the dot in the file name indicates a hidden file, and should not mark the 'current dir'?

So have a try with: (note the backslash)
Quote:
rm .\#filename
__________________
Notebook: Samsung NC210/NC110 CPU: Intel 2*1600 Mhz RAM: 1024 MB DDR2 OS: Fedora 19 DE: Awesome
Laptop: Toshiba Satellite L670 CPU: Intel(r) 2*1872 Mhz RAM: 3072 MB DDR3 OS: Fedora 17 DE: Awesome
Fedora Manual (RTFM) | The Linux Documentation Project | Script-Tools
Reply With Quote
  #11  
Old 3rd May 2012, 12:48 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,669
linuxfirefox
Re: How to delete a file starting with .#?

One of the problems with all suggestions that use the "#" is that SOMETIMES the character displayed is not the character in the name.

This is the difference between octal 043 (the #) and 243 (also the #).

Also note that # is the start of a comment (so the \ should work, or putting it inside quotes).

One of the harder files to delete is something starting with "-"... quoting these doesn't work as it isn't the shell doing the interpretation. The application identifies it as option specifications.
Reply With Quote
  #12  
Old 3rd May 2012, 02:54 PM
aleph Offline
Banned (for/from) behaving just like everybody else!
 
Join Date: Jul 2007
Location: Beijing, China
Posts: 1,307
linuxfirefox
Re: How to delete a file starting with .#?

I think my suggestion using "find" could work with these cases. Human intervention is needed to identify the file, though, but I guess this is inevitable. It is inevitable because you don't know the machine-readable form of the filename in the first place. We have to assume the filename is completely garbage.
__________________
I believe in nerditarianism. I read FedoraForum for the Fedora-related posts.
Reply With Quote
  #13  
Old 28th May 2012, 08:46 PM
mps2006 Offline
Registered User
 
Join Date: Sep 2006
Posts: 170
linuxfirefox
Re: How to delete a file starting with .#?

Thanks, those ideas sorted me out.

I'm still a bit worried about where the files came from - there were four, in different directories, both were the names of other innocuous files just with a .# in front of them. one was a .tex and there were .txt files.

They were all sim-links to non-existent files with names of the format user@localhost.13571:1318356082 (so a bit like a maildir message format).

They all had lrwxrwxrwx permissions.

What programme might produce files like that? I'm guessing emacs as that is what I might have used to edit .tex and .txt files.

Thanks
M.
Reply With Quote
  #14  
Old 28th May 2012, 10:32 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 31
Posts: 2,750
linuxfirefox
Re: How to delete a file starting with .#?

Quote:
Originally Posted by mps2006 View Post
I'm still a bit worried about where the files came from - there were four, in different directories, both were the names of other innocuous files just with a .# in front of them. one was a .tex and there were .txt files.
They sound like editor back-up/working files. I'm not sure which editor (I don't have Emacs installed to test), GVim uses .filename.swp though.

Quote:
They all had lrwxrwxrwx permissions.
All symlinks have those permissions (normally) – the real permissions are those of the pointed-to file.
Reply With Quote
  #15  
Old 29th May 2012, 12:07 AM
bigflopper2 Offline
Registered User
 
Join Date: Dec 2011
Posts: 214
linuxfirefox
Re: How to delete a file starting with .#?

go to the directory and do:
Quote:
convmv -f iso-8859-15 -t utf8 -r --notest .
all "special characters" will be converted...and you can delete the files...
Reply With Quote
Reply

Tags
delete, file, starting

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete file permanently. rajeev Using Fedora 10 20th November 2009 04:04 AM
How do i delete a file in terminal? tootal2 Using Fedora 8 23rd December 2008 11:53 AM
How to delete file recursively youhaodeyi Programming & Packaging 4 28th June 2007 01:06 PM
How do i delete this file thugpoet22 Using Fedora 11 5th February 2006 04:33 AM
Automatic type text , delete file and save file problem shown in FC3 and FC2 kalpana EOL (End Of Life) Versions 1 10th June 2005 04:50 AM


Current GMT-time: 13:35 (Thursday, 24-04-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat