Cracking IT Interview
What is Unix?
Unix is an operating system like Windows or any other OS. This is multi-tasking and multi-user operating system, means that more than one job at the same time can run simultaneously. The jobs may be foreground or background jobs at the same time. Also, more than one user shares same system resources at the same time. Other than this, there are some other features like:
UNIX was initially developed in 1969 at Bell Laboratories in New Jersey. Bell Labs researchers Ken Thompson, Dennis Ritchie and team who had worked on Multics wanted to develop an operating system for their own Bell Labs’ programming, job control, and resource usage needs. When Multics was withdrawn, Ken Thompson and Dennis Ritchie needed to rewrite an operating system. The result was a system called UNICS (UNiplexed Information and Computing Service) which was an 'emasculated Multics'.
Unix Version 6 was released in 1975 which became very popular. It was free and distributed with its source code.In 1983, AT&T released Unix System V which was a commercial version. In 1990s, Linux got available which is running parallel to Unix. Now Unix is widespread and available from many sources, both free and commercial.
Different flavors of Unix:
These all follow the UNIX standards POSIX (Portable Operating System Interface).
Different flavors of Linux:
Kernel : It's the core part of operating system. This is the first program loaded after the system boot and having complete control over all the system resources. It handles system's memory management, device management, system calls also running processes and handling interrupts. It handles I/O requests from other software or application program and translate them into data processing signals for CPU. we can say whatever user is doing in the system, Kernel is ultimately responsible to manage all that and make user available with his services.
Shell : This is just an another program which provides the interface between the kernel and the users or other application-softwares. This is also called Command Line Interpreter (CLI). It takes input from the standard input, executes the program and then provide the output to the standard output screen. It gives us the environment where we can run the commands or shell scripts.
Shell provides shell prompt "$" where it expects the command from user under blinking cursor position. Other default shell prompt is "#" for the superuser with all admin rights. We just need to give right commands and press "enter" to execute the commands at the prompt to get required output.
Different flavors of shells:
This is a collection of Unix commands with the sequential order of their execution. It also includes builtin keywords, comments starting from "#" sign and the shell bin path (as /bin/sh) at the top of the script. It follows its own programming syntax for the codes like "if" logical decision statements, ""for" looping constructs or "function" block of codes.
Shell script is interpreted at the time of execution (one-by-one command at a time), is not used to be compiled (whole at once) in execution of codes.
Unix File System:
Everything else in Unix is either a file or a process. Here the type of files like directory, link, block special file, socket file all are termed as "file" only.
Each and every file in Unix is assigned with a unique integer number which is called i-node. All the file attributes and file information are maintained in special area of the disk called i-node table. The purpose of using i-node is to uniquely identify the file in the working system environment.
File / Root structure:
Unix / Linux System Boot Process: