[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: perl question



Mike Egglestone wrote:

> What would be a nice command to remove a dirtory that had files in it?

rm -rf directory

> Even better.... what would be a nice command to delete all files
> in one directory... (leaving the directory intact)

rm -rf directory/*

which will delete everything in a directory, including subdirectories; or

find . -type f | xargs rm -f

to delete all files in a directory or its subdirectories, but keep the
directory structure intact.

Perl isn't required.

Craig



Reply to: