Introduction to Shell Scripting Interview Questions And Answer
Shell Scripting is a way by which one can alleviate this necessity by automating these command sequences in order to make one’s life at the shell easier and more productive. Unix/Linux uses shells to accept commands given by the end-user; Shell Scripting Interview Questions there are quite a few different shells available. The most commonly used shells are
4.TCSH(Extended C SHell) is based on CSH.
Now, if you are looking for a job that is related to Shell Scripting, then you need to prepare for the 2020 Shell Scripting Interview Questions. It is true that every interview is different as per the different job profiles. Here, we have prepared the important Shell Scripting Interview Questions and Answers, which will help you get success in your interview.
Below are the 10 important 2020 Shell Scripting interview questions and answers that are frequently asked in an interview. These questions are divided into two parts are as follows:
Part 1 – Shell Scripting Interview Questions (Basic)
This first part covers basic Shell Scripting Interview Questions And Answers.
1. What is a Kernel?
The kernel is a computer program that is the interface/resource manager of a computer’s operating system, with complete control over everything in the system. It is responsible for assigning and un-assigning memory space. It manages the following resources of the Linux system –
Device management etc.
2. What is Shell?
A shell is a special user program that provides an interface to a user to use operating system services. Shell accepts human-readable commands from a user and converts them into something which the kernel can understand. The shell gets started when the user logs in or starts the terminal.
It is a command language interpreter that executes commands read from input devices such as keyboards or from the file system.
Let us move to the next Shell Scripting Interview Questions.
3. What are the types of permission at the file level in Shell?
Owner permissions − The permissions granted to a user with all the rights at the root level are known as Owner permissions.
Group permissions − The permissions granted to a user with all the rights in a particular group are known as Owner permissions.
Other (world) permissions − The permissions granted to a user with all the rights globally to a file system are known as Owner permissions.
4. What are the types of File Access Modes in Shell?
The permissions with respect to Linux operating systems are very unique. The fundamental blocks of Unix permissions in a file are the read, write, and execute permissions, which have been described below –
It gives a user the authority to read the contents of the file.
It gives a user the authority to write the content of the file.
It gives a user the authority to execute a file as a program.
5. What are the types of Directory Access Modes in Shell?
Directory access modes are similar to File Access Modes in a shell. There are very minute differences that are listed below –
It gives a user the authority to read the contents of the directory and files within that space.
It gives a user the authority to write and delete the contents of the Directory.
There is no such thing as executing a Directory. It means we can only traverse within it.
Part 2 – Shell Scripting Interview Questions (Advanced)
Let us now have a look at the advanced Shell Scripting Interview Questions.
6. What are the various stages of a Linux process it passes through?
Generally, there are four stages of a Linux process:
Waiting: When resources aren’t given to a Linux process.
Running: when the Linux process is currently being executed.
Stopped: When the Linux process is stopped after successful execution.
Zombie: This stage is known as a zombie because the process has stopped but still active.
7. How are shadow passwords given?
These are the programs that can be used initially to update the shadowed file; a pwconv command is used for giving shadow passwords. The pwconv command creates the file /etc/shadow and changes all passwords to ‘x’ in the /etc/password file. First, entries in the shadowed file which don’t exist in the main file are removed, and these can be manually edited. Then, shadowed entries that don’t have `x’ as the password in the main file are updated. Missed shadowed entries can be added simultaneously. Finally, passwords in the main file are replaced with `x’. Shadow passwords are given for better system security.
Let us move to the next Shell Scripting Interview Questions.
8. What is LILO?
LILO is Linux Loader is a boot loader for Linux. It is used to load Linux into the memory and start the Operating system. LILO can be configured to boot other operating systems as well. LILO is customizable, which means that if the default configuration is not correct, it can be changed. Config file for LILO is lilo.conf.
LILO is also a code snippet that loads PC BIOS into the main memory at the time of starting the computer system. It handles the following tasks :
1. Locating the Linux kernel.
2. Identifying other supporting programs and loading them in memory.
3. Starting Kernel.
The selection of various kernel images and boot routines is supported by LILO. For this reason, it is known as a boot manager.
9. Explain the Linux Directory commands along with the description?
Enlisted below are the directory commands along with descriptions
pwd: It is a built-in command which stands for ‘print working directory. It displays the current working location, the working path starting with / and the directory of the user. Basically, it displays the full path to the directory you are currently in.
Is: This command list out all the files in the directed folder.
cd: This stands for ‘change directory’. This command is used to change to the directory you want to work from the present directory. We just need to type the cd followed by the directory name to access that particular directory.
mkdir: This command is used to create an entirely new directory.
rmdir: This command is used to remove a directory from the system.
10. Enlist some Linux networking and troubleshooting commands?
A network administrator is a person who maintains a system network that includes networking configurations and troubleshooting. Mentioned below are few commands along with their description:
Hostname: To see the hostname of the machine and to set the current hostname.
Ping: To inspect if the machine is responding or not.
ifconfig: To visualize and manage routing and networking protocols. It displays network configuration. ‘ip’ is the replacement of the ifconfig command.
netstat: It displays many network connections, routing tables, interface statistics. Currently, ‘ss’ is the replacement of the netstat command which is used to get more information.
Traceroute: It is a network troubleshoot utility which is used to determine the number of hops required for a particular packet to reach the destination.
tracepath: It is similar to traceroute with the difference that it need not require root privileges.
Dig: This is the command that is used to query the DNS name servers for any task/operations related to DNS lookup services.
nslookup: To search for DNS related queries.
Route: It shows the details of the route table files and the IP routing table.
mtr: This command combines ping and track path into a single command.
Ifplugstatus: This command is used to check network cable is plugged in or not.
This has been a guide to List Of Shell Scripting Interview Questions and Answers. Here we have listed the best 10 interview sets of questions so that the jobseeker can crack the interview with ease. You may also look at the following articles to learn more.