I’m in nano and I am stuck on the 2nd step of one exercise, following all the directions, the next step will not open up. Here is where I am stuck:
Link to exercise, please?
this is as far as I got: https://www.codecademy.com/courses/learn-the-command-line/lessons/environment/exercises/bash-profile?action=lesson_resume
You have nano
open so now just type in the alias directive and save the file. Close it, clear the terminal, and test the alias…
pd
That should give you the Present Working Directory just as would,
pwd
testing? Do you mean just enter “pd” and “pwd”
how do I type in alias directive?
Ok, sorry that I am being dense this morning, but what is alias directive and how do you type it in?
When you have opened the bash-profile file, type in,
alias pd="pwd"
as shown in the instructions.
ok, can you tell me how to open the bash profile. Is it just “nano”
Should be something like,
nano ~/.bash_profile
When it opens, type in the alias directive above,
then press Ctrl+0,
then Enter,
then Ctrl+X.
Thank you for the clarification, mtf.
ok, I do that, and I have to save the file (twice), and I still can’t proceed to the next step. I’m just getting a blank screen. Thanks.
At the start of a new session, enter the first instruction to open the bash_profile in nano…
nano ~/.bash_profile
The screen that comes up should look like this…
Notice in the header bar that it indicates we have to file open in the editor.
In the editor, type the second instruction…
alias pd="pwd"
Write the file back to the home directory with Ctrl + O
. The editor window should look like this…
Notice in the footer bar File Name to Write: ...
is the one we have open. Press Enter
to complete writing. The footer bar will now say [ Wrote 1 line ]
. Now Exit with Ctrl + X
to close the editor.
Type clear
and Enter it. Now type pd
and Enter and it should show the present working directory just as would pwd
.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.