Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Using tree to display only certain directories Post 302752269 by kristinu on Sunday 6th of January 2013 02:18:30 PM
Old 01-06-2013
Using tree to display only certain directories

I want to use tree to display the directory tree. It is easy to use

Code:
tree -d -L 2

However I would like to run it on specific list of directories. Can such a thing be performed?

Example:

Code:
[chrisd@uol] /media/academic-repo/chrisd/literature  
tree -d prose -L 2
prose
├── computer-technology
│** ├── artificial-intelligence
│** ├── databases-and-SQL
│** ├── methodology
│** ├── networks
│** ├── programming-languages
│** └── unix
├── culinary
├── history-geography
│** ├── ancient-egypt
│** ├── ancient-greece-and-rome
│** ├── art-history
│** ├── britain
│** ├── central-and-south-america
│** ├── china
│** ├── europe
│** ├── Facts on File - Encyclopedia of World History (2008)
│** ├── general-history
│** ├── japan
│** ├── military-and-naval-history
│** ├── united-states-and-canada
│** └── world-history
├── philosophy
│** ├── aestetics
│** ├── economics
│** ├── epistemology
│** ├── ethics
│** ├── logic
│** ├── metaphysics
│** ├── psychology
│** └── sociology
├── science
│** ├── biology
│** ├── chemistry
│** ├── engineering
│** ├── geology
│** ├── introductions-science
│** ├── mathematics
│** ├── other
│** ├── paleontology
│** ├── physics
│** └── tnbooks
└── sports-travel
    ├── cinema
    ├── dance
    ├── diving
    ├── theatre-and-stage
    └── travel

48 directories

However I want to display the tree for two directories only, computer-technology and science.

Last edited by kristinu; 01-06-2013 at 03:30 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how can i display the list of directories(only)

when i am giving ls command it displays all the files and directories how can we the list of directories in the current directory? (3 Replies)
Discussion started by: indianguru
3 Replies

2. Shell Programming and Scripting

Bash Script to display directories in Path?

Hello there, As a newbie: The directories in PATH can be hard to distinguish when printed out as one line with colon .Please, can i have a sample script to display them,one to a line. Thank you. (1 Reply)
Discussion started by: debut
1 Replies

3. Shell Programming and Scripting

export display of directories of remote machine

hi I wanted to export the display of all directories of home with their respective subdirectories and files if any on my local pc. this home directory is of some remote machine . using ssh remote login and then using struct direct i can just gate name list of directories . but not the display... (2 Replies)
Discussion started by: bhakti
2 Replies

4. UNIX for Dummies Questions & Answers

How to display directories recursively?

Cannot find how to list the directory structure of a volume recursively. Do not want the files reported. Say I have 100 directories and 10,000 files, I do not want 10,000 lines of output. (If this is relevant, I am using the terminal on my OSX Mac). I hope this is easy - there should be an easy... (5 Replies)
Discussion started by: jwriter
5 Replies

5. Shell Programming and Scripting

Display only subdirectories from given directories

Hi Genius, I would like to display all the subdirectories only with timestamp. For exmple: Given Directory : orabkup /orabkup total 11365112 drwxr-xr-x 9 oracle oradba 256 Jan 03 16:01 db1 /orabkup/db1: total 0 drwxr-xr-x 2 oracle oradba 256 Jan 03 16:01... (8 Replies)
Discussion started by: HAA
8 Replies

6. Solaris

What command can display files in a tree?

Is there a command that displays a certain path of files in a tree just like the dos command 'tree'? (17 Replies)
Discussion started by: Bradj47
17 Replies

7. Shell Programming and Scripting

Display top ten directories by size

Hi, I am new to Unix. I want to display top 10 folders by size. I tried with du -ksl * | sort -nr | head -10 command .But I am getting the following error -bash: /usr/bin/du: Argument list too long Can some one help me. Thanks. (5 Replies)
Discussion started by: Satyak
5 Replies

8. Shell Programming and Scripting

How to display only Directories in filesystem?

Hi, I want to display only directories inside a particular file system. TIA (2 Replies)
Discussion started by: sumanthupar
2 Replies

9. Shell Programming and Scripting

How to run a script/command on all the directories in a directory tree?

How to run a script/command on all the directories in a directory tree? The below script is just for the files in a single directory, how to run it on all the directories in a directory tree? #!/bin/sh for audio_files in *.mp3 do outfile="${audio_files%.*}.aiff" sox "$audio_files"... (2 Replies)
Discussion started by: temp-usr
2 Replies

10. UNIX for Beginners Questions & Answers

Display largest files in multiple directories

Trying to locate the 25 largest files with read/execute world permissions to be displayed from a combination of 4 different directories. I'm rather new at UNIX and trying to learn the basics. This is what I have come up with so far: find /dir1 /dir2 /dir3 /dir4 -perm -u+rx | sort -nr | head... (1 Reply)
Discussion started by: malk71
1 Replies
history(n)					       Provides a history for Entry widgets						history(n)

__________________________________________________________________________________________________________________________________________________

NAME
history - Provides a history for Entry widgets SYNOPSIS
package require Tcl 8.4 package require Tk 8.4 package require history ?0.1? ::history::init pathName ?length? ::history::remove pathName ::history::add pathName text ::history::get pathName ::history::clear pathName ::history::configure pathName option ?value? bell _________________________________________________________________ DESCRIPTION
This package provides a convenient history mechanism for Entry widgets. The history may be accessed with the up and down arrow keys. ::history::init pathName ?length? Arranges to remember the history of the named Entry widget. An optional length determines the number of history entries to keep. This may be changed later with ::history::configure. History entries must be added with the ::history::add command before they can be seen. ::history::remove pathName Forgets all history entries for the Entry pathName and removes the history bindings. ::history::add pathName text This command is used to add history entries to an Entry that has previously had ::history::init called on it. This command should be called from your Entry handler with the contents of the entry (or whatever you wish to add to the history). ::history::get pathName This command returns a list containing the history entries for the Entry pathName ::history::clear pathName This command clears the history list for the named Entry. ::history::configure pathName option ?value? This command queries or sets configuration options. Currently the options recognized are length and alert. Setting the length deter- mines the number of history entries to keep for the named Entry. Alert specifies the command to run when the user reaches the end of the history, it defaults to bell entry .e bind .e <Return> [list ProcessEntry %W] ::history::init .e pack .e proc ProcessEntry {w} { set text [$w get] if {$text == ""} { return } ::history::add $w $text puts $text $w delete 0 end } KEYWORDS
entry, history history 0.1 history(n)
All times are GMT -4. The time now is 08:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy