LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   using ./ (https://www.linuxquestions.org/questions/linux-newbie-8/using-375064/)

Anupam Pathak 10-20-2005 10:09 AM

using ./
 
hello all,
whenever we have to execute any executable file why we use ./ before a.out please mail me answers as soon as possible. thanks
bi
Anupam

ciotog 10-20-2005 10:14 AM

By default the current working directory isn't in the PATH so you have to explicitly use ./ for your program to be found.

Oh yeah, good luck on your test ;)

oneandoneis2 10-20-2005 10:15 AM

Because of the following scenario:

Malicious user is able to put malware into your home directory, with the same filename as a common command - "ls" or "cd", for instance.

If just typing the filename worked, then you could run the malware instead of the proper file - infecting your computer.

By requiring the ./ at the front, which specifies the current directory, the above scenario can never happen, as you would have to type "./ls" instead of just "ls"

Good luck with the homework ;)


All times are GMT -5. The time now is 08:13 PM.