We help IT Professionals succeed at work.

How do I get the current directory into my prompt?

alim_maze
alim_maze asked
on
Medium Priority
294 Views
Last Modified: 2010-07-27
Hi there ..

How do I get the current directory into my prompt?
I am using
Sun Microsystems Inc.   SunOS 5.9       Generic May 2002
Solaris 9

and my favorite SHELL is
bash-2.05$

I need to have my current directory into my prompt.

Regards,
Alim
Comment
Watch Question

Top Expert 2005

Commented:
try this in Your $HOME/.bashrc
export PS1="${USER}@${HOST}:${PWD} > "
see what happend
Top Expert 2005
Commented:
I'm sorry, try: export PS1="$(ppwd \l)\u@\h:\w>"

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
it works perfectly ..
thanks a lot ravenpl
Regards,
Alim
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.