-
Notifications
You must be signed in to change notification settings - Fork 1.9k
SC2083
Joachim Ansorg edited this page Oct 31, 2022
·
2 revisions
gcc -o myfile file.c
./ myfilegcc -o myfile file.c
./myfileContrary to popular belief, there is no command or syntax ./ that runs a file.
./myfile is simply the shortest path equivalent to myfile that specifies a directory and therefore causes a shell to run it as-is, instead of trying to find its directory using $PATH.
Therefore, to run a file in the current directory, use ./myfile and not ./ myfile.
None
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!