LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-20-2005, 11:09 AM   #1
Anupam Pathak
LQ Newbie
 
Registered: Sep 2005
Posts: 3

Rep: Reputation: 0
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
 
Old 10-20-2005, 11:14 AM   #2
ciotog
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Slackware current
Posts: 728
Blog Entries: 2

Rep: Reputation: 43
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
 
Old 10-20-2005, 11:15 AM   #3
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 47
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off




All times are GMT -5. The time now is 02:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration