Text editors and the command line
The UNIX operating system has some unique of ideas and concepts that shape its design. UNIX was the first operating system to abstract all I/O operations under a unified concept. The fathers of UNIX called this concept a file. Each file exposes itself through the same Application Programming Interface (API). This abstraction provides many advantages, such as preventing duplicate code and increasing reusability.
To read/write to a disk, keyboard, document, or network device, it is possible to use the same basic set of commands (such as the cat
, more
, grep
, sed
, and echo
commands).
This principle is encapsulated in the phrase: everything is a file.
This fundamental concept has two sides:
- In UNIX, everything is a stream of bytes.
With reference to a file, called a file descriptor, the I/O access uses the same set of operations and the same API (whatever the device type and the underlying hardware is). As a byte stream, it allows the following...