How to delete directory on CentOS Linux Server | Linux Full Tutorial 2020

Published: 04 April 2020
on channel: Linux Teaching House
76
0

340K Subscribers . 625K Views

Welcome to the video -"How to delete directory on CentOS Linux Server | Linux Full Tutorial 2020"
In this video I'll teach you how to delete directory on CentOS Linux Server
Keep watching my video

To delete a directory on a CentOS Linux server, you can use the rm command with the -r flag. Here are the steps to follow:

Open a terminal window or log in to the system using SSH.

Navigate to the parent directory of the directory you want to delete. For example, to delete a directory named "mydir" located in the root directory, type:

bash
Copy code
cd /
Type the following command to delete the directory and its contents:

bash
Copy code
rm -r mydir
This will delete the directory named "mydir" and all of its contents.

Confirm that the directory has been deleted by typing the following command to display the list of directories in the current directory:

bash
Copy code
ls -l
This should not show the directory you just deleted.

That's it! You have successfully deleted a directory on your CentOS Linux server using the rm command with the -r flag. Make sure to use this command with caution, as it will delete all contents of the directory as well.

Please Subscribe and click the notification bell so you never miss a video
Thank You For Watching

#LinuxFullTutorial2020
#LinuxTipsandTricks2020 #LinuxServer #LinuxTeachingHouse