Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

 What is Kernel and what is Shell?

 Kernel: The kernel is the core part of the UNIX operating system. It manages system
resources and allows other programs to run and use these resources. The kernel
handles memory management, process scheduling, file management, and more.
 Shell: The shell is a command-line interpreter that provides an interface for users to
interact with the operating system. It interprets the commands entered by the user and
communicates with the kernel to execute them. Examples of shells include Bash, C
shell, and Korn shell.

 What are the important system calls in UNIX?

 Some important system calls in UNIX include:


o fork(): Creates a new process by duplicating the existing process.
o exec(): Replaces the current process image with a new process image.
o wait(): Makes the parent process wait until all of its child processes have
terminated.
o open(): Opens a file.
o read(): Reads data from a file.
o write(): Writes data to a file.
o close(): Closes a file descriptor.

 What is internal command and what is external command?

 Internal Command: An internal command is built into the shell itself and does not
require an external executable to run. Examples include cd, echo, pwd, set, and
export.
 External Command: An external command is a separate executable file located in
one of the directories listed in the PATH environment variable. Examples include ls,
grep, awk, sed, and find.

 Describe UNIX file system.

 The UNIX file system is a hierarchical structure consisting of files and directories.
The top of the hierarchy is the root directory, represented by a slash (/). It includes
several important directories like /bin for binary executables, /etc for configuration
files, /home for user home directories, and /var for variable files like logs.

 What are the different types of UNIX file system?

 UNIX file systems include:


o Ordinary files: Regular files containing user data.
o Directories: Special files that contain information about other files.
o Character device files: Represent devices that can be accessed one character
at a time (e.g., terminals).
o Block device files: Represent devices that can be accessed in blocks (e.g.,
hard drives).
o FIFO files: Named pipes used for inter-process communication.
o Socket files: Used for network communication.
 What is absolute pathname and what is relative pathname?

 Absolute Pathname: Specifies a complete path from the root directory. For example,
/home/user/docs/file.txt.
 Relative Pathname: Specifies a path relative to the current working directory. For
example, if the current directory is /home/user, a relative path might be
docs/file.txt.

 Difference between cd . and cd ..

 cd .: Changes to the current directory (no effect, as it references the current


directory).
 cd ..: Changes to the parent directory of the current directory.

 What are the file attributes?

 File attributes in UNIX include:


o Type: Indicates if it’s a regular file, directory, symbolic link, etc.
o Permissions: Read, write, and execute permissions for owner, group, and
others.
o Links: Number of links to the file.
o Owner: User who owns the file.
o Group: Group that owns the file.
o Size: Size of the file in bytes.
o Timestamp: Last modification, access, and change times.

 What is absolute permission and relative permission?

 Absolute Permission: Permissions set using numeric values (e.g., chmod 755
filename).
 Relative Permission: Permissions set using symbolic notation (e.g., chmod u+x
filename).

 What is Hard link, Soft link and significance link?

 Hard Link: A directory entry that associates a name with a file on a file system. Hard
links share the same inode.
 Soft Link (Symbolic Link): A file that points to another file by name. If the target
file is deleted, the link becomes broken.
 Significance: Hard links cannot span different file systems, while soft links can. Soft
links can also link to directories.

 What is standard output, standard input, and standard error?

 Standard Input (stdin): The default source of input for a program, typically the
keyboard.
 Standard Output (stdout): The default destination for output from a program,
typically the terminal screen.
 Standard Error (stderr): The default destination for error messages, typically the
terminal screen, separate from stdout.

 Write the steps of shell creating.

 The steps for shell creation are:


o init: The initial process started by the kernel that spawns other processes.
o getty: The process that manages physical or virtual terminals and waits for a
user to log in.
o login: The process that handles user authentication.
o shell: The command interpreter that provides the user interface after a
successful login.

 What is background process?

 A background process runs independently of the terminal, allowing the user to


continue other tasks. Background processes are initiated by appending an ampersand
(&) to the command (e.g., sleep 100 &).

 What is zombie state?

 A zombie state refers to a terminated process that still has an entry in the process
table. It occurs when the process has finished execution but its parent has not yet
called wait() to read its exit status.

 How to reduce priority of process?

 The priority of a process can be reduced using the nice command. For example, nice
-n 10 command runs the command with a lower priority.

 What is an environment variable?

 Environment variables are dynamic values that affect the processes or programs on a
computer. They are used to pass information into processes that are spawned from the
shell. Common environment variables include PATH, HOME, USER, and SHELL.

You might also like