My MacOSX terminal doesn't show the current directory

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












No matter what directory I enter, the terminal always shows me the root directory which is "Nidas-MBP"



Nidas-MBP% cd Projects
Nidas-MBP% ls
09-Selector-Exercise-Starter.zip My Little Form
09_Selector_Exercise_Starter Prefix Free File
Blog Recursion Practice
Callbacks Themes
Callbacks-Exercise Todo-Vanilla
Copywriting css3-contact-form.zip
Freelancer Theme webpack-deepdive
Frog Chase

Nidas-MBP% cd webpack-deepdive
Nidas-MBP% ls
es6-todomvc
Nidas-MBP%


I have tried adding the following command to end of the ~/.bashrc file and the ~/.profile file but the terminal still remained unchanged.



PS1='[u W$] '


When I run echo "$PS1" it says


%m%#


I found two lines PS1=[ W]$ PS1='[ W]$ ' inside ~/.bash_profile, so I replaced them both with PS1='[u W$] ' and typed source ~/.bash_profile. In response, my terminal started saying [u W$] instead of Nidas-MBP.



I have no idea what I should do now to bring it back to the way it used to be.










share|improve this question























  • I cannot reproduce Darwin Kernel Version 17.4.0. Have you sourced the .bashrc and .profile files after making the changes? and/or restarted your terminal?
    – Jesse_b
    Aug 16 at 16:51











  • @Jesse_b I am not sure what you mean by "sourced the files" but yes I did quit and restart my terminal after the change in the files.
    – rgb_jewel
    Aug 16 at 16:59






  • 1




    What is the current value of $PS1?
    – RalfFriedl
    Aug 16 at 17:02










  • @RalfFriedl How do I check that?
    – rgb_jewel
    Aug 16 at 17:04






  • 2




    That's not the root directory. The root directory is named /. (It's not a directory at all, in fact. And you are not using the Bourne Again shell.)
    – JdeBP
    Aug 16 at 17:36















up vote
0
down vote

favorite












No matter what directory I enter, the terminal always shows me the root directory which is "Nidas-MBP"



Nidas-MBP% cd Projects
Nidas-MBP% ls
09-Selector-Exercise-Starter.zip My Little Form
09_Selector_Exercise_Starter Prefix Free File
Blog Recursion Practice
Callbacks Themes
Callbacks-Exercise Todo-Vanilla
Copywriting css3-contact-form.zip
Freelancer Theme webpack-deepdive
Frog Chase

Nidas-MBP% cd webpack-deepdive
Nidas-MBP% ls
es6-todomvc
Nidas-MBP%


I have tried adding the following command to end of the ~/.bashrc file and the ~/.profile file but the terminal still remained unchanged.



PS1='[u W$] '


When I run echo "$PS1" it says


%m%#


I found two lines PS1=[ W]$ PS1='[ W]$ ' inside ~/.bash_profile, so I replaced them both with PS1='[u W$] ' and typed source ~/.bash_profile. In response, my terminal started saying [u W$] instead of Nidas-MBP.



I have no idea what I should do now to bring it back to the way it used to be.










share|improve this question























  • I cannot reproduce Darwin Kernel Version 17.4.0. Have you sourced the .bashrc and .profile files after making the changes? and/or restarted your terminal?
    – Jesse_b
    Aug 16 at 16:51











  • @Jesse_b I am not sure what you mean by "sourced the files" but yes I did quit and restart my terminal after the change in the files.
    – rgb_jewel
    Aug 16 at 16:59






  • 1




    What is the current value of $PS1?
    – RalfFriedl
    Aug 16 at 17:02










  • @RalfFriedl How do I check that?
    – rgb_jewel
    Aug 16 at 17:04






  • 2




    That's not the root directory. The root directory is named /. (It's not a directory at all, in fact. And you are not using the Bourne Again shell.)
    – JdeBP
    Aug 16 at 17:36













up vote
0
down vote

favorite









up vote
0
down vote

favorite











No matter what directory I enter, the terminal always shows me the root directory which is "Nidas-MBP"



Nidas-MBP% cd Projects
Nidas-MBP% ls
09-Selector-Exercise-Starter.zip My Little Form
09_Selector_Exercise_Starter Prefix Free File
Blog Recursion Practice
Callbacks Themes
Callbacks-Exercise Todo-Vanilla
Copywriting css3-contact-form.zip
Freelancer Theme webpack-deepdive
Frog Chase

