what is directory entry?

Not everything about the file, most of the metadata about the file is stored within the file inode, not the directory entry. The directory entry is just a struct of inode and filename - just enough information to translate from a filename to an inode and get to the actual file.

You can safely imagine a directory as a dictionary:

filename1 :> inode1
filename2 :> inode2
....

Then you just follow the inode number (basically the unique address of a inode -- a sort of pointer) and find all the permissions, ownership data, dates, extended attributes, and of course the contents of the file (if it's a file). Of course the directory entry can also be another directory, symbolic link, device node or anything like that. You have to go there to figure that out.


Directory Entry is basically the mapping of filename to its inode. The user generally accesses the file by its name, however such filenames are not understood by the kernel.

The kernel identifies a file using the inode which is unique for a file.
This inode basically contains all the data of the file except its name and the actual data in the file. Such mapping of the filename to its inode is maintained in the data structure called directory entry.

Remember that many entries (in the same or different directories) may identify the same file (same inode). So, given a name, you can obtain its inode easily; given an inode, finding the names is much harder (and the find utility is the tool for this).