× 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.



More testing I tried the following;

find /msdtest -path '/msdtest/*'
-type d -exec rm {} \;

And I get the error which is suggesting a problem with the rm command ???

rm: 001-2139 The object /msdtest/dir1 is a directory. No such path or
directory.
rm: 001-2139 The object /msdtest/dir2 is a directory. No such path or
directory.
rm: 001-2139 The object /msdtest/dir3 is a directory. No such path or
directory.
rm: 001-2139 The object /msdtest/dir4 is a directory. No such path or
directory.


Don







From: "Don Brown via MIDRANGE-L" <midrange-l@xxxxxxxxxxxxxxxxxx>
To: midrange-l@xxxxxxxxxxxxxxxxxx
Cc: "Don Brown" <DBrown@xxxxxxxxxx>
Date: 31/01/2021 05:42 PM
Subject: Removing empty directories on the IFS
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx>



I just completed a full system save on a system and there were over a
million files in the IFS.

I now realise that the auto clean up was deleting files but not
directories.

I now find the -empty option on the find tool is not available in IBMi in
QSH

I have been using the find command as per the following example but it is
only deleting files;

find /home -path '/home/*'
-type f -name '*.*' -mtime +90 -exec rm {} \;


I read that I can use -type d for directories but I still have not been
able to get this to actually remove a directory.

I created the following directories

\test
\test\dir1
\test\dir1\file1.txt
\test\dir1\file2.txt

I then ran

find /test -path '/test/*'
-type f -name '*.*' -exec rm {} \;

And both of the files were deleted but the directories remained.

So I tried

find /test -path '/test/*'
-type d -name '*.*' -exec rm {} \;

And still the directories were not deleted.

System is V7R3 and PTF's updated 2 weeks ago.

Any suggestions gratefully accepted.

Thanks

Don




--
This email has been scanned for computer viruses. Although MSD has taken
reasonable precautions to ensure no viruses are present in this email, MSD
cannot accept responsibility for any loss or damage arising from the use
of this email or attachments..

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.