Removing Directories (rmdir)

Oracle HomeagetestDocumentation Home > Solaris Advanced User's Guide > Chapter 3 Working With Files and Directories > Directories and Hierarchy > Removing Directories (rmdir)Solaris Advanced User's Guide
  • Previous: Copying Directories
  • Next: Viewing Differences Between Files (diff)

Removing Directories (rmdir)

To remove an empty directory, use the rmdir command as follows:

$ rmdir veggies3 $

If the directory still contains files or subdirectories, the rmdir command does not remove the directory.

To remove a directory and all its contents, including any subdirectories and files, use the rm command with the recursive option, -r.

$ rm -r veggies3 $
Caution – Caution –

Directories that are removed with the rmdir command cannot be recovered, nor can directories and their contents removed with the rm -r command.

  • Previous: Copying Directories
  • Next: Viewing Differences Between Files (diff)

Từ khóa » Xóa Rm