FAQ: Environment - Aliases II

Want to point out one other thing I’ve noticed:

echo “Hello name”
alias pd=“pwd”
alias hy=“history”
alias ll=“ls -la”

If I copy this solution (which is correct) into the Codecademy workspace, it will still fail, because the CC forums use a different quote character than the CC bash terminal. In the following screenshot, I typed the first line directly into the terminal, and copy/pasted the second from above.

image

This can be demonstrated by running source with the following in the bash profile, which has all incorrect quotes:

image

Doing so yields:

image

After correcting all the quotes characters:

image

Checkpoint 2 passes, source runs without error, and the aliases work correctly:

Hope this helps!

1 Like

What happens if we create an alias for a command that already has an alias.?
For example: alias cd=“ls”
ls is obviously already an alias for list but will it let you set it?

I found it!

To anyone who may be coming here with the same issues as everyone else here with not being able to get the lesson to move forward past the second.

As others have mentioned you need to have the “ll” command take the output of ls (SPACE) -la.

But as in the Aliases I lesson you need to run source .bash_profile again to APPLY the saved aliases. Only then, when you test your outputs will you get what you need and the system will recognize that you have followed all of the steps correctly.