DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 3rd January 2012
sharris sharris is offline
Package Pilot
 
Join Date: Jun 2010
Posts: 146
Default How do we verify if directory is empty?

How do one verify that a directory is empty using an if else statement (script.sh). So far I use:

Code:
rm -rf /temp_1/*
... but if there is hidden files or files that has a format like this (.file) BSD will not delete it.

Code:
if directory_not_empty
do_something
else
continue
How is this done?

Thanks in advance
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Snapshot Packages Empty - part of commit? IronForge OpenBSD Packages and Ports 3 16th September 2011 10:32 PM
How-To get a directory count sharris FreeBSD General 3 29th April 2011 10:15 PM
bridge no such directory hehehehe OpenBSD General 1 15th December 2009 02:55 AM
strange "~" directory in home directory gosha OpenBSD General 5 23rd February 2009 06:12 PM
how to copy a directory. bsdnewbie999 OpenBSD General 1 12th July 2008 02:36 PM


All times are GMT. The time now is 11:48 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick