Recursive delete directory or files in Linux

To delete (remove) a directory called abc and its content including all files and sub-directories under Unix/Linux like operating systems, you need to use the rm command line utility to remove the files (and directories) specified on the command line. The following command will delete everything including subdires and file from the abc directory. So be careful. You will not able to recover files or sub-dirs from the abc directory. You have been warned. In order to delete directories, it is necessary to use the -r or -R option. This option recursively removes directories and their contents in the argument list passed to the rm command. The user is normally prompted for removal of any write-protected files in the directories unless the -f option is used by the end user. The syntax is as follows:

rm -rf /home/user1/abc
rm -rf /home/user1/abc
rm -rfi /home/user1/abc

Where

-r or -R Attempt to remove the file hierarchy rooted in /home/user1/abc i.e. delete all directory’s contents including all files and sub-dirs.
-f Attempt to remove the files without prompting for confirmation, regardless of the file’s permissions.
-i Request confirmation before attempting to remove each file, regardless of the file’s permissions.