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?