Next, we are going to use the which utility to help us search for directories. Unlike the previous example, we do not need to specify the file extension; the which utility is used to locate the file path of an executable file. Simply put, the which utility will provide you with the file path only:
The preceding screenshot shows where the which nc command was used to retrieve the Netcat path within Kali Linux.