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

Comments:

No comments

Related Posts:

To send and receive messages between Erlang processes, you can use the message-passing mechanism provided by the Erlang programming language. Here are the key points to understand:Process Identification: In Erlang, processes are identified by a unique process ...
To convert a GMT date to Unix time in Golang, you can follow the steps below:First, you need to parse the GMT date string into a time.Time object using the time.Parse() function. The Parse() function takes two parameters: a layout string specifying the date fo...
Debugging processes in Erlang involves tracing the execution of a specific process to identify and fix any errors or unexpected behavior. Here are some common techniques used for debugging processes in Erlang:Tracing: Erlang provides powerful tracing mechanism...
XML files can be stored in various locations depending on the purpose and requirements of the files. Here are some common storage locations for XML files:Local Storage: XML files can be stored on a local machine's hard drive or any other type of storage de...
The "grep" command is a powerful tool used in Unix-based operating systems to search for specific patterns or text within files. It allows you to filter and extract lines that match certain criteria, making it an efficient way to locate information.To ...
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...