LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-21-2003, 01:39 PM   #1
xailer
Member
 
Registered: Nov 2003
Posts: 77

Rep: Reputation: 15
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
 
Old 11-21-2003, 01:47 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
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.
 
Old 11-21-2003, 01:48 PM   #3
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
Try ./autofs restart

That means "the file is in the directory I am working in".
 
Old 11-21-2003, 02:14 PM   #4
xailer
Member
 
Registered: Nov 2003
Posts: 77

Original Poster
Rep: Reputation: 15
great,it works

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

in doesn't make sense

thank you
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
What's The Difference Rick069 Linux - General 3 10-16-2005 06:42 PM
difference between df -k and du -s Prasun1 Linux - General 3 06-22-2005 06:07 PM
what is difference between "reset" and "clean " commands? zameer_india Linux - Newbie 2 01-10-2005 06:23 AM
What is the difference...? ralexand88 Linux - Newbie 4 03-12-2004 04:57 AM
What's the difference...? fxlee Linux - Newbie 1 02-23-2002 05:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:37 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration