LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 11-21-2003, 12:45 AM   #1
luegner
Member
 
Registered: Jul 2003
Location: Henderson, NV
Distribution: Slackware
Posts: 47

Rep: Reputation: 15
long directory and pwd


I noticed that in the shell konsole the current working directory and all parent directories are printed at all times. Is there any way to make it so the command prompt prints only the current working directory and not all its parents in Slack?
 
Old 11-21-2003, 12:59 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Change your PS1 where it has \W to a lowercase \w and it should fix the problem.
 
Old 11-21-2003, 01:24 AM   #3
fancypiper
Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
Prompt magic
 
Old 11-21-2003, 01:29 AM   #4
luegner
Member
 
Registered: Jul 2003
Location: Henderson, NV
Distribution: Slackware
Posts: 47

Original Poster
Rep: Reputation: 15
That would be in the /etc/profile file right? The related section looks like this:

# Set a default shell prompt:
#PS1='`hostname`:`pwd`# '
if [ "$SHELL" = "/bin/pdksh" ]; then
PS1='! $ '
elif [ "$SHELL" = "/bin/ksh" ]; then
PS1='! ${PWD/#$HOME/~}$ '
elif [ "$SHELL" = "/bin/zsh" ]; then
PS1='%n@%m:%~%# '
elif [ "$SHELL" = "/bin/ash" ]; then
PS1='$ '
else
PS1='\u@\h:\w\$ '
fi
PS2='> '
export PATH DISPLAY LESS TERM PS1 PS2


It looks like there already is a \w (lowercase) in there. Maybe there is a script parameter that needs to be executed differently?
 
Old 11-21-2003, 01:57 AM   #5
luegner
Member
 
Registered: Jul 2003
Location: Henderson, NV
Distribution: Slackware
Posts: 47

Original Poster
Rep: Reputation: 15
I figured it out. Actually you had it reversed. It should be \W not \w to print only the current working directory without its parents.
 
  


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 to get back quickly to directory with long path name learnfast Linux - Newbie 1 05-20-2005 06:26 AM
reset pwd to root's current pwd? ataraktos2 Linux - General 10 04-26-2005 05:13 AM
pwd and the directory above sneezesnoeze Linux - Newbie 3 03-26-2004 08:18 AM
how to cd to the previously used directory that is no where close to the pwd rootyard Linux - General 3 03-06-2004 11:49 PM
Browsing /mnt directory takes LONG time Rodzilla Mandriva 11 11-19-2003 11:38 AM


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

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration