Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I compiled a program called hello but when I try to run it, the command line responds with bash: hello command not found. Why won my programs run on Red Hat?

0
Posted

I compiled a program called hello but when I try to run it, the command line responds with bash: hello command not found. Why won my programs run on Red Hat?

0

This problem is generally caused by the location of the program not being specified in your general path. The path is where Linux (like Windows) will search for a working executable. The current working directory is not in your path because of possible security exploits of a command masking itself as another one. To run your file, you can either put the directory with hello in your path (you can find out what the path is by typing echo $PATH) OR move the hello program into a directory that is in your path. Alternatively, and perhaps most common, you can simply run hello by typing ./hello from within the directory containing the program.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123