In simple words, when you open a file, the operating system creates an entry to represent that file and store the information about that opened file. So if there are 100 files opened in your OS then there will be 100 entries in OS (somewhere in kernel). These entries are represented by integers like (…100, 101, 102….). This entry number is the file descriptor. So it is just an integer number that uniquely represents an opened file in operating system. If your process opens 10 files then your Process table will have 10 entries for file descriptors.
Similarly when you open a network socket, it is also represented by an integer and it is called Socket Descriptor. I hope you understand.
Related Posts:
- How to pretty print XML from the command line?
- What is the meaning of *nix?
- How to kill a process running on particular port in Linux?
- Display exact matches only with grep
- How to split a delimited string into an array in awk?
- Display exact matches only with grep
- What does ^M character mean in Vim?
- What does it mean to write to stdout in C?
- What do ‘real’, ‘user’ and ‘sys’ mean in the output of time(1)?
- mkdir’s “-p” option
- wait(null) and wait(&status) C language and Status
- Shell script “for” loop syntax
- How to get the current directory in a C program?
- When could or should I use chmod g+s on a file or directory?
- How to Sum a column in AWK?
- Equivalent of *Nix ‘which’ command in PowerShell?
- What is the difference between SIGSTOP and SIGTSTP?
- How to colorize diff on the command line
- How to colorize diff on the command line
- How to read a file into a variable in shell?
- Why should we check WIFEXITED after wait in order to kill child processes in Linux system call?
- gpg decryption fails with no secret key error
- What is the difference between tar and zip?
- Display current path in terminal only
- What do the dup() and dup2() systems really do?
- What is `S_ISREG()`, and what does it do?
- What generates the “text file busy” message in Unix?
- Reasoning behind C sockets sockaddr and sockaddr_storage
- How can I send an email through the UNIX mailx command?
- Rename multiple files based on pattern in Unix
- What is the difference between a symbolic link and a hard link?
- SCP Permission denied (publickey). on EC2 only when using -r flag on directories
- binary operator expected error when checking if a file with full pathname exists
- What is special about /dev/tty?
- How do I do ‘mount –bind’ in /etc/fstab?
- How to read backward from the end of file in less or more?
- Getting the last match in a file using grep
- How do I pause my shell script for a second before continuing?
- What’s a Pthread?
- sudo: npm: command not found
- In the shell, what does ” 2>&1 ” mean?
- How do I grep recursively?
- Difference between binary semaphore and mutex
- How can I safely create a nested directory in Python?
- Why is Windows 32-bit called Windows x86 and not Windows x32?
- Bad File Descriptor with Linux Socket write() Bad File Descriptor C
- How do I grep recursively?
- How can I check if a directory exists in a Bash shell script?
- OS X: equivalent of Linux’s wget
- Connect: Socket operation on non-socket
- What is the difference between read and pread in unix?
- What are atomic operations for newbies?
- How can I exclude directories from grep -R?
- Is there a Python equivalent to the ‘which’ command
- What languages are Windows, Mac OS X and Linux written in?
- Argument list too long error for rm, cp, mv commands
- Difference between using “chmod a+x” and “chmod 755”
- What does WEXITSTATUS(status) return?
- Who can access a file with octal permissions “000” on Linux/UNIX?
- What does the line “#!/bin/sh” mean in a UNIX shell script?
- Extract file basename without path and extension in bash
- Given two directory trees, how can I find out which files differ by content?
- Which characters need to be escaped when using Bash?
- What’s the difference between a file descriptor and file pointer?
- OSError – Errno 13 Permission denied
- cp: missing destination file operand after
- What can cause a “Resource temporarily unavailable” on sock send() command
- Difference between word addressable and byte addressable
- What is cp: cannot stat error in Unix, I get this error when trying to copy thing from one folder to another
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- How to make parent wait for all child processes to finish?
- What are the differences between virtual memory and physical memory?
- What does `set -x` do?
- Command to change the default home directory of a user
- Sorting data based on second column of a file
- C’s printf and fprintf(stdout,) are not printing
- What does “&” at the end of a linux command mean?
- Can’t remove a directory in Unix
- Which of sprintf/snprintf is more secure?
- C fopen vs open
- Using grep and ls -a commands
- Restarting cron after changing crontab file?
- How do I write stderr to a file while using “tee” with a pipe?
- cd into directory without having permission
- grep for special characters in Unix
- Difference between user-level and kernel-supported threads?
- How do I change my private key passphrase?
- Can I nohup/screen an already-started process?
- Environment variables of a running process on Unix?
- In my /etc/hosts/ file on Linux/OSX, how do I do a wildcard subdomain?
- When does /tmp get cleared?
- Is it possible to detach a process from its terminal? (Or, “I should have used screen!”) [duplicate]
- What does ‘set -e’ do, and why might it be considered dangerous?
- Meaning of directories on Unix and Unix like systems
- How to remove empty/blank lines from a file in Unix (including spaces)?
- How can I rename a Unix user?
- How to get pid of just started process
- How to disable everything in crontab -l?
- How to sort ps output by process start time?
- How to check what port mysql is running on