954,546 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how do i display the path name to the bash shell

how do i display the path name to the bash shell?

Thanks all

towelee
Newbie Poster
2 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

You mean put the current working directory into the prompt "like DOS" ?

Or just type
pwd

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

Or do you mean the full path to the bash binary?

$ which bash
/bin/bash
Gromit
Posting Whiz in Training
212 posts since Sep 2008
Reputation Points: 47
Solved Threads: 31
 

only thing to remember - if there are space chars in the path, either escape them using '\' or put the path in quotes.

using `find` instead of `ls -A`, is another helpful hint, when iterating through dirs and files with spaces

DimaYasny
Posting Virtuoso
Moderator
1,777 posts since Jan 2007
Reputation Points: 183
Solved Threads: 89
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You