Command Line


#1

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:


#2

Link to exercise, please?


#3

this is as far as I got: https://www.codecademy.com/courses/learn-the-command-line/lessons/environment/exercises/bash-profile?action=lesson_resume


#4

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

#5

testing? Do you mean just enter “pd” and “pwd”


#6

how do I type in alias directive?


#7

Ok, sorry that I am being dense this morning, but what is alias directive and how do you type it in?


#8

When you have opened the bash-profile file, type in,

alias pd="pwd"

as shown in the instructions.


#9

ok, can you tell me how to open the bash profile. Is it just “nano”


#10

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.


#11

Thank you for the clarification, mtf.


#12

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.


#13

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.


#14

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.