Where is the default terminal $PATH located on Mac?

后端 未结 4 1400
挽巷
挽巷 2021-01-30 00:52

I have been looking throughout the system but I cannot find it. When I do echo $PATH I get the stuff I added, plus the default path. I do not have a .profile, and I do have a .b

4条回答
  •  时光取名叫无心
    2021-01-30 01:24

    If you start at /etc/profile, it should look something like this:

    if [ -x /usr/libexec/path_helper ]; then
        eval `/usr/libexec/path_helper -s`
    fi
    

    It's testing to see if the file exists and if so, executes it. If you execute it by hand, you'll get something like this:

    PATH="/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/X11/bin"; export PATH;
    

    I believe that's what you're looking for. So it comes from /etc/profile, which in turn calls an executable that sets the path.

提交回复
热议问题