Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 492
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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