Bash Scripting: remove directories with rmdir and rm commands

preview_player
Показать описание
In this video we look at a bash script that creates directories and places some files in them for the purposes of in turn demonstrating the deletion of those directories. The rmdir command "wants" the directory to be empty before it will remove it. We remedy this situation by explicitly going into the directory, deleting its contents and returning to the parent directory -- then the rmdir command works. The rm command did not work at first because the simplest use of the rm command expects a file not a folder. But if we add the -r (recursive) option, the rm command will delete the contents and then the directory.
Рекомендации по теме
Комментарии
Автор

Thank you ! for such a helpful demonstration!

meghaagrawal
visit shbcf.ru