Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
I have been reading through a few posts and many say try this command or that command but when I try to run them it just says command not found. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2003
    Location
    UK
    Posts
    12

    Running Commands


    I have been reading through a few posts and many say try this command or that command but when I try to run them it just says command not found. Where are the main commands held and is there a way to set a path to them

    ta

    simon

    :o :o :o

  2. #2
    Linux User
    Join Date
    Feb 2003
    Location
    Norway, Asker
    Posts
    267
    I'd guess some commands are ment to be ran as root. Are you running as it?
    Can you give some examples?

    Good luck

  3. #3
    Linux User Allblack's Avatar
    Join Date
    May 2003
    Location
    Godzone
    Posts
    416
    I'll have a go at answering this one. I'll probably will be corrected by someone as I rather new to Linux myself.
    [code]
    If you are logged on as a user you access to commands is restricted. Try logging on as root.
    You also need to modify your path variable so it includes the directory of your command. I think most commands are located in /sbin

    When you modify your path (I think it is .bash_profile) you need to
    run the source command afterwards to activate changes



    [code]source .bash_profile[/code]

    Please correct me if I am wrong

  4. #4
    Just Joined!
    Join Date
    Jun 2003
    Location
    UK
    Posts
    12
    I have been running the commands as root

    examples are

    hdparm and acpid

    the hdparm command is in /sbin

    but how exactly do I add it to my path (newbie)

    ta

    simon



  5. #5
    Linux User Allblack's Avatar
    Join Date
    May 2003
    Location
    Godzone
    Posts
    416
    If you are running as root they should work as all the root commands are stored in /sbin.

    Maybe they are not installed

    try
    Code:
    which hdparm
    which acpid
    If it can't find it, it is not installed

    If you type echo $PATH you will see which directories are included.
    /sbin will be there if you are root



    cheers[/code]

  6. #6
    Just Joined!
    Join Date
    Jun 2003
    Location
    UK
    Posts
    12
    I should have said I su to root in a terminal but the /sbin is not in the path. How do I add it to my path.

    ta

    simon

  7. #7
    Linux User
    Join Date
    Feb 2003
    Location
    Norway, Asker
    Posts
    267
    did you use "su" or "su -"

    If you only use "su", then use "su -" and try again

    Good luck

  8. #8
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Precisely. su just forks a new shell that inherits the environment variables of your current shell, including PATH. "su -", on the other hand, will perform the full login process, which includes removing all environment variables and then set them to the appropriate values for the new user. If that new user is root, then PATH will naturally include */sbin.
    If you wish to set them manually, though, do this:
    Code:
    PATH=/usr/local/sbin:/sbin:/usr/sbin:$PATH

  9. #9
    Just Joined!
    Join Date
    Jun 2003
    Location
    UK
    Posts
    12
    thanks all sorted

    simon


  10. #10
    Just Joined!
    Join Date
    Oct 2002
    Posts
    45
    Don't you have to export $PATH after you set it?

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •