Title: Files & Directories
Course: CIS 121: Linux/UNIX I: Fundamentals ~ For IGNITE Review > Section: Learning Modules

Everything is a file

A directory is a special kind of file, but it is still a (case sensitive) file. Even a terminal window (/dev/pts/4) or a hard disk (/dev/sdb) is represented somewhere in the file system as a file. It will become clear that everything on Linux is a file. (Paul Cobbault, p. 36)

- There are seven file types - regular, directory, symbolic link, named pipe, socket, block special, and character special.
- When we talk about directories, they are equivalent to Window's folders.
- Directories DO NOT hold the contents of files.
- Directories hold ONLY names of files, directories, etc. and an inode number - names and inode numbers only.
- The inode number references an entry in the partition's inode table.
- The inode number can be displayed by using the -i option of the ls command.

Inode Entry

An entry in a inode table holds information about a file, directory, etc. such as:

- owner, permissions, group
- date created/modified, last accessed
- type and size of file
- pointer to where the data is located
- number of links