LinuxQuestions.org
Help answer threads with 0 replies.
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 10-25-2013, 12:34 PM   #1
xyax
LQ Newbie
 
Registered: Oct 2013
Posts: 6

Rep: Reputation: Disabled
Change PS1 definitively


Hi guys, I'm kind of new at this. My problem is:
-I have Linux Mint 14 KDE, and I use Terminator as terminal.
-I need to know 2 things:
1)I already know how to change the bash text in prompt, ex:

user@userPC ~/Documents $ PS1=" "


But my problem is that after I exit my terminal, it stays the same as before... I want to know how to make a definitive change in PS1, so whaen i close and open again terminal it stays like i told him to.

2)As you see, my starting dir is Documents.. I want to change it to other dir when I open the terminal.

Thank you for taking consideration on my request for help.
 
Old 10-25-2013, 12:47 PM   #2
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 8,486
Blog Entries: 11

Rep: Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386
edit the PS1 variable in ~/.bashrc
 
Old 10-25-2013, 12:50 PM   #3
xyax
LQ Newbie
 
Registered: Oct 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
edit the PS1 variable in ~/.bashrc
Sorry man, but I don't know what is ~/.bashrc
How can I get there?
 
Old 10-25-2013, 02:00 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,508

Rep: Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102
.bashrc is a file in your home directory (~). Edit it with whatever text editor you like, and put your PS1 command inside.
 
Old 10-25-2013, 04:38 PM   #5
xyax
LQ Newbie
 
Registered: Oct 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
.bashrc is a file in your home directory (~). Edit it with whatever text editor you like, and put your PS1 command inside.
Thank you
I was hoping to get answer to my second question too. My terminal always starts at documents dir. How can I change the start dir when I open my terminal?
 
Old 10-25-2013, 04:46 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,508

Rep: Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102
You can always throw a "cd wherever" into .bashrc.

That script is sourced every time a terminal opens. Anything that you want to automatically happen when you open a terminal can be put there.

Or many terminal emulators let you specify the cwd on the command line when they're called. You can append this argument to whatever you're using to launch your terminal (menu option, desktop button, keyboard shortcut) to pass it in.

For example, konsole has the "--workdir <dir>" option. So you could just change your launcher so that instead of running "konsole" when you click it, it runs "konsole --workdir /home/user". gnome-terminal has a similar option "--working-directory=DIRNAME". Terminator probably has one too.

Last edited by suicidaleggroll; 10-25-2013 at 04:52 PM.
 
  


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
Change PS1 when :sh'ing in VIM Jarru Linux - General 3 05-21-2010 02:43 PM
change PS1 environment variable from c program sagsriv Linux - Newbie 4 03-10-2008 01:39 PM
Prompt not hard returning after PS1 variable change? SlowCoder Linux - Newbie 5 05-01-2007 09:16 PM
Why doesn't the script change PS1? (RedHat) ForumJoiner Linux - Newbie 3 12-01-2006 03:59 AM
howto change $PS1 when using su (without dash) remcovr Red Hat 2 09-07-2006 12:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:20 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration