remove directory linux

Code Example - remove directory linux

                
                        rm -rf /path/to/directory/*
                    
                
 

linux remove folder and all his content

                        
                                rm -rf /path/to/directory
                            
                        
 

bash remove directory

                        
                                rm -rf directory-name
                            
                        
 

remove directory from linux

                        
                                rm -r filename

rm -rf filename

this command remove the directory and subdirectory forecefully
                            
                        
 

Delete Directory

                        
                                //delete directory
string deleteDirectoryPath = @"C:\Users\Yogeshkumar Hadiya\Desktop\DirectoryHandling";
if (Directory.Exists(deleteDirectoryPath))
{
    Directory.Delete(deleteDirectoryPath);
    Console.WriteLine("Directory deleted at " + createDirectoryPath);
}
else
{
    Console.WriteLine("Directory not found at " + createDirectoryPath);
}