find in current directory Only

find commands on the current directory on Solaris, without going into sub directories.


Add the following operations with find commands :

! \( -type d ! -name {DIRECTORY NAME} -prune \)

Replace the directory to be searched for {DIRECTORY NAME}


Below example will only remove all files from current directory older than one week.

find . ! \( -type d ! -name . -prune \) -mtime 7 -exec rm {} \;

No comments:

Post a Comment