I have a directory mainfolder with a subdirectory execution which contains a configure script. I can switch to the execution directory and run ./configure and it works fine. Now I'm trying to figure out how to run the configure script when I'm in mainfolder. I tried:

./configure /execution


./configure execution

but neither worked. I also tried the same thing using the full path either starting from root directory or from user directory like this:

./configure /home/etc/user/mainfolder/execution
./configure user/mainfolder/execution

I always got the message:

bash: ./configure: No such file or directory

Finally, I tried:

. /home/etc/user/mainfolder/execution/configure

Both gave me the error:

sed: can't read makefile.in: No such file or directory

How can I do this?

  • @Dchris , could you run file /home/etc/user/mainfolder/execution/configure and if its a script or ascii text do a grep -A5 -B5 "sed" file /home/etc/user/mainfolder/execution/configure and paste the result here ? ..... it might be that the makefile.in which i think sed is supposed to make change/update to might be missing or the path might have been changed. This was we can confirm it.
    – Nitin4873
    Jun 9, 2013 at 9:38
  • @NSD Updated result in my question
    – Dchris
    Jun 9, 2013 at 9:52
  • @Dchris , sorry .... forgot to remove the 'file' from the grep
    – Nitin4873
    Jun 9, 2013 at 9:53
  • @Dchris ,thank you .. the sed command is substituting some values from/to the makefile.in descriptor file .... the makefile.in seems to be mentioned a bit below in the command than what has been reported back by the grep command ..... you would need to locate that makefile.in and change the path/location so that it is accessible in the /home/etc/user/mainfolder/execution/configure directory then it should work fine
    – Nitin4873
    Jun 9, 2013 at 9:56
  • @NSD makefile.in file is located in the same directory as configure file is
    – Dchris
    Jun 9, 2013 at 10:01

3 Answers 3


First confirm that the configure script is present where you think it is. Second make sure that it's executable:

$ ls -l ./configure 
-rwxrwxr-x 1 saml saml 100 Jun  9 05:11 ./configure

If both of the checks are OK then you might want to try running configure by first changing directories to /mainfolder/execution and then running configure like this:

$ cd /mainfolder/execution
$ ../configure

You also might want to try it this way:

$ cd /mainfolder
$ ./configure execution


According to comments left by OP, the following directory structure appears to be what he's describing:

$ tree -f
`-- /mainfolder
    `-- /mainfolder/execution
        `-- /mainfolder/execution/configure
  • $ ls -l ./configure command is ok when i run it in execution directory but when i run it in mainfolder directory i have the message "ls:cannot access"
    – Dchris
    Jun 9, 2013 at 9:23
  • ./configure execution didn't work
    – Dchris
    Jun 9, 2013 at 9:37
  • OK, so what you're telling us is that the configure script is present in the directory /mainfolder/execution and not in the dir. /mainfolder. This would explain why you can't run configure from the /mainfolder, it isn't located where you think it is.
    – slm
    Jun 9, 2013 at 13:27
  • Does my edit reflect what dir. structure you have? If this is correct, then you can't run configure the way you've been trying to.
    – slm
    Jun 9, 2013 at 13:32
  • what is tree -f?
    – Dchris
    Jun 9, 2013 at 13:34

In *nix / always is the root directory of the whole file system and . always refers to the current working directory.

Every path starting with / is an absolute path. Every path starting with . is a relative path.

Hence /home/... is probably correct, as this directory lives it the root directory, whereas /excecution is probably wrong as this directory does not live in the root directory, but somewhere under /home/....

If you say ./configure, you try to run the file configure living in the current working directory (.).

The error No such file or directory, well, just says that there is no file named configure in the current working directory.

You can use pwd to show, what the current working directory is. Use ls to show what files exist there. Use cd to change the current working directory.

To help you with your actual problem. You need to say what you were trying to do. Why do you want to run configure? What is it supposed to do? Why do you think you need to specify the execution directory?


The problem is that I have to run the file but don't change my current directory. So I tried this and worked:

cd execution/ && ./configure
  • 2
    I'm glad you were able to solve you issue but in the future, please try and ask your question correctly and give accurate information. I realize this might be difficult given your new to Linux, but your question and all these answers is of little value to the Unix & Linux site as a whole. As you refine your question through comments and your own research feel free to update and refine your question. At this point you've wasted a lot of peoples time and left a bit of a mess here now with this useless question. I don't mean this in a rude way at all, I'm just trying helping you to understand.
    – slm
    Jun 9, 2013 at 13:42
  • This doesn't do the job anyhow, does it? You end up in the execution directory as your current working directory after doing this command. Mar 4, 2016 at 5:02
  • The actual answer is here: stackoverflow.com/questions/786376/… Mar 4, 2016 at 5:04

Not the answer you're looking for? Browse other questions tagged .