Deleting files
Hi,
I apologise for the simple question (but the title does say where newbies come for help!) I want to delete all the contents in a folder bar one called index.html however, they are all write protected so it asks me to confirm each one Is there a way to force it to delete them? I need to make a cron script to clean out a directory but the files inside are read only basically Thanks in advance |
The manpage (man rm) says:
-f, --force ignore nonexistent files, never prompt |
how about telling it to remove all the files in the directory apart from index.html? (without removing the directory itself, or those within)
Thanks |
Can't think of something how to do that right now, except for:
(this is an ugly workaround, but it'll work) Code:
#!/bin/bash [edit: typo in code] |
Managed to find an alternative solution:
remove the directory with everything in it, readd it, chmod the new one, then untar a file containing the index.html in the appropriate directories It works ok so that should do :) |
All times are GMT -5. The time now is 06:48 AM. |