Files and processes in Unix

a minute read

In a Unix system, the two fundamental notion is that things are either a file or a process. A file is just a destination for or a source of a stream of data.

A process on the other hand is a program that is currently running and this program may be associated with a file that either stores the instructions that the program runs or a file that stores the output that the program generates. Files in a Unix system basically are a collection of data that can be referred to by name. Files can be created manually by users of the system or programmatically by running programs or processes.

In a Unix system, a directory is just a file that contains links to other files. Other examples of a file include a text document, a program file (i.e written in python or JavaScript) or an image file.

  • Stdin, Stdout and Stderror
  • Stdin, Stdout and Stderror are default files in Unix with specific responsibilities.
  • Stdin : Default sources of data. In the case of typing a command on the terminal, the default input is the keyboard.
  • Stdout : Default destination for data. In the case of running a command on the terminal, the default output is the screen
  • Stderr : Error messages can be redirected and sent to a file instead of being displayed on the screen. It can be sent to a specific filename or to a /dev/null device/destination. In the command shell, we can refere to these default sources / destinations using numbers.

stidn -0

stdout -1

stderr -2

Facebook Twitter LinkedIn Telegram Whatsapp Pocket


No comments

Related Posts:

As you already know, in Windows just after the install there are a few standard directories like: Windows, Program Files, Documents and Settings/Users. In Linux a similar structure exists but with much more directories. I will present you below the most import...
Metacharacters We often want to refer to a group of files or directories that have a common characteristic. To do this, there are some small constructs which helps the user to filter the needed files. For example if in a folder we have a lot of jpg, mp3 and do...
Linux Directory Map / Structure Root   Path  Description bin/ ( -> usr/bin) Files that can be executed (binary files) used to troubleshot or debug the operating system. boot/ Contains a minimum number of files needed by the operating system to boo...
GIT is a revision control system that allows multiple contributors to work on same projects/files. Is also useful if you have more servers/vms/workstation that you manage and you want to deploy “recipes”/scripts/configurations on them. With GIT, you work local...
Linux server logs are files containing recorded events and messages related to system activities and processes. These logs provide crucial information for system administrators to diagnose issues, monitor system performance, and troubleshoot problems. They hel...
Each Linux/Unix command has 3 communication channels: input, output and error. The output can be filtered and then redirected and by this way parts of it can be captured, depending on the needs. Redirecting the output to a file, using > or >>: > – ...