What is the purpose of using ./ before the executable name?

0131

The ./ before an executable name is used to specify that the executable is located in the current directory. By default, the shell does not include the current directory in its search path for executables for security reasons. Therefore, using ./ tells the shell to look for the executable in the current directory.

For example, if you have a compiled program named my_program, you would run it with:

./my_program

This ensures that the shell executes the my_program file located in the current directory.

0 Comments

no data
Be the first to share your comment!