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

Extracting RAR file on Ubuntu

I recently installed Ubuntu on my machine.
I had Vista earlier. I was fed up of Vista.

This is Ubuntu is awesome. Never gets freezed.

I got some ebooks, I needed urgently, from one of my friends. But it was in .RAR format.

I was wondering if there's any RAR extractor for Linux.

I used to use WinRAR on Windows.

I searched online and found the command to install it on my machine.
It's simple.

Open Terminal (On Ubuntu: Application -> Terminal)
Type: sudo apt-get install rar

and it's done.

How to use UNRAR?

Type: unrar help
You will see bunch of options that can be used with unrar.

To just extract the files on your current drive, use..
unrar e filename.rar