I noticed that the Yosemite system has been creating files with names just "()" and "()!" in places where I recently made bash commands and want to know why. I can't even delete them use rm as after I press enter the cursor just moves to the next line like a unfinished command. I tried google but I guess the keywords () is too general to give me back a meaningful answer.
Bash, by itself, will not create files like this. These files are probably created by you accidentally through incorrect typing/pasting of commands.
You can remove the files using rm:
rm '()' '()!'