From owner-freebsd-questions@FreeBSD.ORG Fri Aug 12 15:33:17 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BA62E16A41F for ; Fri, 12 Aug 2005 15:33:17 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.95]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0449543D46 for ; Fri, 12 Aug 2005 15:33:14 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from beatrix.daedalusnetworks.priv (host4.bedc.ondsl.gr [62.103.39.228]) by kane.otenet.gr (8.13.4/8.13.4/Debian-1) with SMTP id j7CFXC9J007125; Fri, 12 Aug 2005 18:33:13 +0300 Received: from beatrix.daedalusnetworks.priv (localhost [127.0.0.1]) by beatrix.daedalusnetworks.priv (8.13.3+Sun/8.13.3) with ESMTP id j7CFXClk029569; Fri, 12 Aug 2005 18:33:12 +0300 (EEST) Received: (from keramida@localhost) by beatrix.daedalusnetworks.priv (8.13.3+Sun/8.13.3/Submit) id j7CFX88R029568; Fri, 12 Aug 2005 18:33:08 +0300 (EEST) Date: Fri, 12 Aug 2005 18:33:08 +0300 From: Giorgos Keramidas To: Carstea Catalin Message-ID: <20050812153308.GA29558@beatrix.daedalusnetworks.priv> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: freebsd-questions@freebsd.org Subject: Re: setting up the prompt X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2005 15:33:17 -0000 On 2005-08-12 08:22, Carstea Catalin wrote: > how can i change the prompt to view always the current directory? > Ex: > 1. (/usr/local)#cd local1 > 2.(/usr/local/local1)#pwd > 2.(usr/local/local1)#/usr/local/local1 That depends on your shell. For tcsh that would be: % set prompt = '%m:%~%# ' beatrix:~% cd /usr/local beatrix:/usr/local% cd bin beatrix:/usr/local/bin% A slightly different prompt ``escape sequence'' that shows the absolute path even if you are in your HOME directory is ``%/'', which would show the following: % set prompt = '%m:%/%# ' beatrix:/home/keramida% cd /usr/local beatrix:/usr/local% cd bin beatrix:/usr/local/bin% For bash, you have to use a slightly different set of commands: $ export PS1='\h:\w\$ ' beatrix:~$ cd /usr/local beatrix:/usr/local$ cd bin beatrix:/usr/local/bin$ or $ export PS1='\h:${PWD}\$ ' beatrix:/home/keramida$ cd /usr/local beatrix:/usr/local$ cd bin beatrix:/usr/local/bin$ FYI, all the ``prompt escape sequences'', the special strings you can add to $prompt in TCSH and $PS1 in bash to display various bits of information, are described in the manpages of the shells: % man tcsh $ man bash