Tree directory structure of Unix to get final node path


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Tree directory structure of Unix to get final node path
# 8  
Old 12-18-2008
Code:
find /base/base1 -type d | nawk -F'/' '{print NF, $0}' |sort -nr | head -1 | cut -d ' ' -f2-

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell output with plot a tree structure.

Hi All, i am in need of plotting graph ( tree structure ) depends upon my shell script output. For this requirement, what kind of open source avail in market. For example: (my script output will be like below ) Parent:A process-name:child-processes A:B,C B: D expecting... (1 Reply)
Discussion started by: ponmuthu
1 Replies

2. Shell Programming and Scripting

How we can create the master file through shell to show the tree structure of the directory?

Can we create the master file that show the whole tree structure of the directory till a particular folder? Database that contains four sub repository Sybase,sql,oracle,mysql and sql and oracle contains two subrepostories Siebel and plsql and each repositories contains three folders... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies

3. Shell Programming and Scripting

help need while creating tree structure

Hi Experts, I have table in mysql like below: 'user` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `parent_id` varchar(100) NOT NULL, `member_name` varchar(100) NOT NULL, `city` varchar(100) NOT NULL, `member_id` varchar(100) NOT NULL, `password` varchar(100) NOT... (1 Reply)
Discussion started by: naw_deepak
1 Replies

4. UNIX for Dummies Questions & Answers

Commands to create hierarchical tree structure

I am creating a hierarchical tree structure and I was wondering what commands I needed to do that. I have 4 directories and sixteen sub directories and 4 files. Thank you for your help in getting my started in right direction.:confused: (1 Reply)
Discussion started by: GreginNC
1 Replies

5. UNIX for Dummies Questions & Answers

Find a tree structure in software modules

I have a list of software funtions in tcl code. Some of these functions call other functions. I want to build a tree structure of all called functions. Right now I list all the functions into a file then read this file so that I can cat each function and grep for EXECUTE (command that calls... (0 Replies)
Discussion started by: MissI
0 Replies

6. Shell Programming and Scripting

tree structure of the data

Hello, I have a file of the following information ( first field parent item, second field child item) PM01 PM02 PM01 PM1A PM02 PM03 PM03 PM04 PM03 PM05 PM03 PM06 PM05 PM10 PM1A PM2A PM2A PM3B PM2A PM3C The output should be like this : PM01 PM02 PM03 PM04 ... (2 Replies)
Discussion started by: ThobiasVakayil
2 Replies

7. HP-UX

Not able to copy the tree node text in HP UX, while easily done in window

I m not able to copy the text present on the tree's node to terminal or other text editor in solaris. I m using <Shift><control> C and V comaand for the same but the text is not being copied and pasted on the text pad or the terminal window. While the same is possible in windows OS using ctrl+c... (2 Replies)
Discussion started by: friendanoop
2 Replies

8. Solaris

Not able to copy the tree node text in solaris, while easily done in window

I m not able to copy the text present on the tree's node to terminal or other text editor in solaris. I m using <Shift><control> C and V comaand for the same but the text is not being copied and pasted on the text pad or the terminal window. While the same is possible in windows OS using ctrl+c... (3 Replies)
Discussion started by: friendanoop
3 Replies

9. UNIX for Advanced & Expert Users

MV files from one directory structure(multiple level) to other directory structure

Hi, I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies

10. UNIX for Dummies Questions & Answers

Unix/Linux Directory Structure

Does anyone know of a good Internet source that explains the directory structure of Unix/Linux?? Thanks Gregg (2 Replies)
Discussion started by: gdboling
2 Replies
Login or Register to Ask a Question
Arch::Inventory(3pm)					User Contributed Perl Documentation				      Arch::Inventory(3pm)

NAME
Arch::Inventory - class representing a tree inventory SYNOPSIS
use Arch::Inventory qw(:category :type); my $inv = Arch::Inventory->new; # use cwd print Arch::Inventory->to_string($inv->get_root_entry), " "; print $inv->get_listing; or (most commonly): use Arch::Tree; my $tree = Arch::Tree->new; my $inv = $tree->get_inventory; print $inv->get_listing; DESCRIPTION
Arch::Inventory generates a tree inventory. An inventory is a tree structure of elements, each representing a single directory entry of the source tree. Each inventory entry is described by an hash with the following fields: category The classification of the tree element. category can be one of TREE, SOURCE, PRECIOUS, BACKUP or JUNK. untagged A boolean value indicating whether the element was first classified as SOURCE but lacked an inventory id. type The tree element type. type can be one of FILE, DIRECTORY or SYMLINK. path The complete path to the tree element relative to the inventory base directory. id The elements inventory id. May be "undef". children A hash of the elements direct children, idexed by their last path element. This field exists for elements of type DIRECTORY only. The category and type constants can be conveniently imported using the tags ":category" and ":type". use Arch::Inventory qw(:category :type); METHODS
The following methods are available: new, directory, get_root_entry, get_entry, get_listing, annotate_fs, foreach, dump, to_string. new [$dir] Create an inventory for $dir or the current directory if $dir is not specified. directory Returns the inventories base directory as passed to new. get_root_entry Returns the inventory element for the base directory. The root entry always has the following properties: $root = { category => TREE, # if {arch} exists, SOURCE otherwise untagged => 1, type => DIRECTORY, path => '', id => undef, children => { ... }, } get_entry $path get_entry @path_elements Returns the inventory element for the specified path. The path may either be given as a single string or as a list of path elements. If the element does not exist "undef" is returned. Using an empty or no path is equivalent to calling get_root_entry. get_listing Generates a textual inventory listing equivalent to the output of tla inventory -tspbju -B --kind --ids --untagged Note: The output order is not equivalent to tla. Instead of strict ASCII order of path names, a directory entry is always directly followed by its child entries. Entries with the same parent entry are ASCII ordered. annotate_fs annotate_fs $entry Add filesystem information to $entry or every inventory entry if none is provided. This adds the fields stat and symlink to the annotated entries which contain the output of lstat and readlink respectively. foreach $coderef Execute $coderef for every inventory entry, passing the entry as $_[0]. dump Generates a dump of the inventory structure using Data::Dumper. to_string $inventory_element Generates an inventory line for the inventory element as produced by tla. BUGS
Awaiting for your reports. AUTHORS
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel). Enno Cramer (uebergeek@web.de--2003/arch-perl--devel). SEE ALSO
For more information, see tla, Arch::Util. perl v5.10.1 2005-10-23 Arch::Inventory(3pm)