All posts tagged: tree

Get number of files or directory using tree

Leave a comment
System Administration

Tree is an useful linux command to display a tree representation a full directory structure or a part of it. On a Debian based distro like Ubuntu install: The last line of tree print a line like this: 346 directories, 174 files If you’re changing files and directories and you want a real-time update of files and directories number, you can use watch. Tree will print the tree, tail will extract the last line, then […]

Tertiary links / 2: tree workaround

comment 1
Drupal

On Tertiary links on Drupal I described a simple approach to display the “tertiary” menu (childrens of secondary menus) on Drupal 5.x. This is an useful but sometimes limiting approach, since the secondary menu disappears when tertiary menu is displayed. This is an alternative workaround made using a customized menu_tree function: template.php: function custom_menu_tree_secondary($pid = 1) { $menu = menu_get_menu(); $output = ''; if (isset($menu['visible'][$pid]) && $menu['visible'][$pid]['children']) { foreach ($menu['visible'][$pid]['children'] as $mid) { $type = isset($menu['visible'][$mid]['type']) […]