FAQ: Environment - PS1 Environment Variable

This community-built FAQ covers the “PS1 Environment Variable” exercise from the lesson “Environment”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Learn the Command Line

FAQs on the exercise PS1 Environment Variable

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!
You can also find further discussion and get answers to your questions over in #get-help.

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head to #get-help and #community:tips-and-resources. If you are wanting feedback or inspiration for a project, check out #project.

Looking for motivation to keep learning? Join our wider discussions in #community

Learn more about how to use this guide.

Found a bug? Report it online, or post in #community:Codecademy-Bug-Reporting

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Still not sure what I did wrong in this lesson What was supposed to happen was the change of $ to >>. I keep getting The “X” instead of check off in the instructions. I have a screenshot if I’m allow to send it to a staff member I would be more than happy to. I’m not sure if its a bug or I did something wrong.

You can post the screenshot here or paste the code you ran.

@michael.owen.1990

#open ~/.bash_profile or ~/.bash_rc or ~/.zshrc (if you're using catalina)
#in your text editor:
PS1="whatever you want it to be";
export PS1;
#save and exit
#in your terminal:
source ~/.bash_profile #or whatever was the name of the file you modified, it has to be the right one with your system for it to work

Good day. i am not sure what is wrong i have tried the code several times and it is not working. i think it is a bug or something.

nano ~/.bash_profile

when in nano;
export ps1=">> "
ctrl + 0
enter
ctrl + x
when back in command line;
enter

i have tried several times and it isnt working. i have tried ps1, psl because it isnt clear if it is 1 or l and i have tried both several times. even thr code solution isnt working and i am tired

1 Like

@discourse-admin please help. I haven’t been able to move forward for three days. this is frustrating please.

Good day. Please i haven’t been able to move forward for 3 days. i am sure my code is correct but i keep getting the “X” i.e. it keeps saying my code is wrong. please this is getting really frustrating and tiring. i have made bug reports, but no one is responding. and i haven’t been able to move forward for 3 days.`

export ps1=">> "

This is the code I used in nano, afterwhich I used ctrl + O and then enter to save and then Ctrl + X to exit nano. after i press enter it keeps giving me the error message “did you set the ps1 environment profile in nano?” please help me.
@discourse-admin
@toastedpitabread
@stetim94
@appylpye
@mtf

Hi, for the changes to take effect you probable have to source the file (after you save your changes in nano like you did).

So in the command prompt type something like: source ./filename.
I forget whether it’s ./bashrc or ./bashprofile for the codecademy platform.

1 Like

Hi. Thanks for the reply. I have done that already. It didn’t work as well. its quite unfair that the moderators and no one from codecademy is replying the bug report.

Finally figured it out after 5 days lol. Apparently the ‘P’ and the ‘S’ had to be upper case. lol. Thank you so much for replying me @toastedpitabread.

1 Like

Ugh SO FRUSTRATED! I’ve been doing this for two hours and I’m stuck, please please please help before I throw my computer out the window.

So I’m on step 2, I typed export PS1=">> "
Then I typed ctrl + O.
Now it’s asking me “File Name To Write”

Is that supposed to be there??? I’ve tried everything, there’s no reference to this in the instructions and no matter how many times I close, refresh, clear, restart the stupid page it keeps asking me this and I’m stuck and it’s such a waste of time and BAAAAAAAAH I’M SO FRUSTRATED PLEASE HELP!

Hi,

Ok so some things. If you got that prompt, I assume you’re using the nano text editor.

$ nano example.txt
#opens a file in nano text editor name example.txt

On the top, your file name will show:

Screen Shot 2021-02-17 at 8.04.03 PM

If you press control-o after making changes it will ask you to confirm to what file to save the changes to:

Pressing enter will confirm this:

Screen Shot 2021-02-17 at 8.04.13 PM

Now, in your example, you’re probably dealing with some profile rc file like .bash_profile. (it’s probably indicated in the instructions).

Once you save the file with the correct name, then you type
source ./.bash_profile (or whatever the file name is) to make your changes update in the shell.