• 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
    Midrange Dynamics North America

    Git up to speed with MDChange!

    Git can be lightning-fast when dealing with just a few hundred items in a repository. But when dealing with tens of thousands of items, transaction wait times can take minutes.

    MDChange offers an elegant solution that enables you to work efficiently any size Git repository while making your Git experience seamless and highly responsive.

    Learn more.

    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

  • Public Preview For Watson Code Assistant for i Available Soon
  • COMMON Youth Movement Continues at POWERUp 2025
  • IBM Preserves Memory Investments Across Power10 And Power11
  • Eradani Uses AI For New EDI And API Service
  • Picking Apart IBM’s $150 Billion In US Manufacturing And R&D
  • FAX/400 And CICS For i Are Dead. What Will IBM Kill Next?
  • Fresche Overhauls X-Analysis With Web UI, AI Smarts
  • Is It Time To Add The Rust Programming Language To IBM i?
  • Is IBM Going To Raise Prices On Power10 Expert Care?
  • IBM i PTF Guide, Volume 27, Number 20

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