I heard I need to edit either my path in either .profile
or .bashrc
.
For example, instead of having to run a script or the output of a c++ program
like "./a.out"
, I just want to be able to type "a.out"
?
Your program needs to be in one of the paths specified in your search path.
So you if your program is located in my_directory
:
export PATH=$PATH:my_directory
This can be added to your .profile / .bashrc
It often makes sense to put your executables in standard Unix folders such as /usr/local/bin
(already in the $PATH
)
Note:
.
) to your $PATH
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.