[colug-432] help with a command

Keith Larson klarson at k12group.net
Sun Aug 10 21:09:22 EDT 2014


I need to setup a test server to test these commands.  I tried several suggestions without the -delete and they reported syntax errors.  I appreciate the suggestions.  I think that I'll find something workable in all of them, but have to have a safe way to test.

Keith Larson
Franklin Computer Services - K12group
klarson at k12group.net
(614) 561-4887 (mobile)
 
 >>> "Pat Collins" <pat at linuxcolumbus.com> 8/10/2014 6:24 PM >>>
Late to the party. Search for the directories named *.PA, then execute rm for to
remove files in that folder. Since rm is not recursive it will only delete what
is in that directory. 

find . -name "*.PA" -type d -exec rm {}/* \;  

This has not been tested by me.

Pat 

On Sun, 10 Aug 2014 13:53:29 -0400 "Keith Larson" wrote

    I am searching for a way to empty the contents of a bunch of folders
without removing the folders themselves AND leave other files at the currect
directory level alone. 

I have a bunch of print queue folders.

du -shc *.PA

shows these results

199M 4A81C53F.PA
941K 4A81D556.PA
0 4A81D56D.PA
192K 4A81D582.PA
632K 4A81D598.PA
0 4A81D5AD.PA
254M 4A81D5C0.PA
0 4A81DF1B.PA
0 4A81DF45.PA  
All folders have a .PA extension so they are easily identified.

You can see that some are empty and some have files (print jobs) in them. I
want to delete all files from WITHIN these folders and nothing else.

Can someone help with a single command that will do this?


_______________________________________________
colug-432 mailing list
colug-432 at colug.net
http://lists.colug.net/mailman/listinfo/colug-432
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.colug.net/pipermail/colug-432/attachments/20140810/823c76b5/attachment-0001.html 


More information about the colug-432 mailing list