Nidas-MBP% cd webpack-deepdive
Nidas-MBP% ls
es6-todomvc
Nidas-MBP%


I have tried adding the following command to end of the ~/.bashrc file and the ~/.profile file but the terminal still remained unchanged.



PS1='[u W$] '


When I run echo "$PS1" it says


%m%#


I found two lines PS1=[ W]$ PS1='[ W]$ ' inside ~/.bash_profile, so I replaced them both with PS1='[u W$] ' and typed source ~/.bash_profile. In response, my terminal started saying [u W$] instead of Nidas-MBP.



I have no idea what I should do now to bring it back to the way it used to be.










share|improve this question















No matter what directory I enter, the terminal always shows me the root directory which is "Nidas-MBP"



Nidas-MBP% cd Projects
Nidas-MBP% ls
09-Selector-Exercise-Starter.zip My Little Form
09_Selector_Exercise_Starter Prefix Free File
Blog Recursion Practice
Callbacks Themes
Callbacks-Exercise Todo-Vanilla
Copywriting css3-contact-form.zip
Freelancer Theme webpack-deepdive
Frog Chase

Nidas-MBP% cd webpack-deepdive
Nidas-MBP% ls
es6-todomvc
Nidas-MBP%


I have tried adding the following command to end of the ~/.bashrc file and the ~/.profile file but the terminal still remained unchanged.



PS1='[u W$] '


When I run echo "$PS1" it says


%m%#


I found two lines PS1=[ W]$ PS1='[ W]$ ' inside ~/.bash_profile, so I replaced them both with PS1='[u W$] ' and typed source ~/.bash_profile. In response, my terminal started saying [u W$] instead of Nidas-MBP.



I have no idea what I should do now to bring it back to the way it used to be.







shell-script command-line osx zsh bashrc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 16 at 17:50









JdeBP

29.4k460136




29.4k460136










asked Aug 16 at 16:48









rgb_jewel

11




11











  • I cannot reproduce Darwin Kernel Version 17.4.0. Have you sourced the .bashrc and .profile files after making the changes? and/or restarted your terminal?
    – Jesse_b
    Aug 16 at 16:51











  • @Jesse_b I am not sure what you mean by "sourced the files" but yes I did quit and restart my terminal after the change in the files.
    – rgb_jewel
    Aug 16 at 16:59






  • 1




    What is the current value of $PS1?
    – RalfFriedl
    Aug 16 at 17:02










  • @RalfFriedl How do I check that?
    – rgb_jewel
    Aug 16 at 17:04






  • 2




    That's not the root directory. The root directory is named /. (It's not a directory at all, in fact. And you are not using the Bourne Again shell.)
    – JdeBP
    Aug 16 at 17:36

















  • I cannot reproduce Darwin Kernel Version 17.4.0. Have you sourced the .bashrc and .profile files after making the changes? and/or restarted your terminal?
    – Jesse_b
    Aug 16 at 16:51











  • @Jesse_b I am not sure what you mean by "sourced the files" but yes I did quit and restart my terminal after the change in the files.
    – rgb_jewel
    Aug 16 at 16:59






  • 1




    What is the current value of $PS1?
    – RalfFriedl
    Aug 16 at 17:02










  • @RalfFriedl How do I check that?
    – rgb_jewel
    Aug 16 at 17:04






  • 2




    That's not the root directory. The root directory is named /. (It's not a directory at all, in fact. And you are not using the Bourne Again shell.)
    – JdeBP
    Aug 16 at 17:36
















I cannot reproduce Darwin Kernel Version 17.4.0. Have you sourced the .bashrc and .profile files after making the changes? and/or restarted your terminal?
– Jesse_b
Aug 16 at 16:51





I cannot reproduce Darwin Kernel Version 17.4.0. Have you sourced the .bashrc and .profile files after making the changes? and/or restarted your terminal?
– Jesse_b
Aug 16 at 16:51













@Jesse_b I am not sure what you mean by "sourced the files" but yes I did quit and restart my terminal after the change in the files.
– rgb_jewel
Aug 16 at 16:59




@Jesse_b I am not sure what you mean by "sourced the files" but yes I did quit and restart my terminal after the change in the files.
– rgb_jewel
Aug 16 at 16:59




1




1




What is the current value of $PS1?
– RalfFriedl
Aug 16 at 17:02




What is the current value of $PS1?
– RalfFriedl
Aug 16 at 17:02












@RalfFriedl How do I check that?
– rgb_jewel
Aug 16 at 17:04




