Deleting a File with an Erroneous Period

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Deleting a File with an Erroneous Period
# 1  
Old 08-08-2001
Question Deleting a File with an Erroneous Period

Hi - I am new to the Unix environment and have encountered a problem I can't resolve. I inadvertently created a data file with a
period/dot at the end of the word 'dat', I.e. filename.dat. and can't remove it using the 'rm' command. In attempting to do so, I receive a message reading that the file is not found. This file is HUGE so I'd like to be able to remove it. Does anyone have any idea how I can remove the file? Thank you in advance for any information you provide.


# 2  
Old 08-08-2001
Try quoting the file with single or double quotes so that the shell takes it literally


rm "filename.dat."
rm 'filename.dat.'

# 3  
Old 08-09-2001

If somehow you have some non-printable characters mixed in the filename, you will have a hard time getting the right filename for rm. If you have the ability to get to the file with a GUI (GNOME, CDE, KDE, etc...) try to delete it from there. If not, use wildcards and hope for the best...

rm -i filename.dat*

The -i flag prompts you before it removes the file. If that matches more than one file in that directory, be sure to type n! If you type y, you'll remove the file forever.

Anyone else have any safer ideas? I've done this before, and used the above method... as best as I can figure, I had some garbled output that created a file named results^H.tx^Hct. The ^H's didn't print in an 'ls'.
# 4  
Old 08-09-2001
Tunnel down to the file from the GUI interface, while logged on as "root".

Delete the offending file and logout to your user account.

The file should be disapeared.


go have some fun!
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Red Hat

CPU Usage statistics Dump in a text file over a period of time

I am facing issue related to performance of one customized application running on RHEL 5.9. The application stalls for some unknown reason that I need to track. For that I require some tool or shell scripts that can monitor the CPU usage statistics (what we get in TOP or in more detail by other... (6 Replies)
Discussion started by: Anjan Ganguly
6 Replies

2. Shell Programming and Scripting

Print one sentence 40 to 50 words end with period in a file

Hi All, Is there another way to achieve this? how get short phrase in a sentence with character count of 100 to 155 words end with period but don't end something like 50,000. . Here's my current script but the output is not good. This will use for my snippets or preview. grep... (6 Replies)
Discussion started by: lxdorney
6 Replies

3. UNIX for Dummies Questions & Answers

Replace period in a tab delimited file to a number

I have a file like this. It is tab delimited. Unfortunately, the missing data was filled in with a period "." (see the leading lines 1-5 columns) I want to substitute the periods for misisng data with an integer "-999". however, I do not want the global replace to change the other periods seen... (7 Replies)
Discussion started by: genehunter
7 Replies

4. Shell Programming and Scripting

Erroneous file concatenation.

I have more than one files in a directory , namely GLOW_OUT.txt FIELD_OUT.txt BASE_OUT.txt ... SHOW_OUT.txt What I wanted to do is to I am working in Korn Shell What I did was : for file in <directory_name>/*.* ;do cat $file | grep -v '^$' >> temp_file rm $file done ... (7 Replies)
Discussion started by: kumarjt
7 Replies

5. Shell Programming and Scripting

Searching the lines within a range of time period in a text file

Dear All, Please advice me, I have a text file with one field date and time like below given. I need to find out the lines whchi content the time stamp between Wed May 26 11:03:11 2010 and Wed May 26 11:03:52 2010 both can be included, using awk command which could be an interactive so that I... (6 Replies)
Discussion started by: chinmayadalai
6 Replies

6. UNIX for Dummies Questions & Answers

Replace nth character in a file with a period

Hi all, If you look at the example below,I want to replace the 21st character (,) with a period (.). I have 1000 records in a file can someone help me how to do that. Thankyou all in advance. "2008-07-15... (3 Replies)
Discussion started by: blackhawk_123
3 Replies

7. Programming

erroneous output

#include<stdio.h> int main () { FILE* f_read; FILE* f_write; char *string; f_read=fopen("file1","r"); while(!feof(f_read)); { fscanf(f_read,"%s",string); fprintf(stdout,"%s\n",string); ... (2 Replies)
Discussion started by: bishweshwar
2 Replies
Login or Register to Ask a Question