Linux Delete Directory




Remove directory in Linux
Back to the basic things anymore in Linux server administration. Because we use the shell for a day – the day they must be good in navigation can. To delete a file in Linux the command rm we know already and if you ever try execute on a definite Directory message appears error:
rm: cannot remove 'name_folder/': Is a directory
It turned out that Linux has a special command to delete its directory, the "rmdir". How to use it yourself just as easy:
rmdir name_folder

But if those folders contents there will be another error message appears:
rmdir: failed to remove `name_folder': Directory not empty 
If this can be addressed to wear the following command:
rm -rf name_dir

Please be careful – heart alone in using "rm -rf" because it could clean up all of your data if the location of the active shell you are not right.

But I suggest to remove a directory and its contents are wearing this command:
rm -ri name_folder

Why? As this interactive nature so much safer because we know what files or directories deleted. And will ask for a confirmation we have processed. But if the file can be a lot of fuss once indeed.

Whereas if you experience an error message
rm: cannot remove `nama_folder': Permission denied 
- This means you do not have permissions to delete them. Maybe you forgot to use sudo or root user need for their execution.




Next
Previous
Click here for Comments

0 comments: