Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 09-25-2003, 03:30 AM   #1
LQ Newbie
Registered: Sep 2003
Posts: 9

Rep: Reputation: 0
file execution doubt


Why itís sometime necessary to prefix Ď./í to run an executable file
Old 09-25-2003, 03:42 AM   #2
Senior Member
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,186

Rep: Reputation: 52
because the current directory isn't in the path.
the ./ means "in this directory".
Old 09-25-2003, 01:23 PM   #3
Registered: Aug 2003
Location: New Delhi, India
Distribution: RHEL AS 3/4, Windows XP
Posts: 546

Rep: Reputation: 31
Well yes, I would just like to give some more details for those who find the answer a bit complicated or those just migrating from windows to Linux platform....

In Unix/Linux, there are 2 kinds of paths:

1. Absolute Path
2. Relative Path

1. Absolute Path -> This is the complete path which needs to be given in order to execute a particular file in relation to the root directory(/).
for example, to run the command 'clear' which is located in /usr/bin, we can specify the complete path to the command...i.e

$ /usr/bin/clear

2. Relative Path -> A Relative path does not be start with a '/'. It specifies the path in relation to the 'current directory'.

There are 2 shortcuts that the system creates for every directory file created namely (.) and (..) where (.) stands for the current directory and (..) means the parent directory (one-level up).

So, suppose, if our present working directory is /usr/local/bin and we want to execute the clear command, located in /usr/bin then the relative path will be as follows:

$ ../../bin/clear

Thus, ./filename infoms the shell that the file <filename> is an executable located in the current directory.

for example

[user@localhost bin]$ ./configure [. stands for /usr/bin]


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java 2 JRE RPM bin file execution linux101 Linux - Newbie 3 09-20-2006 04:51 PM
script execution - file/directory permission issue serksimper Linux - Enterprise 1 08-10-2005 03:01 PM
Doubt in C++ zeropash Programming 1 07-05-2005 12:33 PM
File execution on ftp (vsftpd) rkemp General 1 03-13-2004 07:48 AM
DOUBT .- jordomi Linux - Distributions 2 08-23-2000 06:53 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:31 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