Deleting folders and files from a directory

7,704

This command will remove directory and sub-directories

  rm -r directory_name

This command will remove forcely

  rm -rf directory_name

This command will remove the empty directory

  rmdir directory_name
Share:
7,704

Related videos on Youtube

user160717
Author by

user160717

Updated on September 18, 2022

Comments

  • user160717
    user160717 over 1 year

    How do you delete all folders and files in a directory and subdirectory?

  • Radu Rădeanu
    Radu Rădeanu almost 11 years
    -f option is not necessary.
  • Qwintus
    Qwintus almost 11 years
    Ok I just looked that up, you're right. Thanks for the correction.