I had a problem in Lion where empty trash would just sit there. In Terminal I ran the command sudo rm ~rf ~/.Trash/* But an error message says that 'filename' is a directory. How can I get rid of this from the trash?
Correct your command:
Use the minus sign "-" in front of "rf", since the options to the most commands are given with the minus sign "-", not with the tilde sign "~". The tilde sign "~" represents your home directory, that's why ~/.Trash is translated to the .Trash sub-directory in your home folder.
I intentionally skipped the "sudo" from your command, since you do not need root permissions to delete your own user's files. It is dangerous to use sudo if you do not know where it's needed.