Sponsored Links
Sponsored Link

sponsored links



No announcement yet.

I want to compile and use simple linux command line utilities

  • Filter
  • Time
  • Show
Clear All
new posts

  • I want to compile and use simple linux command line utilities

    There is a program called NCDU. It sorts directories from largest combined file sizes to smallest, and you can press enter to drill down into the directoy or d to delete a directory or file. It also has the ability to generate the output to a file. I would like to use it to cleanup the IFS. It does require ncurses. Is there a way to run it from qsh?


    I found a z/OS version

    Any suggestions?

    PS: If anyone knows a way I can run it without qsh, under windows, that might solve it. I see windows 10 has ubuntu bash, but I doubt the company will let me use something like that, but maybe there are other options.

    What do you guys use to cleanup IFS?
    Last edited by bobc_00001; February 28th, 2018, 01:09 PM.

  • #2
    Ncurses is a Unix utility for working with terminals. It seems odd to ask to get that working under Windows, since that doesn't have any concept of the terminals that Unix uses. Though, it probably would work if you used something like Cygwin? That emulates a ton of Unix behavior, so I bet they support ncurses, too.

    As for running it on IBM i, I could see that being possible if you used PASE with a "real" unix terminal (i.e. not a 5250 terminal). I haven't tried it for this utility, though. You'd just have to get a copy of it and it's dependencies that are compiled for AIX and load them into PASE... generally this stuff works, or only requires small tweaks at best.


    • #3
      Thanks for the reply, Scott. Yes CYGWIN had come up on the searches, and I had installed it a while back, but it only sees the files on the local drives, not the mapped IFS drives, and can't even do an ls, saying:

      ls: cannot open directory '.': Not a directory

      ncdu and mc have the same problem, it looks.

      I wonder if there is an FTP based tool that has a way to show the total sizes of the files and summary of the for directories with the ability to drill down and manipulate?

      Do you know of a better place to look for something to solve this?


      • #4
        Anything that runs over a network connection from another computer is going to run significantly slower, so I wouldn't recommend that approach.

        Having said that, I've never had a problem with Cygwin accessing a mapped network drive. It has always worked properly for me. Obviously, you have to use Unix path format, not Windows... but aside from that, I'm not sure why it wouldn't work for you.

        I've always used the IBM supplied tools (RTVDIRINF/PRTDIRINF) to examine the IFS file sizes. It's not interactive, you have to run the delete commands, etc, from a command line. But, for me this has always worked well enough.


        • #5
          NCDU works on the C: drive via CYGWIN, but not for the mapped IFS drive. They don't have a linux partition, as its a Windows only shop, but when they get into a bind, they get less picky.

          I looked more at the man page and source of NCDU, and it has no ability to export a list of the files it finds, and no ability to import a list like that, either. If it did, it would just be a matter of writing the files you selected to delete instead to a delete list text file. AgeDU has the ability to export, and to run a scan on a Windows system that creates a similar format export file, as well as import those exporteds file, and has html output, but it has no drill down or delete capability.

          I know next to nothing other than writing and running non-interactive scripts in Qshell, so at this point using NCDU looks like a "bridge too far" to me.

          Last time I messed with it, I redirected to output of ls to a text file and brought it into the iSeries and used SQL on it, and that did work, but I was just hoping to find a better/more efficient way.

          So thanks for replying, and if you know of a link where there are people using the Qshell and PASE, and extending them, please post it for us.

          Thanks Again


          • #6
            Aha! The newer >= 1.9 versions do have an export/import function, and there is a python2.7 program called ncdu-export. The DEV and QA LPARs have Python, but it looks like Production doesn't


            • #7
              Be VERY careful on some systems with utilities that drill down into directories without being directed to do so. For example, drilling into /QSYS.LIB/QSPL.LIB has the potential to bring some very large systems essentially to a halt. The QSPL file objects are not intended to be accessed by user programming.

              When large numbers of spooled files are maintained in a system, many QSPL files can be created and each can have many members. These all appear as 'directories' when accessed in IFS-naming formats. When the system is actively creating and deleting spooled files while some program is traversing QSPL 'directories', locking conflicts will arise and consequences can be difficult for the programmer. (Sensitive to high volumes of spooled files held in the system.)

              If coding a drill-down utility, I'd automatically exclude the QSPL library and potentially exclude some other 'directories' depending on characteristics of any particular system.

              There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

              Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?


              sponsored links