How to use unrar in Ubuntu

[If unrar is not installed]

$ sudo apt-get unrar

[To extract a file]

$ unrar e file.rar