Saturday, February 28, 2009

Removing file / folder forcefully

In Ubuntu (or any Linux based OS for that matter) have all folders starting with . (period) as hidden.
These folders will not be displayed with run ls command.

If you want to see the hidden files too, use ls -l command.

I was trying to delete one folder containing 2 files (I guess they are worms / virus in windows) Desktop.ini and Folder.htt . I tried deleting it using Delete Button on Keyboard. I also tried Shift+Delete (I know it doesn't matter) but it didn't work.

Finally after googling a little, I found the solution.
Forcefully delete them.
  1. Open terminal
  2. Go to the folder you wish to delete.
  3. Delete all the files in that folder using sudo rm * (enter your root password when prompted).
  4. Now go up one directory using cd .. command.
  5. Now run sudo rmdir foldername

No comments:

Post a Comment