How would you delete a directory in Linux?

Asked 15-Apr-2022
Viewed 382 times

1 Answer


0

How would you delete a directory in Linux?
  • If you use the GUI, removing a directory in Linux is a rather straightforward procedure. If you don't have access to the GUI, you can alternatively use terminal commands to remove folders.
  • To delete a directory from the terminal window or command line, use one of the following Linux commands:
  • The rm command deletes entire directories as well as their subdirectories and files.
  • The rmdir command is used to get rid of empty directories.
  • It's worth noting that the rm and rmdir commands destroy directories permanently rather than transferring them to the Trash directory. This means that these commands will not be able to recover a directory that has been deleted.


Read More: How to rename a file in Linux?