To get the MD5 hash of a file in Linux, use the `md5sum` command followed by the file name.