Reputation: 79
By mistake I have createad file with name:
0); if (count($keys->toArray()) 0) { $this->obj->api(messages.send, [ access_token > $this->group->getAccessToken(), user_id > $this->userId, message > Я
I'm not able to remove it via ssh or sftp.
Is there any way?
Upvotes: 2
Views: 1788
Reputation: 70909
Remove the file by its inode number.
Every filesystem entry has a number, called the inode number. With this you can remove a file without referencing the file's name
ls -il
Will list inode numbers along with the long entry. For example:
> ls -il example
8460278 -rw-r--r-- 1 edwbuck edwbuck 0 Mar 30 21:13 example
which can be removed by
> find . -inum 8460278 -exec rm -i {} +
which will use the find command to locate the file and then pass the difficult to type name (properly escaped) to the rm
command. If you don't like the "prompt me if I really want to do it" behavior in rm
remove the -i
option.
Upvotes: 6
Reputation: 28599
If you have an SSH connection, you should just be able to delete this using bash auto-complete; tested and working.
rm -- 0<tab>
Evaluates to the escape sequence:
rm -- 0\)\;\ \ \ \ \ \ \ \ \ \ if\ \(count\(-\>toArray\(\)\)\ \ 0\)\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ -\>obj-\>api\(messages.send\,\ \[\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ access_token\ \>\ -\>group-\>getAccessToken\(\)\,\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ user_id\ \>\ -\>userId\,\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message\ \>\ Я
Upvotes: 0