- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Setting prompt to show current directory
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2005 08:50 PM
тАО10-12-2005 08:50 PM
Setting prompt to show current directory
How can I show the current directory beside the prompt?
Should I modify the setting file?How?
Thanks anyway!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2005 08:53 PM
тАО10-12-2005 08:53 PM
Re: Setting prompt to show current directory
-- /etc/profile --
export PS1='$PWD # '
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2005 08:54 PM
тАО10-12-2005 08:54 PM
Re: Setting prompt to show current directory
you can add to .profile
export PS1=`hostname`":"'$PWD'"# "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2005 08:57 PM
тАО10-12-2005 08:57 PM
Re: Setting prompt to show current directory
command-pwd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2005 09:00 PM
тАО10-12-2005 09:00 PM
Re: Setting prompt to show current directory
# export PS1='$PWD # '
else user specific then,
put it in $HOME/.profile file.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2005 09:05 PM
тАО10-12-2005 09:05 PM
Re: Setting prompt to show current directory
we use:
export PS1='K250: ${PWD##/}>'
where my server name is K250
of course, you will have to add the above line in your .profile
hope this helps too!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2005 09:27 PM
тАО10-12-2005 09:27 PM
Re: Setting prompt to show current directory
Hope you are great there :)
export PS1='K250: ${PWD##/}>'
You don't want / in pwd ?
Instead you can use as,
export PS1='`hostname`: ${PWD}>' itself. It will help you when changing hostname.
thx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 05:35 PM
тАО10-13-2005 05:35 PM
Re: Setting prompt to show current directory
If you are using ksh/bash, you can place the following in the .profile file.
And source the file ". ~/.profile"
The " $' " in the next line is deliberate to get a clean line to type your command, especially if you are deep down your directory!!
export PS1='[$LOGNAME@'`hostname`':$PWD]
$'
Enjoy!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 05:43 PM
тАО10-13-2005 05:43 PM
Re: Setting prompt to show current directory
Add the following entry in /etc/profile
or $HOME/.profile
export PS1="`whoami`@`uname -n` in \$PWD>#"
regards,
Syam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 09:04 PM
тАО10-13-2005 09:04 PM
Re: Setting prompt to show current directory
function settitle
{
case $TERM in
xterm|dtterm)
echo "\033]0;$1\007\c"
;;
hp*)
echo "\033&f0k${#1}D$1\c"
;;
*)
;;
esac
}
PS1=$(settitle '[$LOGNAME]'`hostname`:'${PWD}')^M'[$LOGNAME]'`hostname`':${PWD}> '
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2005 12:32 AM
тАО10-14-2005 12:32 AM
Re: Setting prompt to show current directory
========= In my .profile =========
export PS1='
$LOGNAME@$HOST: [$PWD] \
# '
=============================
Gives me present working directory in a "header" line, then drops a line to give me full use of the entire length of the command line.
Hope that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2005 12:34 AM
тАО10-14-2005 12:34 AM
Re: Setting prompt to show current directory
==========================
export HOST=`/usr/bin/hostname`
==========================
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2005 02:29 AM
тАО10-14-2005 02:29 AM
Re: Setting prompt to show current directory
HOST=`uname -n`
PS1="
\$LOGNAME@\$HOST [ \$PWD ]
# ";export PS1
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2005 03:41 AM
тАО10-14-2005 03:41 AM
Re: Setting prompt to show current directory
Here is what I have in my .profile-
export ttybold=`tput bold` ; export ttynorm=`tput rmso`
export PS1='${ttybold}pegasus ${PWD##*/} #${ttynorm} '
HTH
-- Rod Hills