- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Absolute path
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
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
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
05-23-2012 05:58 AM
05-23-2012 05:58 AM
How can i write absolute path of the entire directory into a file in a folder?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2012 06:32 AM
05-23-2012 06:32 AM
Re: Absolute path
# cd /abc/def/ghi
# echo ${PWD} >> afile
# cat file
/abc/def/ghi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2012 08:08 AM
05-23-2012 08:08 AM
Re: Absolute path
My question is, how can i list all directories presnt in a directory to a file.Suppose five directories are inside on directory and i wnated to list entire directories absolute path in a file..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2012 09:04 AM
05-23-2012 09:04 AM
SolutionDo you just want the directories in your current directory or do you want to traverse the entire directory structure?
For example:
Do you want only these directories:
# ls -l |grep ^drw drwxr-xr-x 20 root sys 8192 May 23 07:10 . drwxr-xr-x 26 root root 8192 May 15 11:15 .. drwxr-xr-x 11 root sys 8192 Apr 19 2011 .dt drwx------ 2 root sys 96 Jan 25 2010 .elm drwx------ 2 root sys 8192 Feb 17 2011 .gnupg drwx------ 2 root sys 96 Aug 16 2010 .hh drwx------ 3 root sys 96 Jun 30 2011 .java drwx------ 3 root sys 96 Sep 13 2011 .mozilla drwx------ 2 root sys 8192 Aug 25 2010 .ssh drwxr-xr-x 6 root sys 8192 Jun 1 2011 .sw drwx------ 4 root root 96 Oct 9 2010 .swa drwxr-xr-x 2 root sys 8192 Dec 21 16:09 Functions drwx------ 2 root sys 96 Jun 16 2011 MWAtools drwxr-xr-x 2 root sys 96 Dec 10 2010 Mail drwxr-xr-x 2 root sys 8192 May 23 09:38 bin drwxr-xr-x 2 root sys 8192 Apr 23 13:08 cfg-scripts drwx------ 4 root sys 8192 Jan 8 13:54 dev drwxr-xr-x 2 root sys 96 Nov 11 2009 old drwx------ 3 root sys 96 Jun 30 2011 omniback drwxr-xr-x 2 root sys 8192 Feb 27 2011 zamboni
Or do you want the entire directory tree. For example, the following is the structure from the omniback directory:
# ll omniback/ total 16 drwx------ 3 root sys 96 Jun 30 2011 . drwxr-xr-x 20 root sys 8192 May 23 07:10 .. drwx------ 3 root sys 96 Jun 30 2011 config # ll omniback/config total 0 drwx------ 3 root sys 96 Jun 30 2011 . drwx------ 3 root sys 96 Jun 30 2011 .. drwx------ 3 root sys 96 Jun 30 2011 client # ll omniback/config/client total 0 drwx------ 3 root sys 96 Jun 30 2011 . drwx------ 3 root sys 96 Jun 30 2011 .. drwx------ 2 root sys 96 Jan 24 16:28 javagui
If you want the ENTIRE directory structure for your current working directory you can do:
# find ${PWD} -type d > afile
- Tags:
- find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2012 12:46 PM
05-23-2012 12:46 PM
Re: Absolute path
># echo ${PWD} >> afile
If your path contains symlinks, you may want to use "pwd -P" to get the actual physical path.