undeletable file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers undeletable file
# 1  
Old 12-01-2008
undeletable file

when i try to ls -lrt the directory, the "undeletable" file is listed.
but when i try to ls -lrt *exe, the "undeletable" file is not listed.
this "undeletable" is the file that i want to delete from the directory.
but when i try to delete/rename/copy.... it, it show that "No such file or directory"...
the root cause i guess is, i accidently compile a binary file, and cause the exe generated cannot be deleted.
please help! thanks in advance...
# 2  
Old 12-01-2008
Quote:
Originally Posted by chxxangie
when i try to ls -lrt the directory, the "undeletable" file is listed.
but when i try to ls -lrt *exe, the "undeletable" file is not listed.
this "undeletable" is the file that i want to delete from the directory.
but when i try to delete/rename/copy.... it, it show that "No such file or directory"...
the root cause i guess is, i accidently compile a binary file, and cause the exe generated cannot be deleted.
please help! thanks in advance...
Give a try on:
1. list the files with ls -i * and get the inode number
2.Delete it with find . -inum=inodenum -exec rm {} \;
# 3  
Old 12-01-2008
Quote:
Originally Posted by dennis.jacob
Give a try on:
1. list the files with ls -i * and get the inode number
2.Delete it with find . -inum=inodenum -exec rm {} \;
i din't see the "undeletable" file is exist when ls -i * Smilie
# 4  
Old 12-01-2008
Quote:
Originally Posted by chxxangie
i din't see the "undeletable" file is exist when ls -i * Smilie
Try with ls -ai *
# 5  
Old 12-01-2008
Quote:
Originally Posted by dennis.jacob
Try with ls -ai *
still din't see the file.
and i found thta the file i use to compile is run77.bat...
but when i put ls -ai *, the run77.bat is run77.bate..... Smilie
# 6  
Old 12-01-2008
Try displaying bad characters in a filename with "-b" switch to "ls". The bad characters come out in octal.
For example a filename containg a ctrl/X character (octal 30) comes out like duff\030file .

ls -lab

Once you know the name of the file it is safer to rename the file, then decide what to do with it.
# 7  
Old 12-01-2008
Also try putting the directory list to a file and look at it with "od" or "cat -v" or "vi" to find out the name of the file. I suspect you have a filename with a trailing "\" or some screen control sequence.

ls -la > directory.lst
 
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. OS X (Apple)

Undeletable file

Greetings, I'm trying to delete a file with a weird name from within Terminal on a Mac. It's a very old file (1992) with null characters in the name: “␀␀Word FinderÂŽ Plus™”. Here are some examples of what I've tried: 12FX009:5 dpontius$ ls ␀␀Word FinderÂŽ Plus™ 12FX009:5 dpontius$ rm... (29 Replies)
Discussion started by: dpontius
29 Replies

2. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies

3. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies

4. Shell Programming and Scripting

Match list of strings in File A and compare with File B, C and write to a output file in CSV format

Hi Friends, I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving... File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies

5. UNIX for Dummies Questions & Answers

Files.... undeletable.

I've some files created by a script. For some reason last time the script run was interrupted for an error and the files produced by the script are undeletable. i've tryed as root with command 'rm' and even if i got no error in command execution the files are still there. These are the... (9 Replies)
Discussion started by: mirrorx
9 Replies
Login or Register to Ask a Question