LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

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

Rep: Reputation: 0
file execution doubt


hi

Why itís sometime necessary to prefix Ď./í to run an executable file
 
Old 09-25-2003, 04:42 AM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix, 98,2000 + various
Posts: 3,171

Rep: Reputation: 52
because the current directory isn't in the path.
the ./ means "in this directory".
 
Old 09-25-2003, 02:23 PM   #3
coolamit78
Member
 
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]
 
  


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 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 05:51 PM
script execution - file/directory permission issue serksimper Linux - Enterprise 1 08-10-2005 04:01 PM
Doubt in C++ zeropash Programming 1 07-05-2005 01:33 PM
File execution on ftp (vsftpd) rkemp General 1 03-13-2004 08:48 AM
DOUBT .- jordomi Linux - Distributions 2 08-23-2000 07:53 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration