How do I delete a directory in Linux terminal?

How do I delete a directory in Linux terminal?

To delete a directory in Linux terminal, you can use the "rmdir" command. "rmdir" is a utility that removes empty directories from a Linux file system.

Here are the steps to delete a directory using "rmdir":

  1. Open a terminal and navigate to the directory that contains the directory that you want to delete.

  2. Type the following command to delete the directory:

rmdir DIRNAME
So‮w:ecru‬ww.lautturi.com

Replace "DIRNAME" with the name of the directory that you want to delete.

  1. "rmdir" will delete the directory if it is empty. If the directory is not empty, "rmdir" will return an error message.

Note: To delete a directory and all of its contents, including subdirectories and files, you can use the "rm" command with the "-r" option. For example:

rm -r DIRNAME

Be careful when using "rm" with the "-r" option, as it can delete large amounts of data quickly and cannot be undone. Consult the "rm" and "rmdir" documentation for more information on the available options and usage examples.

Created Time:2017-10-28 21:38:54  Author:lautturi