Can anyone help. I have a set of files held in a directory some of the files are empty. What I want to do is generate a list from that directory excluding the empty files.
each time it find an empty file I will want to do a mv so I think I will need to do columb's way. There will be no sub directories but thanks its useful to know the find command way.
You could try
find . -type f -size +0 -exec mv {} newdir \; or for more control of the new file name something like
find . -type f -size +0 | xargs -I {} mv {} {}.old \;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.