General discussion

Locked

Changing a Prompt in Unix

By amd_ghouse ·
How do you chage the prompt of Unix from $ to Current Working directory. ie., the prompt should always show my current working directory as in DOS.

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Changing a Prompt in Unix

by sibasis75 In reply to Changing a Prompt in Unix

been a long 2 years since I worked on unix but I think its

export PS1 = $<your var name>

try it

Collapse -

Changing a Prompt in Unix

by amd_ghouse In reply to Changing a Prompt in Unix

The question was auto-closed by TechRepublic

Collapse -

Changing a Prompt in Unix

by jacob.wilkins In reply to Changing a Prompt in Unix

In your /etc/profile, or .bashrc, or .bash_profile (or the cottect config file for your shell)...

Add something like export PS1="\h:\w\$"

This puts your prompt in the format of hostname:workingdir$
If you wish to omit the host name, just dropthe \h:

jrw

Collapse -

Changing a Prompt in Unix

by amd_ghouse In reply to Changing a Prompt in Unix

The question was auto-closed by TechRepublic

Collapse -

Changing a Prompt in Unix

by basilisk In reply to Changing a Prompt in Unix

It depends on what shell you are using - C Shell, tcsh, Kornshell, Bash, etc. I would look in a book documenting your specific shell (like from O'Reilly); nearly all of them show an example of how to change your prompt to display the working directory.

Collapse -

Changing a Prompt in Unix

by amd_ghouse In reply to Changing a Prompt in Unix

The question was auto-closed by TechRepublic

Collapse -

Changing a Prompt in Unix

by amd_ghouse In reply to Changing a Prompt in Unix

This question was auto closed due to inactivity

Back to Web Development Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums