FAQ: Environment - Aliases II

thank you for such a detailed explanation!!


Thank you soooo much. I’ve been stuck on this for 30 mins!!!


I’ve read and re-read everyones tips/hints/advice and I still can’t seem to get past step 2.

I have entered:
nano ~/.bash_profile

all four lines:
echo “Welcome, name”
alias pd=“pwd”
alias hy=“history”
alias ll=“ls -la”

I’ve tried:
ctrl s
ctrl o

Enter (on file name)

ctrl x

source ~/.bash_profile

Ive tried:
source --help
which came up with this message:
source: source filename [arguments]
Execute commands from a file in the current shell.

Read and execute commands from FILENAME in the current shell.  The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.

Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.

I get the error:
“Did you create both aliases?”

hey there @system3771135949,

Some of this automated tests can be tricky. Make sure the only things in your file are

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

and nothing else. I noticed you mention you have a 4th line echo "welcome, name" in that file. Does deleting that and saving the file just having the 3 alias lines pass the checkmark?

Also, you might need to open and save the file again after the changes so the test runs again


I have made a mistake and yet the AI validated the first step, which was “Open ~/.bash_profile in nano”.
What I did instead was ~/.bash_profile and forgot to add nano before the bash command.

As a consequence, I proceeded to the second step without being aware of the previous mistake I made, which in turn led me to be stuck there. I was wondering why I could not save the commands through Ctrl + O until I decided to go to the forums to look for an answer. Fortunately I could find what I needed to know thanks to you guys.

it is very practical to work with a community, so I want to contribute by reporting this issue in the module so that the next people who may encounter this problem can find what they are looking for, should they read this topic.

Thank you for posting this. I’m doing this exercise in Feb 2022 and the “bug” is still there. So happy to move on.

Thanks man, it really helpful~

This actually worked for me idk if it was the spacing between the alias itself or the = but doing it like this guy did it worked thanks .

I tried all solutions i find in this forum, none works for me.
Can someone help me?

1 Like

I’m so tired of this code not working. Is there any other fix for this yet? I have tried everything on this page. I have also copied and pasted what the admins have put on here. I’ve already wasted 3 hours. Does anyone have any other suggestions?

Try this:
$ nano ~/.bash_profile
$ nano ~/.bash_profile
$ nano ~/.bash_profile
$ source ~/.bash_profile
alias hy=‘history’
$ hy
1 nano ~/.bash_profile
2 nano ~/.bash_profile
3 nano ~/.bash_profile
4 source ~/.bash_profile
5 hy
$ ll
total 4
drwxr-xr-x 3 ccuser ccuser 39 Jun 1 17:27 .
drwxrwxr-x 1 ccuser ccuser 19 Jun 1 17:27 …
drwxr-xr-x 2 ccuser ccuser 72 Jun 1 15:54 artists
-rw-r–r-- 1 ccuser ccuser 231 Jun 1 17:40 .test.bats

This worked for me.
When you open Nano make sure you add: nano ~/.bash_profile