My MacOSX terminal doesn't show the current directory

Clash 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.
shell-script command-line osx zsh bashrc
 |Â
show 3 more comments
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.
shell-script command-line osx zsh bashrc
I cannot reproduceDarwin Kernel Version 17.4.0. Have you sourced the.bashrcand.profilefiles 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
 |Â
show 3 more comments
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.
shell-script command-line osx zsh bashrc
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
shell-script command-line osx zsh bashrc
edited Aug 16 at 17:50
JdeBP
29.4k460136
29.4k460136
asked Aug 16 at 16:48
rgb_jewel
11
11
I cannot reproduceDarwin Kernel Version 17.4.0. Have you sourced the.bashrcand.profilefiles 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
 |Â
show 3 more comments
I cannot reproduceDarwin Kernel Version 17.4.0. Have you sourced the.bashrcand.profilefiles 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
 |Â
show 3 more comments
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.
You were right. I found two linesPS1=[ W]$ PS1='[ W]$ 'inside ~/.bash_profile, so I replaced them both withPS1='[u W$] 'and typedsource ~/.bash_profile. Now my terminal says[u W$]instead ofNidas-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 withzsh, I didn't catch that.
â Kevin Kruse
Aug 16 at 17:51
add a comment |Â
up vote
0
down vote
Obviously there must be something that changes PS1 after you set it.
To find where you can
Use
grepin your home directory and in/etc.grep PS1 -r /etc $HOMEUse
set -xafter you setPS1to see where it is changed.- Use
straceto find out which file contains that value.
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 issource .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 meusage: 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
add a comment |Â
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
add a comment |Â
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.
You were right. I found two linesPS1=[ W]$ PS1='[ W]$ 'inside ~/.bash_profile, so I replaced them both withPS1='[u W$] 'and typedsource ~/.bash_profile. Now my terminal says[u W$]instead ofNidas-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 withzsh, I didn't catch that.
â Kevin Kruse
Aug 16 at 17:51
add a comment |Â
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.
You were right. I found two linesPS1=[ W]$ PS1='[ W]$ 'inside ~/.bash_profile, so I replaced them both withPS1='[u W$] 'and typedsource ~/.bash_profile. Now my terminal says[u W$]instead ofNidas-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 withzsh, I didn't catch that.
â Kevin Kruse
Aug 16 at 17:51
add a comment |Â
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.
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.
edited Aug 16 at 18:06
answered Aug 16 at 17:21
Kevin Kruse
339111
339111
You were right. I found two linesPS1=[ W]$ PS1='[ W]$ 'inside ~/.bash_profile, so I replaced them both withPS1='[u W$] 'and typedsource ~/.bash_profile. Now my terminal says[u W$]instead ofNidas-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 withzsh, I didn't catch that.
â Kevin Kruse
Aug 16 at 17:51
add a comment |Â
You were right. I found two linesPS1=[ W]$ PS1='[ W]$ 'inside ~/.bash_profile, so I replaced them both withPS1='[u W$] 'and typedsource ~/.bash_profile. Now my terminal says[u W$]instead ofNidas-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 withzsh, 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
add a comment |Â
up vote
0
down vote
Obviously there must be something that changes PS1 after you set it.
To find where you can
Use
grepin your home directory and in/etc.grep PS1 -r /etc $HOMEUse
set -xafter you setPS1to see where it is changed.- Use
straceto find out which file contains that value.
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 issource .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 meusage: 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
add a comment |Â
up vote
0
down vote
Obviously there must be something that changes PS1 after you set it.
To find where you can
Use
grepin your home directory and in/etc.grep PS1 -r /etc $HOMEUse
set -xafter you setPS1to see where it is changed.- Use
straceto find out which file contains that value.
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 issource .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 meusage: 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
add a comment |Â
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
grepin your home directory and in/etc.grep PS1 -r /etc $HOMEUse
set -xafter you setPS1to see where it is changed.- Use
straceto find out which file contains that value.
Obviously there must be something that changes PS1 after you set it.
To find where you can
Use
grepin your home directory and in/etc.grep PS1 -r /etc $HOMEUse
set -xafter you setPS1to see where it is changed.- Use
straceto find out which file contains that value.
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 issource .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 meusage: 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
add a comment |Â
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 issource .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 meusage: 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
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
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
answered Aug 16 at 18:03
rgb_jewel
11
11
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
I cannot reproduce
Darwin Kernel Version 17.4.0. Have you sourced the.bashrcand.profilefiles 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