How to delete locked files or folder in Linux

How to delete locked files or folder in Linux

How to delete locked files or folder in Linux

If you try to delete a file or folder in Linux but it is not deleting and you are getting an error like "permission denied" etc, then today in this post i will show you how you can easily delete the file or folder in Linux which is locked. So follow the method below.

Delete locked files or folders in Linux

To delete the locked files or folders in Linux, follow the steps below :-

1. First of all open the Terminal on your linux.

2. Make sure you are running the Terminal as root, if not then type sudo su command in the Terminal.

3. Now after that, type rm -rf command on the Terminal and then type the location of the folder or files you want to delete.

For Example if you have that folder in the Desktop and the name of the folder is Test, then in the terminal type the following

rm -rf (the location of the folder) which will be look like this rm -rf '/home/linux/Desktop/Test'

and then press enter, now the folder will be delete permanently.

4. So in  the same way if you have a file which is not deleting, then open Terminal as root again and type the following

rm -rf (your file)

you can type rm -rf and can drag that file or folder on the terminal to paste the location quickly.

now press enter to delete that file.

5. Using rm -rf command you can delete any locked files easily.

So in this way you can delete any locked files or folders in Linux. If you still have any question then you can ask in the comment section below. Keep visiting QasimTricks for more contents like this.
How to delete locked files or folder in Linux How to delete locked files or folder in Linux Reviewed by Qasim Tricks on October 20, 2019 Rating: 5

No comments:

Powered by Blogger.