Getting current work directory in Command Prompt


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Getting current work directory in Command Prompt
# 1  
Old 07-20-2007
Getting current work directory in Command Prompt

How to get the current working directory as part of the command prompt? Every time I chage the folder, my command prompt path shoud change. I am using Korn Shell. Any help is greatly appreciated.
# 2  
Old 07-20-2007
Code:
export PS1='${PWD}>'

# 3  
Old 07-20-2007
Where do I need to add this code?
# 4  
Old 07-20-2007
execute the above command on the command prompt. To make the changes permanent, add it to the .profile.
kamitsin
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

How to make this command work wihtout password prompt?

Hi, I am trying to run this command to connect to each server without being prompted for the password. How can I do this in Linux redhat 7.2: for HOST in $VIPS; do su - Myadminid -c "ssh -o ConnectTimeout=10 $HOST 'date; hostname; pkill -9 -f -u Myadminid xx00 ; ps -ef |grep Myadminid'" ... (7 Replies)
Discussion started by: mrn6430
7 Replies

2. Shell Programming and Scripting

Delete empty files from a directory entered in command prompt

My code to "Delete empty files from a directory entered in command promt" #/bin/sh echo "Enter directory" read gh for file in `ls $gh` do # to get the size of file a=$( ls -l file | awk ' {print $7} '); echo $a if then echo "removing file " rm file fi done (6 Replies)
Discussion started by: adirajup
6 Replies

3. UNIX for Dummies Questions & Answers

question in MV command (will move work with 100% used directory)

Dear all, I am facing a issue in MV command, this move is done by our c program. We are moving the file to same directory so basically I think it will be a rename of the inode. So we might not useany extra space then why the move is failing. Does it require space to move the same size of file... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

4. UNIX for Dummies Questions & Answers

find command to look for current directory only

i have this find command on my script as: for i in `find $vdir -name "$vfile" -mtime +$pday` the problem with this code is that the sub-directories are included on the search. how do i restrict the search to confine only on the current directory and ignore the sub-directories. please advise.... (7 Replies)
Discussion started by: wtolentino
7 Replies

5. UNIX for Dummies Questions & Answers

How can I show my "current" directory as the KSH prompt?

Hi All, This is an embarrassingly simple question and couldn't think of "keywords" to search for the answer, but how do I change my UNIX/KSH prompt to show the machine name and my "current" but not "full" directory? For example: if the machine name is "machine" and I'm currently in... (4 Replies)
Discussion started by: chatguy
4 Replies

6. AIX

"/" doesn't work on command prompt for searching commands last typed

When I use "/" to look for a particular command that I typed in the current session it says D02:-/home/user1/temp> /job ksh: /job: not found. D02:-/home/user1/temp> previously it used to fetch all the commands which had job in it.. for example subjob, endjob, joblist etc... may I... (7 Replies)
Discussion started by: meetzap
7 Replies

7. UNIX for Dummies Questions & Answers

Displaying the current working directory in prompt

Hi, I want that the prompt that is being displayed (i.e $ sign) should display always the current directory I am working in instead of that $ sign example: as we use PS1=patric and the prompt changes from $ to patric OR if we write the command PS1=`pwd` it will display the current... (5 Replies)
Discussion started by: premjotsingh
5 Replies

8. Shell Programming and Scripting

Current working directory in prompt

Can someone tell me how do i set my current working directory in my prompt? Note: I dont want to use env variable PWD and using `pwd` gives me only my home directoy. suggest a different way ? I use /bin/sh thanks!! (3 Replies)
Discussion started by: yesmani
3 Replies

9. Shell Programming and Scripting

current directory as part of the csh prompt

I would like my csh prompt to behave like the linux csh prompt setting done by linux command (set prompt="%n@%m %c]$ ") how do I do that? What I'm trying to do is that I would like to see what directory I'm in by looking at the prompt. I've figured out that %n is like $user, and %m is like... (3 Replies)
Discussion started by: jamesloh
3 Replies

10. UNIX for Dummies Questions & Answers

using find command only in current directory

I am trying to use the find command to find files in the current directory that meet a certain date criteria. find . -type -f -mtime +2 However, the above also checks the directories below. I tried -prune, but that seems to ignore this directory completely. I read about using -path w/... (5 Replies)
Discussion started by: jliebling
5 Replies
Login or Register to Ask a Question