Previous 1 2 Next 18 Replies Latest reply: Jun 17, 2007 8:47 AM by Michael Conniff Go to original post
  • ~Bee Level 7 Level 7 (31,160 points)
    Agreed.

    Peter, how are you coming along?
    Have you re-examined Michael's last suggestion yet?
    Scapesuiter and Niel gave great advice, as well.
  • Peter Robertson Level 1 Level 1 (85 points)
    I got a little swamped at work and have not had time to look at the files yet. I have a more basic question though, and that is when I try to execute the command

    ls -a

    shouldn't I get a list of files in the current directory?

    I get (when I try to run it from my home directory)

    -bash: ls: command not found

    What does that mean??? Before I start moving files around I'd like to be able to look at my directories.

    Peter

    Power Book G4 Mac OS X (10.3.9)
  • Niel Level 10 Level 10 (281,835 points)
    Because your PATH property isn't correct, you will need to specify the full path to every Terminal command you want to use instead of providing the name of the command. Use the following:

    /bin/ls -a

    (22333)
  • Michael Conniff Level 7 Level 7 (33,125 points)
    Peter

    Before I start moving files around I'd like to be able to look at my directories.

    I haven't yet asked you to move any files around, just to look to see which file is messing up your path.

    I go away tomorrow for a week. You can take my advice or not.

    Open the Terminal (from /Applications/Utilities) and copy and paste the following into the Terminal window followed by a return:

    export PATH="${HOME}/${MACHTYPE}/bin:${HOME}/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbi n:/sbin"

    Now try using ls or any of the other commands: magic isn't it?

    You should now be able to run

    sudo periodic daily weekly monthly

    (and supply your password) to run all your maintenance tasks. Note the password is not echoed, you must type it blind, followed by a return.

    OK so far, but the minute you quit Terminal you will lose that nice path that let's you do this stuff, and you don't want to type that every time, do you?

    So I prepared these instructions for you in advance. I really wanted to see which of your files had got the wrong entry, and discover how that had happened, but no time for that now.

    We'll set up a decent .bash_profile and .bashrc for you. You will need both, since I have arranged for .bash_profile to source .bashrc. That way you will have the same environment in all your Terminal windows.

    Note some of this will involve secondary prompts, e.g. '>' which you don't type or copy; just the stuff in black.

    Open the Terminal (from /Applications/Utilities) and copy and paste the following into the Terminal window, one line at a time, with a return after each line:

    /bin/cat >| ~/.bashrc <<END
    >export PATH="${HOME}/${MACHTYPE}/bin:${HOME}/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbi n:/sbin"
    >export MANPATH="${HOME}/man:/usr/local/share/man:/usr/share/man"
    >END
    /bin/cat >| ~/.bash_profile <<END
    >if [ -r ~/.bashrc ]; then
    > . ~/.bashrc
    >fi
    >END

    You will need to quit Terminal and restart it for this to take effect. Then all the standard commands will be available without you needing to specify the complete path.


    There. Don't forget to copy and paste all of that, because the shell is very picky about this stuff and will not tolerate errors.
Previous 1 2 Next