Delete Directory in Linux

Hello everyone, i am using rm ./directory to delete the directory some directory and i am facing this error: rmdir: failed to remove directory: Directory not empty, i do not know why this issue occurs, can anyone please help me.

Thank you

@Lokeshjoshi , welcome , we hope you find the forum helpful and educational

I recommend the following actions, then come back with any remaining questions.

ls -al ./directory

man rm
man rmdir

I do not understand how running rm results in an error message from rmdir. I get some fairly specific error messages:

$ rm ./directory
rm: cannot remove './directory': Is a directory
$ rmdir ./directory
rmdir: failed to remove './directory': Directory not empty

Can you clarify: (a) That there are no aliases defined that affect rm and rmdir. Use:

$ type rm rmdir

and (b) What distro and version are you running ?

rmdir removes empty directories only, never files.
rm by default removes files only,
but with -r option (recursive, GNU rm also takes a speaking --recursive option) it removes files and directories (the whole directory tree).

Hi, Thank You for the Suggestions, and these are really help me to delete the Directory, i rm -rf 'AccessType' and it works for me, thank you my problem is solved now,