LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-16-2006, 09:22 AM   #1
prospekrisal
LQ Newbie
 
Registered: May 2006
Location: Kuching, Malaysia
Posts: 26

Rep: Reputation: 15
Question how do i change the current prompt in shell?


I just want to change the current frame with my name, what is the code?
e.g.
fahrisal@linux:~> ..code...
prospekrisal:~>

and how to go back to the previous prompt?
e.g.
prospekrisal:~> ..code..
fahrisal@linux:~>
 
Old 07-16-2006, 09:46 AM   #2
prospekrisal
LQ Newbie
 
Registered: May 2006
Location: Kuching, Malaysia
Posts: 26

Original Poster
Rep: Reputation: 15
I've just solved the probllem. But now, how to return back?
 
Old 07-16-2006, 09:47 AM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
To change it just run:
PS1="prospekrisal:~>"

You may want to store your old prompt in a temporary variable - ie:
OLDPS1=$PS1
PS1="prospekrisal:~>"

Then revert with:
PS1=$OLDPS1

You might also want to see:
http://www.linuxquestions.org/questi...d.php?t=115354
 
Old 07-16-2006, 10:21 AM   #4
prospekrisal
LQ Newbie
 
Registered: May 2006
Location: Kuching, Malaysia
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by david_ross
To change it just run:
PS1="prospekrisal:~>"
how to revert that code?
 
Old 07-16-2006, 10:35 AM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Just set PS1 to whatever you want it to be. If you logout and in again it should just go back to the default.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I'd like to change the default shell prompt. lynnevan Linux - General 9 09-08-2011 08:00 AM
change the shell prompt ust Linux - Distributions 5 04-28-2005 03:26 PM
Placing current path in the prompt zepplin611 Linux - General 2 05-13-2004 12:07 PM
how can I change the current shell on the fly? Xavius Linux - Newbie 5 04-06-2004 08:00 AM
Prompt w/ current dir and user Jair Slackware 2 03-15-2004 06:16 PM


All times are GMT -5. The time now is 04:24 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration