FAQ: Environment - Aliases I

This community-built FAQ covers the “Aliases I” 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 Aliases I

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!

Cant overcome

this task, please help.

2 Likes

Estoy en la misma situación! Encontraste solución?

1 Like

Same problem here, writing alias pd=“pwd” in ~/.bash-profile is ignored by the exercise.

1 Like

Problem still there, I am stuck at this exercise even though I typed in the correct commands. Would be nice if someone can solve it quick, as I need it done. Today, if possible.

Update:
Okay, found the solution myself just now: simply open a new file with the add button ("+") and type the same commands again.

1 Like

Greetings to everyone. Im putting the commands for step number two but the system is not processing it. Im typing alias pd=“pwd” and following the steps from the hint but the system is not responding to the commands. Im having hiccups with this and it is not allowing me to move on and finish the lesson. The URL is : FAQ: Environment - Aliases I. Thank you bye.

1 Like

Same problem here!

Hi guys, please take a look at my screen and see if you can help me figure out what went wrong with my code!
I typed nano ~/.bash-profile, then I hit ctr + O to save the code, which is “alias pd = “pwd””, then I typed in ctr + X to exit out, but it still says there is something wrong!

did you do

control + o
enter
control +x ?

hi
by step :
first wirte in the terminal : nano ~/.bash_profile

then write in nano : alias pd=“pwd”
control O
enter
control X

Back in the terminal : enter

Are there any common aliases or aliases that we should avoid?

Hi guys, I’m having trouble getting passed this mod - can someone help? Even though I put in the directions as stated its still coming up wrong

An alias is just a convenience for commands you use frequently; it only exists for your interactive shells. So this consists mostly of making your own life as easy as possible. At the end of the day it’s your choice, but just think carefully about the benefits/drawbacks of long term usage.

I think that’s worth a quick web search for some useful advice from folks who’ve being using the command line for an extended period; the following has some decent suggestions (though it focuses on single line aliases)- https://unix.stackexchange.com/a/634057
You can probably find more guidance if you look around.

Personally I’d avoid aliasing dangerous commands (e.g. deletion or anything using --force or similar).

It may also be wise to avoid an over-reliance on aliases. Ideally you should know and understand the original command so if you’re forced to do without your standard alias set (e.g. working on a different device without your .bashrc) you’re not left high and dry. For that same reason it’s probably best to avoid masking existing commands in case you wind up using them in the future (undoing muscle memory is hard too).

You need to write the alias inside the .bash_profile file. The instructions suggests opening the file in the nano text editor. To do so you’d write:

nano ~/.bash_profile

Now you’re in the text editor and you can write out the given alias, save the file using the keypresses listed in the hint and that should enable you to pass this checkpoint.

1 Like

Thanks for the advice!

Hi, I’ve tried following the activity instructions exactly, as well as the step-by-step instructions in this thread. I’ve reset the exercise 3 times now and it seems to be a glitch? I’ve spelled everything correctly as well, but I can’t get passed the second part of the exercise. I’m unsure of what to do as I’ve already tried reporting the bug.

It might be a case of the tests only checking the content of the first line of the file (or something similar, unexpected syntax may also cause problems). Try removing the excess lines from the file, e.g. the line ~/.bash_profile and the additional alias commands, you only really want/need a single line.

It should look roughly like the following:
bash
Then follow the keypress instructions to save and exit the file then try continuing with Enter so see if that meets the checkpoint.

1 Like

thank you!! this was the only thing that worked for me!

1 Like

Hi Tim, thanks for responding. Besides resetting the exercise, how do I remove the excess lines?

You should be able to reopn the file with nano and then delete them like a standard text editor.

1 Like