× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You are looking for this FIND script

From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Patrik Schindler
Sent: Saturday, October 2, 2021 5:41 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: [External] Re: Finding empty folders on IFS and QSH find

[WARNING]: External Email

Hello K.,

Am 01.10.2021 um 17:41 schrieb K Crawford <kscx3ksc@xxxxxxxxx>:

This works. find /home/kcrawford -type d

I am open to other solutions.

A simple shell-script will do also. I assume there are no blanks in the directory names!

Here, find generates a list of all directories starting from the current directory, listing the most nested directories first (so directories freeing directories can be probably identified as free, and deleted). For every entry, a "ls" command prints *all* entries, line by line. An empty directory has only two lines, two entries for . and .., so it's safe to assume that a directory with only two entries is empty and can be safely removed.

for DIR in `find . -depth -type d`; do
if [ `ls -1a ${DIR} |wc -l` -eq 2 ]; then
rmdir ${DIR}
fi
done

Tested in qsh with 7.2, no error messages. Can be used as one-liner, or saved in a *STMF with indents to help understanding at a later point in time. :-)

Important! The backticks are *not* apostrophes! You may see these like a braced expression in mathematics.

:wq! PoC


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Gad Miron
Sent: Wednesday, January 12, 2022 2:20 AM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: [External] Delete old IFS files

[WARNING]: External Email

Hello guys

Sometime ago I have seen a SQL script to delete old IFS files (older then
30 days for instance)

Was it here on Midrange?
Was it a Scott Frostie jem?

Anyone in the know?

TIA
Gad
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Fmidrange-l&amp;data=04%7C01%7Celehti%40quiktrip.com%7C7dca517ae7404c190eb108d9d5a46722%7Cbe902cb3a2b74bfd86442264fe46c43d%7C0%7C0%7C637775724372312942%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=fISJ1Sb%2FJ7nsQ%2BzDCqt8WQhORYVlo8IbjDWlPkl7PtM%3D&amp;reserved=0
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Fmidrange-l&amp;data=04%7C01%7Celehti%40quiktrip.com%7C7dca517ae7404c190eb108d9d5a46722%7Cbe902cb3a2b74bfd86442264fe46c43d%7C0%7C0%7C637775724372312942%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=aCrZRxu1L0RqtLZVmqO3AUGFGIPm5fnzKWdySCzcUPM%3D&amp;reserved=0.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Famazon.midrange.com%2F&amp;data=04%7C01%7Celehti%40quiktrip.com%7C7dca517ae7404c190eb108d9d5a46722%7Cbe902cb3a2b74bfd86442264fe46c43d%7C0%7C0%7C637775724372312942%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=OM3bupnQbswjHuI%2Fyw5KfyjQ4bRc6Afm3kHxeqWusMs%3D&amp;reserved=0

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.