I am doing this
rm -r users/path/DIR/ *
and it deletes DIR.
I want to delete all contents of DIR without deleting DIR.
I also want to execute this shell script while being in root dir.
ANSWERED: rm -rf instead of rm -r
I am doing this
rm -r users/path/DIR/ *
and it deletes DIR.
I want to delete all contents of DIR without deleting DIR.
I also want to execute this shell script while being in root dir.
ANSWERED: rm -rf instead of rm -r
You have a space between users/path/DIR/ and *. The correct command is :
rm -r users/path/DIR/*
If you also want to delete hidden files run :
rm -r users/path/DIR/* users/path/DIR/.*