Why do we use ./filename to execute a file in linux?Why not just enter it like other commands gcc, ls etc...
Why do we use ./ to execute a file?
command line;executable
In Linux, UNIX and related operating systems, . denotes the current directory. Since you want to run a file in your current directory and that directory is not in your $PATH, you need the ./ bit to tell the shell where the executable is. So, ./foo means run the executable called foo that is in this directory.You can use type or which to get the full path of any commands found in your $PATH.