LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I can't see the difference between the two commands (https://www.linuxquestions.org/questions/linux-newbie-8/i-cant-see-the-difference-between-the-two-commands-118570/)

xailer 11-21-2003 01:39 PM

I can't see the difference between the two commands
 
hi
Im using the following command to restart automounter:

/etc/rc.d/init.d/autofs restart

But if I first browse to directory in which autofs resides in:

cd /etc/rc.d/init.d

;and then try to issue command:

autofs restart

I get command not found error.

Why is the first command working and second isn't?I can't see any difference between the two of them?

thank you

trickykid 11-21-2003 01:47 PM

Because /etc/rc.d/init.d/ is not in your path to execute commands. Either add that path to your $PATH or you will either have to type the full path to it or cd into the directory and issue a ./ in front of the command.

fancypiper 11-21-2003 01:48 PM

Try ./autofs restart

That means "the file is in the directory I am working in".

xailer 11-21-2003 02:14 PM

great,it works:)

But why can you run files from same directory and not programs?

in doesn't make sense

thank you:)


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