There is nothing wrong and you don't have to do anything.
$
is the character that by default is always at the end of terminal prompt (it can be changed in the configuration, but by default it's always there).
You are probably confused by the fact that once you changed the current directory, the directory path appears in the prompt just before $
. This is again due to how the default prompt is configured. In Ubuntu, the default prompt contains:
username@hostname:directory$
where username
is your username, hostname
is the name that has been assigned to your computer while installing Ubuntu, and directory
is the path to current directory.
Initially when you login, you are in your home directory, which is indicated simply as ~
, so your prompt looks like for example that:
raj@ubu64:~$
But once you change your current directory, for example by typing cd /home
, an actual path to the directory starts to appear in place of ~
, so it looks like:
raj@ubu64:/home$
There's nothing wrong with that. This is just how the default prompt in Ubuntu looks like.
If you return to your home directory, by typing either just cd
, or cd /home/username
where username
is your username, the prompt will again return to the initial form:
raj@ubu64:~$
Hope this clarifies the situation to you.