rm and rmdir commands uses to delete from linux system. rm command use for delete file. On the other hand, rmdir command uses for delete directory from linux system. Also, rm command can delete directory with -rf option.
Firstly, we would create a directory and files for test.
create directory and files
#> mkdir /testdirectory
#> vi testfile1.abc
#> vi testfile2.cba
delete directory and files with rm command
#> rm -rf /testdirectory
Note : This command do that delete /testdirectory and files.
#>rm -f /testdirectory/testfile1.abc
Note : This command do that delete testfile1.abc
delete directory with rmdir command
#> rmdir /testdirectory
Note : If /testdirectory do not have file, this command can delete directory. Else, can not delete. You have to use rm -rf command for delete with files.