• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Finding Large IFS Directories

    November 8, 2006 Hey, Ted

    The Integrated File System (IFS) continues to grow in importance in our shop. That means it also continues to grow in size. How can we determine which directories are largest when it comes time to clean them up?

    –Dan

    Use the Start Qshell (STRQSH or QSH) command to open Qshell. Use cd to navigate to any directory, then try this command.

    ls -alsF | grep /$ | sort -r
    

    Clear as mud, huh? Let’s look at it in detail. The ls command lists the files in a directory. In this case, the directory to be listed is the current directory. The following table explains the function of the four switches.

    Switch

    Description

    -a

    Include
    directory entries whose names begin with a period.

    -l (ell)

    Display
    each entry in long format.

    -s

    Display
    size in units of 1024 bytes.

    -F

    Append /
    to directory names, * to executables, and @ to symbolic links.

    Therefore, the ls command lists the directories directly under the current directory. Each directory name is followed by a slash. Since the file/directory name is the last column in the report, this slash will be the last character on the lines that list a directory name. The first column of each line is the file size in 1K blocks.

    Grep looks for lines that end with a slash and passes them along to the sort routine. The dollar sign ($) tells grep that the pattern–in this case, a slash–must match the end of the line. Grep extracts directories only.

    Parameter

    Description

    /$

    Look for a
    slash at the end of the line.

    Finally the sort utility sorts the list of directories in descending order by the first column, the file size in 1K blocks.

    Switch

    Description

    -r

    Sort in
    descending order (reverse).

    The result looks something like this:

     1588 drwxrwsrwx  453 QSYS   0      1626112 Nov  2 10:21 ../         
      264 drwxrws---   10 BR549  0       270336 May  3  2006 ./          
       88 drwxrws---    4 JSMITH 0        90112 Oct 21  2006 ftp/        
       80 drwxrwsrwx    3 JSMITH 0        81920 May 25  2005 temp/       
       80 drwxrwsrwx    2 JSMITH 0        81920 Sep 18  2005 backup/     
       80 drwxrwsrwx    2 JSMITH 0        81920 Mar 18  2006 shelld/
       80 drwxrws---    2 JSMITH 0        81920 Oct 21  2006 shellb/ 
       80 drwxrws---    2 BR549  0        81920 Aug  3  2001 NETDATA/    
       72 drwxrwsrwx    2 JSMITH 0        73728 Nov 16  2002 bin/        
       72 drwxrws---    2 BR549  0        73728 Aug  3  2001 WWW/       
    

    When it comes to working with the IFS, I find Qshell to be as handy as a pocket!

    –Ted

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    ARCAD Software

    Embrace VS Code for IBM i Development

    The IBM i development landscape is evolving with modern tools that enhance efficiency and collaboration. Ready to make the move to VS Code for IBM i?

    Join us for this webinar where we’ll showcase how VS Code can serve as a powerful editor for native IBM i code and explore the essential extensions that make it possible.

    In this session, you’ll discover:

    • How ARCAD’s integration with VS Code provides deep metadata insights, allowing developers to assess the impact of their changes upfront.
    • The role of Git in enabling seamless collaboration between developers using tools like SEU, RDi, and VS Code.
    • Powerful extensions for code quality, security, impact analysis, smart build, and automated RPG conversion to Free Form.
    • How non-IBM i developers can now contribute to IBM i projects without prior knowledge of its specifics, while ensuring full control over their changes.

    The future of IBM i development is here. Let ARCAD be your guide!

    Register now!

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    Bytware:  StandGuard Network Security 3.0, the next generation of System i security
    T.L. Ashford:  BARCODE400 - the fastest way to create compliance labels directly from the iSeries
    COMMON:  Join us at the Spring 2007 conference, April 29 – May 3, in Anaheim, California

    IDC Says Virtual Tape Library Sales to Double in Five Years Sirius Gets Equity Investment from Thoma Cressey

    Leave a Reply Cancel reply

Volume 6, Number 41 -- November 8, 2006
THIS ISSUE SPONSORED BY:

ProData Computer Services
SEQUEL
Patrick Townsend & Associates

Table of Contents

  • Create Database Files from SQL Queries
  • Stream Files and End-of-Line Delimiters, Take Three
  • Admin Alert: Three Steps to Mapping iSeries Data to a Windows Network Drive
  • Get Creative Using the SQL Database Exit Point
  • Finding Large IFS Directories
  • Admin Alert: The Rule of Fours for i5 Test Environments

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • IBM Unveils Manzan, A New Open Source Event Monitor For IBM i
  • Say Goodbye To Downtime: Update Your Database Without Taking Your Business Offline
  • i-Rays Brings Observability To IBM i Performance Problems
  • Another Non-TR “Technology Refresh” Happens With IBM i TR6
  • IBM i PTF Guide, Volume 27, Number 18
  • Will The Turbulent Economy Downdraft IBM Systems Or Lift It?
  • How IBM Improved The Database With IBM i 7.6
  • Rocket Celebrates 35th Anniversary As Private Equity Owner Ponders Sale
  • 50 Acres And A Humanoid Robot With An AI Avatar
  • IBM i PTF Guide, Volume 27, Number 17

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle