LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-04-2011, 06:06 AM   #1
jake_harv88
LQ Newbie
 
Registered: Jan 2010
Posts: 5

Rep: Reputation: 0
Remove PWD from command prompt


My current working directory shows up as part of my command prompt. This can be a huge pain when I descend into a big tree of directories because the command prompt can extend across the entire screen. Is there a way to remove this? I'm running Z Shell on CentOS 5.

My command prompt looks like this when I'm in a directory:

Code:
[jaharvey@localhost]/home/jaharvey/liquid-im-tr/imidazole-take2%
I'd like to remove the "/home/jaharvey/liquid-im-tr/imidazole-take2" part from the command prompt.
 
Old 10-04-2011, 06:33 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
You have to change the PS1 environment variable. Substitute \w with \W to show only the name of the current working directory. Remove it completely if you don't want to see it. To apply this modification every time you start a new shell, put the PS1 assignment in your .zshrc or modify the existing one (if already there).
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuring PWD command stealth13 Linux - Newbie 3 02-10-2011 11:52 PM
Bash Prompt - display correct $(pwd) tschima Linux - General 2 07-05-2007 07:03 PM
FC6 issue with the command 'pwd' rajat Linux - Server 7 07-04-2007 12:00 PM
PWD command dweeb Linux - Newbie 2 03-28-2007 09:04 AM
getting custom PWD in bash prompt techrolla Linux - Software 2 08-09-2004 12:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:17 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
Open Source Consulting | Domain Registration