Monday, May 13, 2013

Removing a file/directory that starts with a "-" in Linux/Unix

Removing a file/directory that starts with the character "-" can be tricky in Linux/Unix. On Linux/Unix you may get this error when attempting to remove a file/directory:
rm: invalid option -- '1'

Some commands may give you a hint e.g.
Try `rm ./-1' to remove the file `-1'.

This is exactly what is required i.e just append the "./" to the file/folder to resolve your problem.

Friday, May 10, 2013

Slow startup of Weblogic server on Linux

Had a strange problem on our Linux server recently after installing Weblogic 10. The server was very slow to startup. Seems the problem is this bug in Java 5: Bug 6202721

The fix is to edit the java.security file in the jre/lib/security folder of your java installation on the server. Alter the securerandom.source field to be file:/dev/./urandom as suggested in this article: How to improve Weblogic Servers Startup Time