@RalfFriedl How do I check that?
– rgb_jewel
Aug 16 at 17:04




2




2




That's not the root directory. The root directory is named /. (It's not a directory at all, in fact. And you are not using the Bourne Again shell.)
– JdeBP
Aug 16 at 17:36





That's not the root directory. The root directory is named /. (It's not a directory at all, in fact. And you are not using the Bourne Again shell.)
– JdeBP
Aug 16 at 17:36











3 Answers
3






active

oldest

votes

















up vote
1
down vote













Completely reworked per JdeBP's observation, this is zsh not bash.



bash and zsh are two different shells, and use two different sets of files when you start them. bash uses .bash_profile, .bashrc, and .profile. zsh uses .zprofile, .zshrc, and others.



zsh also uses different syntax for dictating the prompt. echo $PROMPT will tell you the prompt's current setting. To display, e.g., your current directory at the prompt, add this to $ZDOTDIR/.zshrc (if ZDOTDIR is not set, zsh will use HOME instead):



PROMPT='%~> '
Source



Then either source ~/.zshrc or restart the terminal.






share|improve this answer






















  • You were right. I found two lines PS1=[ W]$ PS1='[ W]$ ' inside ~/.bash_profile, so I replaced them both with PS1='[u W$] ' and typed source ~/.bash_profile. Now my terminal says [u W$] instead of Nidas-MBP
    – rgb_jewel
    Aug 16 at 17:36






  • 1




    Psst! M. Kruse! There is a subtle clue, buried in a question comment made by the questioner, that the questioner has mis-labelled the question and is in fact using the Z shell.
    – JdeBP
    Aug 16 at 17:43










  • @JdeBP I see it now, according to Google the default prompt for zsh is %m%#. Being unfamiliar with zsh, I didn't catch that.
    – Kevin Kruse
    Aug 16 at 17:51


















up vote
0
down vote













Obviously there must be something that changes PS1 after you set it.



To find where you can




  • Use grep in your home directory and in /etc.



    grep PS1 -r /etc $HOME


  • Use set -x after you set PS1 to see where it is changed.


  • Use strace to find out which file contains that value.





share|improve this answer






















  • After I change the ~/.profile file and add the line PS1='[u W$] ' to the end of the file. Typing echo "PS1" to the terminal returns PS1.
    – rgb_jewel
    Aug 16 at 17:14










  • You should not echo "PS1", but "$PS1". And just changing the file will have no effect, you need to login again. An alternative is source .profile, but then you don't know whether it will work on login.
    – RalfFriedl
    Aug 16 at 17:17










  • Okay I've tried logging out and back in after changing the ~/.profile file but I still have the same problem. The root stills says Nidas-MBP no matter what. Typing grep in the command line showed me usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] Also using echo "$PS1" returned %m%# after logging back in.
    – rgb_jewel
    Aug 16 at 17:27











  • I added the command for grep.
    – RalfFriedl
    Aug 16 at 17:35

















up vote
0
down vote



accepted










I had no idea there was a difference in commands between bash and zsh. Apparently, I was supposed to type PS1='%m %1d$ ' instead. So I did that inside the ~/.zshrc file and it works now.



