LINUX
LINUX
LINUX
i. The programming language being used is C. This can be inferred from the file extension
".c" and the use of standard C library headers such as <stdio.h>, <stdlib.h>, and <unistd.h>.
ii. The processes are being created using the fork() system call. The fork() function creates a
new process by duplicating the calling process. After the fork() call, both the parent and child
processes will have copies of the code that follows the fork() call. The value returned by
fork() determines whether the code being executed is in the parent or child process:
• If fork() returns 0, it means the code is executing in the child process.
• If fork() returns a positive value, it means the code is executing in the parent process,
and the return value is the PID (process ID) of the newly created child process.
• If fork() returns -1, it indicates an error occurred during the creation of the child
process.
# Display calendar
cal
iIi. Write down a script command or commands that will grant full privileges Unix in
ABC object an of users potential Unix
To grant full privileges (read, write, and execute) to all users for a file named "ABC" in Unix,
you can use the following command:
chmod ugo+rwx ABC
This command grants the owner (u), group (g), and others (o) full read, write, and execute
permissions on the file "ABC".
d. The Unix operating system is a set of programs that act as a link between the
computer and the user;
i. Outline any four distributions of Linux or Unix distributions.
Four distributions of Linux or Unix are:
1. Ubuntu
2. CentOS
3. Fedora
4. Debian
ii. Illustrate the basic block diagram of the Unix system, explaining the layers therein.
The basic block diagram of the Unix system typically consists of the following layers:
• Hardware Layer: This layer includes physical hardware components such as CPU,
memory, disks, etc.
• Kernel Layer: The kernel is the core of the Unix operating system. It interacts
directly with the hardware and provides essential services such as process
management, memory management, file system management, device drivers, etc.
• Shell Layer: The shell provides a command-line interface (CLI) through which users
interact with the operating system. It interprets user commands and executes them by
communicating with the kernel.
• User Programs Layer: This layer consists of various user-space programs and
utilities that run on top of the kernel. These programs perform specific tasks and
provide additional functionalities to users.
iii. In Unix, there are three basic types of files. Describe each of these types.
The three basic types of files in Unix are:
1. Regular Files: Regular files contain user data and can be text files, binary files, or
any other type of file. They are the most common type of files found in Unix systems.
2. Directories: Directories are special files that contain lists of other files and
directories. They provide a hierarchical structure for organizing and accessing files on
a Unix filesystem.
3. Special Files (or Device Files): Special files represent hardware devices or system
resources. They include character devices (such as terminals and serial ports) and
block devices (such as hard drives and SSDs). Special files allow user processes to
interact with hardware devices through device drivers provided by the kernel.