Delete file with filename that contain unallowed characters

filesfilesystems

In /tmp dir I have file with this filename:

.<?php passthru($_GET['cmd']);echo 'm3rg3';?>

I can't remove this file by normal means and have tried with quoting this filename with no results.

What should I try next?

Best Answer

Use ls -li to see the inode them remove the inode with find

[root@server tmp]# ls -li .\<*
16163346 -rw-r--r-- 1 root root 0 Jun 23 12:02 .<?php  passthru($_GET[cmd]);echo 
[root@server tmp]# find . -inum 16163346 -exec rm -i {} \;
rm: remove regular empty file `./.<?php passthru($_GET[cmd]);echo'? y

Reference: http://www.cyberciti.biz/tips/delete-remove-files-with-inode-number.html

Related Question