Skip to main content
Fleshed it out a little since we're closing another question against it.
Source Link
terdon
  • 252.2k
  • 69
  • 480
  • 718

YouIn 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, since./foo means run the current directory is unlikely to be inexecutable called $PATHfoo that is in this directory.

You can use type or which to get the full path to "otherof any commands found in your $PATH."

You need the ./ bit to tell the shell where the executable is, since the current directory is unlikely to be in $PATH.

You can use which to get the full path to "other commands."

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.

:|
Source Link
badp
  • 3k
  • 2
  • 26
  • 32

a.out is the default output name for a program compiled with gcc. You can change it with the -o option.

You need the ./ bit to tell the shell where the executable is, since the current directory is unlikely to be in $PATH.

You can use which to get the full path to "other commands."

a.out is the default output name for a program compiled with gcc. You can change it with the -o option.

You need the ./ bit to tell the shell where the executable is, since the current directory is unlikely to be in $PATH.

You can use which to get the full path to "other commands."

You need the ./ bit to tell the shell where the executable is, since the current directory is unlikely to be in $PATH.

You can use which to get the full path to "other commands."

Source Link
badp
  • 3k
  • 2
  • 26
  • 32

a.out is the default output name for a program compiled with gcc. You can change it with the -o option.

You need the ./ bit to tell the shell where the executable is, since the current directory is unlikely to be in $PATH.

You can use which to get the full path to "other commands."