Empty directory contents
Hi,
I'm trying to ge the syntax right to remove files in a subdir with multiple subdirs, I don't want to delete the actual dirs, just the contents. Cheers |
Hi,
Here are a couple of examples. The first one gets rid of all files and next, you could just get rid of a certain type of file.... cd /home/tech find . -type f -exec rm {} \; or cd /home/tech find . -type f -name '*.jpg' -exec rm {} \; You could also copy the directory structure to a new sub directory and take it from there.... cd /home/tech find . -type d -exec mkdir -p /home/new/{} \; |
All times are GMT -5. The time now is 10:46 PM. |