0
[root@host dir1]# ls -lrt
total 412
-rw-r--r-- 1 root root  13747 Jun  3 16:01 -lang?[5~?[5~?[5~?[5~?:q!

We tried different ways and they don't work.

[root@host dir1]#  ls -lrt | tail -1 | awk '{print $9}' | xargs -I file rm file
rm: invalid option -- 'l'
Try `rm ./'-langq!'' to remove the file `-lang\033[5~\033[5~\033[5~\033[5~\033:q!'.
Try `rm --help' for more information.

[root@host dir1]# rm ./'-langq!''
> ^C
DavidPostill
  • 162,382
chz
  • 529
  • 3
  • 12
  • 19

1 Answers1

0

I created a file with weird characters and deleted it with this:

rm *lang*

wildcards make life easier for everyone. I entered these 2 sentences because of the character requirements.

m79lkm
  • 701