Top 50 Shell Scripting Interview Questions & Answers (2022)

Shell programming or shell scripting consists of most of the features that modern programming languages have to offer. Any script, simple to complex, can be developed using Shell scripting. It is a series of UNIX commands written to accomplish a particular task using a plain text file. Tasks of day-to-day life can be automated with the help of shell scripting.Â

If you are new to the concepts of Unix, shell, and Perl, read it here. If you have knowledge about shell scripting and have to face a related job interview, then this shell scripting interview questions and answer article will help you with the top shell scripting interview questions that can make your preparation easy.

Shell Scripting Interview Questions & Answers | Linux Admin Certification Training | Edureka

Download PDF Your requested download is ready! Click

Shell scripting has the following disadvantages:

  • Errors are frequent and costly, and a single error can alter the command.
  • The execution speed is slow.
  • Bugs or inadequacies in the languages syntax or implementation.
  • Large, complex tasks arent well suited to it.
  • Contrary to other scripting languages, etc., it provides a minimal data structure.
  • Every time a shell command is executed, a new process is launched.
  • 9. When the script is running in the UNIX, can you pass arguments to it?

    Yes, arguments can be passed, and it is a commonly followed practice. It is carried out to ensure the system does not have an error in executing commands and scripts run smoothly.Â

    Interview Questions for Intermediate

    C is a more preferable option in the following cases:

  • All the commands can be aliased simply with the C shell whereas the same is not possible in case of Bourne Shell.
  • Lengthy commands can be used again and again in C shell whereas the Bourne doesn’t allow the same in all the cases.
  • The command history can be accessed through the C shell but it cannot be accessed through the Bourne.
  • 46. Name the command that one should use to know how long the system has been running.

    Using the Uptime command, you can see how long your system has been active. You can also determine the number of users with running sessions, and the average system load for 1, 5, and 15 minutes. The information displayed at once can also be filtered based on your specified options.

    Example: $ uptime

    Entering the above command at the shell prompt, namely $ uptime, will produce the following output:

    9:21am up 86 day(s), 11:46, 3 users, load average: 2.24, 2.18, 2.16

    Case 1: When parameters are not passed

    q54(1) - Shell Scripting Interview Questions - Edurekaq54.1 – Shell Scripting Interview Questions – Edureka

    Case 2: When the parameter is correctly passed

    q54(2) - Shell Scripting Interview Questions - Edurekaq54.2 – Shell Scripting Interview Questions – Edureka

    3. Name commonly used shells on a typical Linux system.

    There are mainly two kinds of Linux shells- C-shell and Bourne shell. Their derivatives are as follows:

  • Bourne shell: Korn Shell, POSIX Shell, Bourne-Again Shell
  • shell scripting interview questions

    Related Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *