 |
 |
 |
 |
| 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. |

30th April 2012, 08:26 AM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 170

|
|
|
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.
|

30th April 2012, 09:52 AM
|
 |
Registered User
|
|
Join Date: Apr 2010
Location: uk
Posts: 726

|
|
|
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
|

30th April 2012, 10:16 AM
|
|
Registered User
|
|
Join Date: Aug 2011
Posts: 697

|
|
|
Re: How to delete a file starting with .#?
What about wrapping the filename in double quotes?
|

30th April 2012, 10:19 AM
|
 |
Banned (for/from) behaving just like everybody else!
|
|
Join Date: Jul 2007
Location: Beijing, China
Posts: 1,307

|
|
|
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.
|

30th April 2012, 03:20 PM
|
|
Official Gnome 3 Sales Rep. (and Adminstrator)
|
|
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,695

|
|
|
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.
|

30th April 2012, 03:38 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,097

|
|
|
Re: How to delete a file starting with .#?
rm ?rest_of_the_name
|

2nd May 2012, 08:23 AM
|
|
Registered User
|
|
Join Date: Apr 2012
Location: UK
Posts: 5

|
|
|
Re: How to delete a file starting with .#?
All above information are right
It is a common methods
|

3rd May 2012, 02:03 AM
|
|
Registered User
|
|
Join Date: Jul 2005
Posts: 640

|
|
|
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
======
|

3rd May 2012, 03:57 AM
|
|
Registered User
|
|
Join Date: Jul 2005
Location: Vancouver Canada
Posts: 1,285

|
|
|
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.
|

3rd May 2012, 12:10 PM
|
 |
"Shells" (of a sub world)
|
|
Join Date: May 2011
Location: Helvetic Federation (Swissh)
Age: 33
Posts: 2,600

|
|
|
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)
__________________
Fedora Manual: http://docs.fedoraproject.org
Script-Tools: https://sourceforge.net/projects/script-tools/
sudo st tweak repo toggle fedora-rawhide ; st iso dl-fed -respin && st iso usb
|

3rd May 2012, 12:48 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,097

|
|
|
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.
|

3rd May 2012, 02:54 PM
|
 |
Banned (for/from) behaving just like everybody else!
|
|
Join Date: Jul 2007
Location: Beijing, China
Posts: 1,307

|
|
|
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.
|

28th May 2012, 08:46 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 170

|
|
|
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.
|

28th May 2012, 10:32 PM
|
|
Official Gnome 3 Sales Rep. (and Adminstrator)
|
|
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,695

|
|
|
Re: How to delete a file starting with .#?
Quote:
Originally Posted by mps2006
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.
|

29th May 2012, 12:07 AM
|
 |
Registered User
|
|
Join Date: Dec 2011
Posts: 213

|
|
|
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...
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 05:20 (Monday, 20-05-2013)
|
|
 |
 |
 |
 |
|
|