There are several ways to detect portals in Nethack. Portals count as a trap and can be found any way that a trap could be. This is most important on the Elementals, where speed is key. The usual methods are:

Community content is available under CC-BY-SA unless otherwise noted.