AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  Tree Command

    Posted Tue January 25, 2022 04:45 PM
    Will the tree command be added to the Linux Toolbox for AIX?

    ------------------------------
    Frederick Butler
    ------------------------------


  • 2.  RE: Tree Command

    Posted Wed January 26, 2022 10:02 AM
    As long as there is no tree command you can use

    # ls -R example/ | grep ':$' | sed -e 's/:$//' -e 's/[^\/]*\//| /g' -e 's/| \([^|]\)/`--\1/g'
    `--dir1
    | `--dir1
    | `--dir2
    | `--dir3
    `--dir2
    | `--dir1
    | `--dir2
    | `--dir3
    `--dir3
    | `--dir1
    | `--dir2
    | `--dir3

    Sascha Wycisk

    ------------------------------
    Sascha Wycisk
    ------------------------------



  • 3.  RE: Tree Command

    Posted Wed January 26, 2022 10:10 AM
    Right now it is not in our plan.
    But I think it should be easy to compile. All the build tools are available on AIX toolbox you may want to build it yourself.
    Other option is to use ls command as provided by Sascha, you can create a script with tree name or alias.

    ------------------------------
    SANKET RATHI
    ------------------------------



  • 4.  RE: Tree Command

    Posted Fri January 28, 2022 02:29 AM
    Hi Frederick,

    tree is also available as a bash implementation on github. Unfortunately no one-liner, but the output looks like from the usual command.

    https://github.com/kddnewton/tree/blob/main/tree.sh

    Best regards

    ------------------------------
    Niklas
    System Engineer UNIX and Linux on Power
    ------------------------------



  • 5.  RE: Tree Command

    Posted Mon March 28, 2022 09:01 AM
    Hi all,

    tree is available as part of the AIX Toolbox since a few days ans looks pretty good!

    root@testserver /root# yum install tree
    FI_AIX_YUM_HTTP_NOARCH | 2.6 kB 00:00:00
    FI_AIX_YUM_HTTP_ppc | 2.7 kB 00:00:00
    FI_AIX_YUM_HTTP_ppc72 | 2.5 kB 00:00:00
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package tree.ppc 0:1.8.0-1 will be installed
    --> Finished Dependency Resolution

    Dependencies Resolved

    ===================================================================================================================
    Package Arch Version Repository Size
    ===================================================================================================================
    Installing:
    tree ppc 1.8.0-1 FI_AIX_YUM_HTTP_ppc 119 k

    Transaction Summary
    ===================================================================================================================
    Install 1 Package

    Total download size: 119 k
    Installed size: 119 k
    Is this ok [y/N]: y
    Downloading Packages:
    tree-1.8.0-1.aix6.1.ppc.rpm | 119 kB 00:00:00
    Running Transaction Check
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
    Installing : tree-1.8.0-1.ppc 1/1

    Installed:
    tree.ppc 0:1.8.0-1

    Complete!
    root@testserver /root# rpm -qil tree
    Name : tree
    Version : 1.8.0
    Release : 1
    Architecture: ppc
    Install Date: Mon Mar 28 14:59:30 MESZ 2022
    Group : Unspecified
    Size : 387357
    License : GPLv2+
    Signature : (none)
    Source RPM : tree-1.8.0-1.src.rpm
    Build Date : Thu Aug 26 13:39:39 MESZ 2021
    Build Host : pokndd5.pok.stglabs.ibm.com
    Packager : IBM AIX Toolbox <https://ibm.biz/AIXToolbox>
    URL : http://mama.indstate.edu/users/ice/tree/
    Bug URL : https://ibm.biz/aixoss_forum
    Summary : File system tree viewer
    Description :
    The tree utility recursively displays the contents of directories in a
    tree-like format. Tree is basically a UNIX port of the DOS tree
    utility.
    /opt/freeware/bin/tree
    /opt/freeware/doc/tree-1.8.0
    /opt/freeware/doc/tree-1.8.0/INSTALL
    /opt/freeware/doc/tree-1.8.0/LICENSE
    /opt/freeware/doc/tree-1.8.0/README
    /opt/freeware/doc/tree-1.8.0/TODO
    /opt/freeware/man/man1/tree.1

    Thanks to the team and best regards

    ------------------------------
    Niklas
    System Engineer UNIX and Linux on Power
    ------------------------------