https://superuser.com/questions/1108413/zsh-prompt-with-current-working-directory






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f463018%2fmy-macosx-terminal-doesnt-show-the-current-directory%23new-answer', 'question_page');

    );

    Post as a guest






























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    Completely reworked per JdeBP's observation, this is zsh not bash.



    bash and zsh are two different shells, and use two different sets of files when you start them. bash uses .bash_profile, .bashrc, and .profile. zsh uses .zprofile, .zshrc, and others.



    zsh also uses different syntax for dictating the prompt. echo $PROMPT will tell you the prompt's current setting. To display, e.g., your current directory at the prompt, add this to $ZDOTDIR/.zshrc (if ZDOTDIR is not set, zsh will use HOME instead):



    PROMPT='%~> '
    Source



    Then either source ~/.zshrc or restart the terminal.






    share|improve this answer






















    • You were right. I found two lines PS1=[ W]$ PS1='[ W]$ ' inside ~/.bash_profile, so I replaced them both with PS1='[u W$] ' and typed source ~/.bash_profile. Now my terminal says [u W$] instead of Nidas-MBP
      – rgb_jewel
      Aug 16 at 17:36






    • 1




      Psst! M. Kruse! There is a subtle clue, buried in a question comment made by the questioner, that the questioner has mis-labelled the question and is in fact using the Z shell.
      – JdeBP
      Aug 16 at 17:43










    • @JdeBP I see it now, according to Google the default prompt for zsh is %m%#. Being unfamiliar with zsh, I didn't catch that.
      – Kevin Kruse
      Aug 16 at 17:51















    up vote
    1
    down vote













    Completely reworked per JdeBP's observation, this is zsh not bash.



    bash and zsh are two different shells, and use two different sets of files when you start them. bash uses .bash_profile, .bashrc, and .profile. zsh uses .zprofile, .zshrc, and others.



    zsh also uses different syntax for dictating the prompt. echo $PROMPT will tell you the prompt's current setting. To display, e.g., your current directory at the prompt, add this to $ZDOTDIR/.zshrc (if ZDOTDIR is not set, zsh will use HOME instead):



    PROMPT='%~> '
    Source



    Then either source ~/.zshrc or restart the terminal.






    share|improve this answer






















    • You were right. I found two lines PS1=[ W]$ PS1='[ W]$ ' inside ~/.bash_profile, so I replaced them both with PS1='[u W$] ' and typed source ~/.bash_profile. Now my terminal says [u W$] instead of Nidas-MBP
      – rgb_jewel
      Aug 16 at 17:36






    • 1




      Psst! M. Kruse! There is a subtle clue, buried in a question comment made by the questioner, that the questioner has mis-labelled the question and is in fact using the Z shell.
      – JdeBP
      Aug 16 at 17:43










    • @JdeBP I see it now, according to Google the default prompt for zsh is %m%#. Being unfamiliar with zsh, I didn't catch that.
      – Kevin Kruse
      Aug 16 at 17:51













    up vote
    1
    down vote










    up vote
    1
    down vote









    Completely reworked per JdeBP's observation, this is zsh not bash.



    bash and zsh are two different shells, and use two different sets of files when you start them. bash uses .bash_profile, .bashrc, and .profile. zsh uses .zprofile, .zshrc, and others.



    zsh also uses different syntax for dictating the prompt. echo $PROMPT will tell you the prompt's current setting. To display, e.g., your current directory at the prompt, add this to $ZDOTDIR/.zshrc (if ZDOTDIR is not set, zsh will use HOME instead):



    PROMPT='%~> '
    Source



    Then either source ~/.zshrc or restart the terminal.






    share|improve this answer














    Completely reworked per JdeBP's observation, this is zsh not bash.



    bash and zsh are two different shells, and use two different sets of files when you start them. bash uses .bash_profile, .bashrc, and .profile. zsh uses .zprofile, .zshrc, and others.



    zsh also uses different syntax for dictating the prompt. echo $PROMPT will tell you the prompt's current setting. To display, e.g., your current directory at the prompt, add this to $ZDOTDIR/.zshrc (if ZDOTDIR is not set, zsh will use HOME instead):



    PROMPT='%~> '
    Source



    Then either source ~/.zshrc or restart the terminal.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Aug 16 at 18:06

























    answered Aug 16 at 17:21









    Kevin Kruse

    339111




    339111











    • You were right. I found two lines PS1=[ W]$ PS1='[ W]$ ' inside ~/.bash_profile, so I replaced them both with PS1='[u W$] ' and typed source ~/.bash_profile. Now my terminal says [u W$] instead of Nidas-MBP
      – rgb_jewel
      Aug 16 at 17:36






    • 1




      Psst! M. Kruse! There is a subtle clue, buried in a question comment made by the questioner, that the questioner has mis-labelled the question and is in fact using the Z shell.
      – JdeBP
      Aug 16 at 17:43










    • @JdeBP I see it now, according to Google the default prompt for zsh is %m%#. Being unfamiliar with zsh, I didn't catch that.
      – Kevin Kruse
      Aug 16 at 17:51

















    • You were right. I found two lines PS1=[ W]$ PS1='[ W]$ ' inside ~/.bash_profile, so I replaced them both with PS1='[u W$] ' and typed source ~/.bash_profile. Now my terminal says [u W$] instead of Nidas-MBP
      – rgb_jewel
      Aug 16 at 17:36






    • 1




      Psst! M. Kruse! There is a subtle clue, buried in a question comment made by the questioner, that the questioner has mis-labelled the question and is in fact using the Z shell.
      – JdeBP
      Aug 16 at 17:43










    • @JdeBP I see it now, according to Google the default prompt for zsh is %m%#. Being unfamiliar with zsh, I didn't catch that.
      – Kevin Kruse
      Aug 16 at 17:51
















    You were right. I found two lines PS1=[ W]$ PS1='[ W]$ ' inside ~/.bash_profile, so I replaced them both with PS1='[u W$] ' and typed source ~/.bash_profile. Now my terminal says [u W$] instead of Nidas-MBP
    – rgb_jewel
    Aug 16 at 17:36




    You were right. I found two lines PS1=[ W]$ PS1='[ W]$ ' inside ~/.bash_profile, so I replaced them both with PS1='[u W$] ' and typed source ~/.bash_profile. Now my terminal says [u W$] instead of Nidas-MBP
    – rgb_jewel
    Aug 16 at 17:36




    1




    1




    Psst! M. Kruse! There is a subtle clue, buried in a question comment made by the questioner, that the questioner has mis-labelled the question and is in fact using the Z shell.
    – JdeBP
    Aug 16 at 17:43




    Psst! M. Kruse! There is a subtle clue, buried in a question comment made by the questioner, that the questioner has mis-labelled the question and is in fact using the Z shell.
    – JdeBP
    Aug 16 at 17:43












    @JdeBP I see it now, according to Google the default prompt for zsh is %m%#. Being unfamiliar with zsh, I didn't catch that.
    – Kevin Kruse
    Aug 16 at 17:51





    @JdeBP I see it now, according to Google the default prompt for zsh is %m%#. Being unfamiliar with zsh, I didn't catch that.
    – Kevin Kruse
    Aug 16 at 17:51













    up vote
    0
    down vote













    Obviously there must be something that changes PS1 after you set it.



    To find where you can




    • Use grep in your home directory and in /etc.



      grep PS1 -r /etc $HOME


    • Use set -x after you set PS1 to see where it is changed.


    • Use strace to find out which file contains that value.





    share|improve this answer






















    • After I change the ~/.profile file and add the line PS1='[u W$] ' to the end of the file. Typing echo "PS1" to the terminal returns PS1.
      – rgb_jewel
      Aug 16 at 17:14










    • You should not echo "PS1", but "$PS1". And just changing the file will have no effect, you need to login again. An alternative is source .profile, but then you don't know whether it will work on login.
      – RalfFriedl
      Aug 16 at 17:17










    • Okay I've tried logging out and back in after changing the ~/.profile file but I still have the same problem. The root stills says Nidas-MBP no matter what. Typing grep in the command line showed me usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] Also using echo "$PS1" returned %m%# after logging back in.
      – rgb_jewel
      Aug 16 at 17:27











    • I added the command for grep.
      – RalfFriedl
      Aug 16 at 17:35














    up vote
    0
    down vote













    Obviously there must be something that changes PS1 after you set it.



    To find where you can




    • Use grep in your home directory and in /etc.



      grep PS1 -r /etc $HOME


    • Use set -x after you set PS1 to see where it is changed.


    • Use strace to find out which file contains that value.





    share|improve this answer






















    • After I change the ~/.profile file and add the line PS1='[u W$] ' to the end of the file. Typing echo "PS1" to the terminal returns PS1.
      – rgb_jewel
      Aug 16 at 17:14










    • You should not echo "PS1", but "$PS1". And just changing the file will have no effect, you need to login again. An alternative is source .profile, but then you don't know whether it will work on login.
      – RalfFriedl
      Aug 16 at 17:17










    • Okay I've tried logging out and back in after changing the ~/.profile file but I still have the same problem. The root stills says Nidas-MBP no matter what. Typing grep in the command line showed me usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] Also using echo "$PS1" returned %m%# after logging back in.
      – rgb_jewel
      Aug 16 at 17:27











    • I added the command for grep.
      – RalfFriedl
      Aug 16 at 17:35












    up vote
    0
    down vote










    up vote
    0
    down vote









    Obviously there must be something that changes PS1 after you set it.



    To find where you can




    • Use grep in your home directory and in /etc.



      grep PS1 -r /etc $HOME


    • Use set -x after you set PS1 to see where it is changed.


    • Use strace to find out which file contains that value.





    share|improve this answer














    Obviously there must be something that changes PS1 after you set it.



    To find where you can




    • Use grep in your home directory and in /etc.



      grep PS1 -r /etc $HOME


    • Use set -x after you set PS1 to see where it is changed.


    • Use strace to find out which file contains that value.






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Aug 16 at 17:35

























    answered Aug 16 at 17:10









    RalfFriedl

    3,7001523




    3,7001523











    • After I change the ~/.profile file and add the line PS1='[u W$] ' to the end of the file. Typing echo "PS1" to the terminal returns PS1.
      – rgb_jewel
      Aug 16 at 17:14










    • You should not echo "PS1", but "$PS1". And just changing the file will have no effect, you need to login again. An alternative is source .profile, but then you don't know whether it will work on login.
      – RalfFriedl
      Aug 16 at 17:17










    • Okay I've tried logging out and back in after changing the ~/.profile file but I still have the same problem. The root stills says Nidas-MBP no matter what. Typing grep in the command line showed me usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] Also using echo "$PS1" returned %m%# after logging back in.
      – rgb_jewel
      Aug 16 at 17:27











    • I added the command for grep.
      – RalfFriedl
      Aug 16 at 17:35
















    • After I change the ~/.profile file and add the line PS1='[u W$] ' to the end of the file. Typing echo "PS1" to the terminal returns PS1.
      – rgb_jewel
      Aug 16 at 17:14










    • You should not echo "PS1", but "$PS1". And just changing the file will have no effect, you need to login again. An alternative is source .profile, but then you don't know whether it will work on login.
      – RalfFriedl
      Aug 16 at 17:17










    • Okay I've tried logging out and back in after changing the ~/.profile file but I still have the same problem. The root stills says Nidas-MBP no matter what. Typing grep in the command line showed me usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] Also using echo "$PS1" returned %m%# after logging back in.
      – rgb_jewel
      Aug 16 at 17:27











    • I added the command for grep.
      – RalfFriedl
      Aug 16 at 17:35















    After I change the ~/.profile file and add the line PS1='[u W$] ' to the end of the file. Typing echo "PS1" to the terminal returns PS1.
    – rgb_jewel
    Aug 16 at 17:14




    After I change the ~/.profile file and add the line PS1='[u W$] ' to the end of the file. Typing echo "PS1" to the terminal returns PS1.
    – rgb_jewel
    Aug 16 at 17:14












    You should not echo "PS1", but "$PS1". And just changing the file will have no effect, you need to login again. An alternative is source .profile, but then you don't know whether it will work on login.
    – RalfFriedl
    Aug 16 at 17:17




    You should not echo "PS1", but "$PS1". And just changing the file will have no effect, you need to login again. An alternative is source .profile, but then you don't know whether it will work on login.
    – RalfFriedl
    Aug 16 at 17:17












    Okay I've tried logging out and back in after changing the ~/.profile file but I still have the same problem. The root stills says Nidas-MBP no matter what. Typing grep in the command line showed me usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] Also using echo "$PS1" returned %m%# after logging back in.
    – rgb_jewel
    Aug 16 at 17:27





    Okay I've tried logging out and back in after changing the ~/.profile file but I still have the same problem. The root stills says Nidas-MBP no matter what. Typing grep in the command line showed me usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] Also using echo "$PS1" returned %m%# after logging back in.
    – rgb_jewel
    Aug 16 at 17:27













    I added the command for grep.
    – RalfFriedl
    Aug 16 at 17:35




    I added the command for grep.
    – RalfFriedl
    Aug 16 at 17:35










    up vote
    0
    down vote



    accepted










    I had no idea there was a difference in commands between bash and zsh. Apparently, I was supposed to type PS1='%m %1d$ ' instead. So I did that inside the ~/.zshrc file and it works now.



    https://superuser.com/questions/1108413/zsh-prompt-with-current-working-directory






    share|improve this answer
























      up vote
      0
      down vote



      accepted










      I had no idea there was a difference in commands between bash and zsh. Apparently, I was supposed to type PS1='%m %1d$ ' instead. So I did that inside the ~/.zshrc file and it works now.



      https://superuser.com/questions/1108413/zsh-prompt-with-current-working-directory






      share|improve this answer






















        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        I had no idea there was a difference in commands between bash and zsh. Apparently, I was supposed to type PS1='%m %1d$ ' instead. So I did that inside the ~/.zshrc file and it works now.



        https://superuser.com/questions/1108413/zsh-prompt-with-current-working-directory






        share|improve this answer












        I had no idea there was a difference in commands between bash and zsh. Apparently, I was supposed to type PS1='%m %1d$ ' instead. So I did that inside the ~/.zshrc file and it works now.



        https://superuser.com/questions/1108413/zsh-prompt-with-current-working-directory







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 16 at 18:03









        rgb_jewel

        11




        11



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f463018%2fmy-macosx-terminal-doesnt-show-the-current-directory%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)