Thread
:
How do we verify if directory is empty?
View Single Post
#
5
(View Single Post)
3rd January 2012
jggimi
More noise than signal
Join Date: May 2008
Location: USA
Posts: 7,984
Code:
#!/bin/sh cd $DIR rm -rf * .* 2> /dev/null
Completely untested. The intent is to delete all regular and all dot files, suppressing the stderr message complaining about "." and ".." not being deleted.
jggimi
View Public Profile
Visit jggimi's homepage!
Find all posts by jggimi