top of page

Linux/Unix prompt showing a $ instead of the login name and path. How to fix it.

  • Writer: Jha Chandan
    Jha Chandan
  • Sep 5, 2021
  • 1 min read

Sometime you face and issue like your unix/linux terminal prompt is showing dollar sign "$" instead of the user login name and path. So in this blogpost we will see and learn ho to fix it.

ree

Why prompt is showing $?


If you added the new account using useradd then it likely set the new user's login shell to be /bin/sh, which in Ubuntu is a symbolic link to the dash shell. Dash is a simpler shell which doesn't read the ~/.bashrc file and doesn't set the user@host command line prompt.


How to fix it?


Follow below steps to fix shell path for newly created user's login.


1) You can check by looking in the /etc/passwd file, or using

getent passwd "username"

2) and you can change the default shell to the more usual bash using

chsh -s /bin/bash

3) if you are logged in as the user whose shell you want to change, or to change another account's login shell.

sudo chsh -s /bin/bash "username"

To prevent this happening again, you can either specify the login shell on the useradd command line using the -s or --shell options, or use the higher-level utility adduser instead.


That's all in this post. If you liked this blog and interested in knowing more about UNIX / LINUX / AIX. Please Like, Follow, Share & Subscribe to www.ImJhaChandan.com

Comments


jc_logo.png

Hi, thanks for stopping by!

Welcome to my “Muse & Learn” blog!
Muse a little, learn a lot.✌️

 

Here you’ll find practical SQL queries, troubleshooting tips with fixes, and step-by-step guidance for common database activities. And of course, don’t forget to pause and muse with us along the way. 🙂
 

I share insights on:​​

  • Db2

  • MySQL

  • SQL Server

  • Linux/UNIX/AIX

  • HTML …and more to come!
     

Whether you’re just starting out or looking to sharpen your DBA skills, there’s something here for you.

Let the posts
come to you.

Thanks for submitting!

  • Instagram
  • Facebook
  • X
2020-2025 © TechWithJC

Subscribe to Our Newsletter

Thanks for submitting!

  • Facebook
  • Instagram
  • X

2020-2025 © TechWithJC

bottom of page