Author Archive

How to Recover Deleted Files in Linux

We all sometimes delete important files accidently. And sometimes we delete a few files thinking that they aren’t important, but later we might realize that we need them. It is best to keep a backup of files so that they can be easily recovered when they are required later. But even if you didn’t keep a backup, it is still possible to regain the deleted files in your Linux system. Let’s see how:

1. Find the partition in which the deleted file was stored. To do this, you can use the pwd command (print working directory) at the shell console.

An Introduction to Files and Directories in Linux

A UNIX based system like Linux can have multiple file systems. These file systems can in turn have a number of groups, which in turn contain blocks of data and ‘inodes’. Each file system has a descriptor block, which is somewhat like the metadata attached to media files. An inode gives each file a specific identifier in the file system it is in. Each file can extend beyond just a single block of data, depending on its complexity and size.

Inodes

It is a data structure which contains data about a particular file. The ls command followed by –i will tell you about the inode of a file. The inode contains information about the location of the data blocks which contain the particular file you are interested in. It also tells you about the permissions granted to the user for a file, and its physical location.