Contents
How do I unlink a folder in Linux?
How to Remove Directories (Folders)
- To remove an empty directory, use either rmdir or rm -d followed by the directory name: rm -d dirname rmdir dirname.
- To remove non-empty directories and all the files within them, use the rm command with the -r (recursive) option: rm -r dirname.
What does unlink do in Linux?
unlink() deletes a name from the filesystem. If that name was the last link to a file and no processes have the file open, the file is deleted and the space it was using is made available for reuse.