How to reset the unix prompt?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to reset the unix prompt?
# 1  
Old 12-26-2005
Question How to reset the unix prompt?

Hi All,

How to change the UNIX prompt to the default one, after i changed it using PS1?

Thanx and Regards,
Saneesh Joseph.
# 2  
Old 12-26-2005
Which version of UNIX are you running? GNU/Linux, BSD, IRIX, MacOSX, that's kind of important.

What is the prompt issue? Do you mean like
ben@debian#
ben@debian$

If it ends in #, you're running as root. Switch to a normal user account, or just exit sudo.

What is PS1?
# 3  
Old 12-26-2005
Power

I'm running Redhat Linux, also SCO Unix

I had the default prompt ( the one shown when i logged in ) as
root@user# (for root login )
user@user$ (for user login )

I set the prompt to X using the command

PS1=X.

Now i want to restore it back to the default prompt.

What can i do for that?

I dont want to exit the session..
# 4  
Old 12-26-2005
PS1=user@user$
PS1=user@user#
# 5  
Old 12-27-2005
Data

Hi cymon,

Thanx for the reply. But for using this command, we shud know the previous prompt in advance.

Suppose i dont know what the previous prompt is.
I need a generic solution for this.

Thanx,
Saneesh Joseph
# 6  
Old 12-27-2005
Is this what you mean?

Store current PS1 and then change it:
Code:
PSTMP=${PS1}
PS1='${USER}@${HOSTNAME}]'

Replace modified PS1 with original:
Code:
PS1=${PSTMP}

# 7  
Old 12-28-2005
Thanx dangral..

But this is again a temporary solution..

I need it just like what we have in windows.

ie... prompt $P$G restores the default prompt.

What is the similiar solution here?


Thanx,
Saneesh Joseph.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Rebooting Windows machine leads to continue sync reset on UNIX

Hello, We have Windows 10 machine connected to Sparc T5440 server via serial cable. We access the server from the Windows 10 machine using putty via serial connection. This allows us to access ILOM and Unix. We have recently noticed that whenever we reboot the windows machine (Windows 10),... (11 Replies)
Discussion started by: jasonu
11 Replies

2. UNIX for Dummies Questions & Answers

How to Change the % prompt to - prompt in UNIX?

how to Change the % prompt to - prompt in unix :wall: ---------- Post updated at 07:40 AM ---------- Previous update was at 07:38 AM ---------- How To display the last modification time of any file in unix ---------- Post updated at 07:40 AM ---------- Previous update was at 07:40 AM... (2 Replies)
Discussion started by: manjiri sawant
2 Replies

3. UNIX Desktop Questions & Answers

Can Unix access Windows' File through Command Prompt in Unix

Hi all, I wish to know whether Unix can access window's file in Unix's terminal? Apart from that, how to copy files or share files between Window and Unix? I get to know of secure copy, however, my company's Unix does not support the feature of secure copy? Any other method for me to share/... (5 Replies)
Discussion started by: jessy83
5 Replies

4. UNIX for Dummies Questions & Answers

unix prompt not on a newline

I just experimented with the macbook pro at work and saw that the prompt is on the same line as the result of my commands. How can I fix this -- I forget which variable or whatever handles this. (1 Reply)
Discussion started by: Straitsfan
1 Replies

5. UNIX for Dummies Questions & Answers

shell (tcsh) prompt gets reset on every cd

Hi, I type in my shell: set prompt="(%M) %c%b%# " to get something like: a/b/c> this works, but only partially. every time I move to to a different directory (i.e. 'cd <some dir>'), the prompt is reset. Meaning, when I 'echo $prompt' after setting the prompt I get the correct prompt,... (8 Replies)
Discussion started by: yuvalbn
8 Replies

6. UNIX for Dummies Questions & Answers

Reset prompt back to "-bash-3.00$"

Can anyone tell me how to reset the command prompt back to the original 'bas'h prompt as these have all been changed via the /etc/profile to add username and hostname but some are too long. I just want to run it in a local .profile to put it back. Thanks (2 Replies)
Discussion started by: skewbie
2 Replies

7. Cybersecurity

How to reset root password of old Unix System V

Hi all, This is first time I met unix in my life. I purchased old Scanning Elecron Microscope which came with 486/33MHz PC running Unix System V, ver. 3.6. The one simple user name/passw is known so I can boot and login. But can not shutdown! It asks root or su passw. I'm very sensitive not to... (6 Replies)
Discussion started by: 82026
6 Replies

8. HP-UX

@ symbol at UNIX prompt

Hi, I am not able to type the symbol '@' on my UNIX prompt. Do I need to setup any enviornment for this. Thanks in advance. Thanks San (2 Replies)
Discussion started by: san
2 Replies

9. UNIX for Dummies Questions & Answers

Changing Unix Prompt

Me again, What is the difficulty to display the full directory Path before my prompt command ? (like DOS) I'm using Solaris 8 + Bash Thanks again Fabien (4 Replies)
Discussion started by: unclefab
4 Replies

10. UNIX for Dummies Questions & Answers

Changing the UNIX command prompt

I am having a hard time figuring out how to change the command prompt in my UNIX shell. I am using the bash shell, and I would like to set the prompt to show me the full path of the current working directory along with my username, I suppose... The main thing I want is the full path of the... (2 Replies)
Discussion started by: WERUreo
2 Replies
Login or Register to Ask a Question