LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to see the complete path when using text mode? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-see-the-complete-path-when-using-text-mode-162807/)

Xavius 03-26-2004 07:36 PM

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!!!!!!!!!!!!!!!!

DrOzz 03-26-2004 07:43 PM

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

check out that ..
your going to want to add :
Code:

\w
to your PS1 variable

Xavius 03-26-2004 08:00 PM

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?

Xavius 03-26-2004 08:17 PM

I did it :cool:


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

DrOzz 03-27-2004 11:21 AM

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 ~ ...

fancypiper 03-27-2004 12:06 PM

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 #


All times are GMT -5. The time now is 06:12 PM.