Linux has rm command to delete files and directory in the file system. However rm command alone never work if directory is filled with content and not blank. Rm command support switches that help you to delete all files and sub-directories recursively within a target directory.

$rm -rf  [name of directory]

Use the command above with -rf switch to removed all content recursively without confirmation. Replace [name of directory] with actual directory name. If name of directory is not in current directory then use full path. -r switch used to delete directory even if directory not blank. -f switch used to force directory deletion.


Written by Bala Krishna

Bala Krishna is web developer and occasional blogger from Bhopal, MP, India. He like to share idea, issue he face while working with the code.