Q: How to delete or remove a directory in linux? (Linux commands)
You can remove a directory in linux by "rmdir" command. But it works only if the directory is empty.
Remove/Delete an empty Directory
[root@server ~#]rmdir folder (works only if the directory not empty)
(If directory is not empty you may get error like "rmdir: failed to remove `folder': Directory not empty")
Remove/Delete a directory (non empty)
[root@server ~#]rm -rf folder (it will delete the directory and all its contents)
[root@server ~#]rmdir folder (works only if the directory not empty)
(If directory is not empty you may get error like "rmdir: failed to remove `folder': Directory not empty")
Remove/Delete a directory (non empty)
[root@server ~#]rm -rf folder (it will delete the directory and all its contents)
0 comments:
Post a Comment