Pages

Monday, July 13, 2009

Delete Linux files with illegal Characters

If a file has been created with invalid or illegal characters, your FTP program or the rm command may choke on it. Here's a quick way to delete it in ssh.

navigate to the correct directory, then:
ls -il

You'll see somehthing like
782263 -rw-r--r-- 1 viv viv 0 2006-01-27 15:49 \+Xy \+\8

"\+Xy \+\8" represents the bad filename

find . -inum 782263 -exec rm -i {} \;

replace 782263 with the number associated with your bad filename.

You'll be prompted to verify the correct file is being delted. Type "y" and "Enter" if it is correct.

This information came from:
http://www.cyberciti.biz/tips/delete-remove-files-with-inode-number.html

No comments: