Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-20-2005, 10: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
Old 10-20-2005, 10:14 AM   #2
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, 10:15 AM   #3
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


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:45 PM.

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