Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

A command to show the directory structure

Posted on 1998-07-01
9
Medium Priority
?
325 Views
Last Modified: 2013-12-23
I want to know if there a command in UNIX like  the "tree" command  in DOS where you can see all the structure of your directory and subdirectories....

that' its

Thx in advance
0
Comment
Question by:tusken
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1582902
find . -print | perl -pe 's#[^/]*/#   #g'
0
 
LVL 10

Expert Comment

by:rbr
ID: 1582903
Another way if you don't have perl use
du.
If you want an output like DOS there is no such program. You have to write your own.
0
 
LVL 1

Expert Comment

by:agolan
ID: 1582904
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Expert Comment

by:slowe
ID: 1582905
you may use "ls -l|more" to obtain a directory listing.
0
 

Author Comment

by:tusken
ID: 1582906
The answer that suited the best my question is the one from OZO so i'll reopen my question and if ozo wants to answer it i'll give those points to him

For the others...... thx anyway!!!
0
 
LVL 84

Expert Comment

by:ozo
ID: 1582907
You seem to imply that there's room for the answer to be better suited.
Was there something you would have preferred to change?
0
 

Author Comment

by:tusken
ID: 1582908
No sorry (english is not my base language!!) i meant that your answer was the one i was looking for EXACTLY...so no it was alright... but if i would like just to have the directory and not all the file in it what would the command be like???

thx in advance ....and still learning unix AND english :-)


0
 
LVL 84

Accepted Solution

by:
ozo earned 200 total points
ID: 1582909
find . -type d -print | perl -pe 's#[^/]*/#   #g'
  or
du -r | perl -pe 's#[^/]*/#    #g'
  (which shows the tree backwards)
0
 

Author Comment

by:tusken
ID: 1582910
Thx a lot!!!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question