To remove a directory and its contents we could erase every individual file in the directory and its subdirectories, then all the subdirectories and finally the directory itself. As this is very cumbersome the rm command can be forced to recursively delete directories and their contents, like the cp command can copy directories recursively:
$rm -R safedata $ls -F a b c data/ junk/ programs/ $