LinuxQuestions.org
Visit Jeremy's Blog.
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 03-26-2004, 08:36 PM   #1
Xavius
Member
 
Registered: Mar 2004
Posts: 107

Rep: Reputation: 15
how to see the complete path when using text mode?


Running Linux in text mode only (runlevel 3, I mean) the prompt shows only the last directory I am in.....

for example: if I am in /home/myname the prompt shows only "myname" as directory

(so, watching the prompt only, without using pwd, it's impossible understand if I'm in /home/myname or /whatyouwant/myname for example)

How is possible shows the complete path in the prompt?
What I should configure?

Thanks a lot in advance!!!!!!!!!!!!!!!!
 
Old 03-26-2004, 08:43 PM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 59
http://www.linux.org/docs/ldp/howto/...sequences.html

check out that ..
your going to want to add :
Code:
\w
to your PS1 variable
 
Old 03-26-2004, 09:00 PM   #3
Xavius
Member
 
Registered: Mar 2004
Posts: 107

Original Poster
Rep: Reputation: 15
I'm sorry to bother you.......

I just checked etc/bashrc but I don't find PS1 or I don't know how/where I have to add "/W" .......

Can you help me, please?
 
Old 03-26-2004, 09:17 PM   #4
Xavius
Member
 
Registered: Mar 2004
Posts: 107

Original Poster
Rep: Reputation: 15
I did it


P.S. when I start linux I get a "~" only (instead of "/home/myusername") as path.... after, changing directory, the system seems to remeber the complete path... is it normal?

Thanks
 
Old 03-27-2004, 12:21 PM   #5
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 59
well the only time you will see that is when you are logged in as your normal user and you are located in the users home folder ...
the ~ is equivalent to /home/username ... so when you change to a differnet folder within your home folder as your normal user it will say :
~/newfolder ... this is the only time you will see the ~ ...
 
Old 03-27-2004, 01:06 PM   #6
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
Here is an example of a fancy prompt that may do what you wish. If not, see the link

Code:
# Celeron 850 tinwhistle .bashrc file for user fancy
# User specific aliases and functions

# Change bash prompt. See the article:
# http://www-106.ibm.com/developerwork.../l-tip-prompt/
export PS1='\d \@ \[\e[32;1m\]\u\[\e[34;1m\]@\[\e[36;1m\]\H \[\e[34;1m\]\w\[\e[32;1m\] $ \[\e[0m\]'
# For the root account use this
# export PS1='\d \@ \[\e[31;1m\]\u\[\e[34;1m\]@\[\e[36;1m\]\H \[\e[34;1m\]\w\[\e[31;1m\] # \[\e[0m\]'

# Set paths
alias path='echo -e ${PATH//:/\\n}'

# Start the screensaver daemon
alias saver='nohup xscreensaver &'

# Allow local users to use my X session
# xhost +local:

# Dialup, start fetchmail daemon and startx
alias x='/sbin/ifup ppp0;fetchmail -d 300;startx'

# Alter the ls command
alias ls='ls -ac'
alias lls='ls -lac'

# Become system administrator
alias god='su -'

# Connect/disconnect the internet by modem
alias dial='/sbin/ifup ppp0'
alias hangup='/sbin/ifdown ppp0'

# Launch links with my linux links page
alias links='links /home/fancy/bookmarks.html'

# Power down/reboot
alias off='shutdown -h now'
alias boot='shutdown -r now'

# For nano editor because I forget which one I use in which distro
alias pico='nano -w'
alias nano='nano -w'

# Script needs to be on the bottom of the file or RH updates will fsck it up
# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi
The result (less colors)
Sat Mar 27 01:08 PM fancy@uilleann /usr/src $
Sat Mar 27 01:08 PM root@uilleann /usr/src #

Last edited by fancypiper; 03-27-2004 at 01:11 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
How change text color using linux in text mode only runlevel 3? Xavius Linux - General 7 05-07-2009 03:19 AM
Change the display mode in text mode Drunkalot Linux - General 7 08-12-2005 12:35 PM
How to; Suse9.3 prof. text mode to graphical mode anjum Linux - Software 5 07-21-2005 12:36 AM
Booting in text mode versus graphics mode LChalupa Linux - Newbie 3 01-15-2005 08:53 PM
How to find the complete path of an installed package samik Linux - Newbie 1 10-26-2003 03:19 PM

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

All times are GMT -5. The time now is 03:57 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