There is a file on my Ubuntu file system named
-J and I cannot remove it via command line.
rmcommand gave me this error
rm: invalid option -- 'J'
This is because symbol
- is used for defining options such as
rm -r or
rm -f. Running command
rm -J will literally execute
rmcomamnd with option
There is 3 fixes available for you to try.
./ at the front of the file name
$ rm ./-J
$ rm -- -J
3. Use graphical interface. Access your Linux via Desktop and delete it from there by hitting DEL button or right-click and delete the file.