#linux 1. **File Descriptors**: • All files opened by a process are identified by file descriptors. They allow programs to read from, write to, or close files, as well as perform other file-related operations. • Each process has its own set of file descriptors, which are stored in a file descriptor table. 2. **Socket Descriptors**: • Sockets used for network communication are also identified by descriptors. Interaction with sockets is performed using the same system calls as with files (for example, read, write). **Standard File Descriptors** By default, each process has three standard file descriptors: 1. **Standard Input (stdin)**: • Descriptor 0, used for input data (for example, from the keyboard). 2. **Standard Output (stdout)**: • Descriptor 1, used for output data (for example, to the screen). 3. **Standard Error (stderr)**: • Descriptor 2, used for outputting error messages (for example, to the screen). File descriptors reside in the kernel space in tables allocated for each process. You can look into `/proc/[pid]/fd/` to see the file descriptors being used by a process with a specific PID (process identifier). When a process wants to read from or write to a file, it opens the file and obtains a file descriptor (FD). An inode (index node) is a data structure that describes a file or directory. It is akin to a menu card that informs what dishes are available and what ingredients they contain. File descriptors are similar to temporary passes you receive during execution for interacting with files, while inodes are permanent backstage identifiers that retain all crucial details. As a DevOps engineer, understanding these concepts is essential for managing processes and their interactions with files in a Linux environment. For example, you can use monitoring tools like `**lsof**` or `**fdisk**` to keep track of open files and the system's resource use as they change rapidly. You can manually try the following commands to monitor file descriptors: - List all open files by a specific user: ``` lsof -u [username] ``` - Check which files are still 'alive' after being deleted: ``` sudo lsof | grep '(deleted)' ``` - List which files are associated with a process's file descriptors: ``` ls -l /proc/[pid]/fd/ ``` **API** : Linux uses `open()`, `read()`, `write()` **Data Type** : simple integers in Linux, HANDLE data type in Windows.