Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 494
  • Last Modified:

how to set the prompt to show the curent path

hi
could comebody tell me what is the command that will make the prompt in  the terminal to show my current path?

Many Thanks

Christos
0
olchs
Asked:
olchs
3 Solutions
 
biraCommented:
in the /etc/profile you put this entry:

PS1='SERVERNAME:`pwd`>'
0
 
TintinCommented:
It's shell dependant.

Assuming ksh you do

export PS1='$PWD$ '

Assuming bash you do

export PS1='\w$ '

as well as

export PS1='$PWD$ '

for bourne shell, you need a bit of trickery.
0
 
karunamoorthyCommented:
In unix, each indivudual have a separate username and password.
and also each user can change their own user profile settings through the hidden file called .profile

Hence after login to unix,
first edit the .profile file by using the following command,

vi .profile

and in the .profile file enter/edit  the following entry

export PS1=`$PWD>`

and save the file using :wq command

Now to make the changes to .profile to work/effect,
use relogin unix (i.e exit unix and login again).

thats all you got the required prompt.

you can also visit the following link to get more exmples for different shells
http://kb.iu.edu/data/abee.html

Have a nice day

from
karunamoorthy.






0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
olchsAuthor Commented:
Thank you all but i'd like to change it permanently for the root user . Therefore karunamoorthy is closer to what i want. But where exactly is is the .profile located?
and also, what else tdo i have to type to see the user as well as the path in the prompt?
0
 
olchsAuthor Commented:
by th eway i'm using the bash shell
0
 
TintinCommented:
For the bash root user do

vi ~/.bash_profile

and add

export PS1='\u \w# '
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now