View note:Shell-Script-interview-questions-intermediate



Questions of this subject!.

QuestionLikes!Dislikes!Answers!
1)How long does a variable in a shell script last?

002
2)How can we use "expect" command in a script ?

001
3)How To Use Bc (bash Calculator) In A Shell Script?

002
4)How To Define Functions In Shell Scripting?

002
5)Explain what do you know about the term shell when it comes to scripting? Name a few shells that are commonly used

000
6)In Shell scripting, how you will put separate the grep and egrep?

002
7)what is super block?

001
8)Is it possible to pass arguments to the scripts when the same in running in the UNIX?

001
9)How can you calculate the overall number of arguments that have been passed to a script?

001
10)How you will treat the quoted arguments as separate ones from the general? Is it possible to treat them in a single string?

001
11)In Shell scripting, how you will display the process id of the process executing currently and id of processes that take place recently?

001
12)Can you tell something about the Zombie Processes in shell scripting?

002
13)In shell scripting, what is the significance of the Shebang line?

001
14)In UNIX shell scripting, what there is a need to connect the system to remote server according to you?

001
15)What is the function of utilities that come with the open client driver in the shell scripting?

001
16) Suppose you execute a command using exec, what will be the status of your current process in the shell?

101
17)In shell scripting, where you will find the login names of all the users on a system and how they can be printed at the same time?

000
18)In UNIX, what is the primary fundamental component on a file system?

001
19)How can you put separate soft and the hard link in shell scripting?

001
20)What according to you is the simplest method for copying a file from one system to another?

001
21)In Shell scripting, how the user can frequently monitor a log file that is updating?

001
22)Is it possible to use a shell script to determine if the directory actually exists or not?

002
23)Are you familiar with the methods that are useful in debugging a problem related to the shell script?

002
24) How the break and continue in the system are different from one another in scripting?

001
25)Why writing the Shell Scripts is important according to you?

001
26) In Shell scripting, how can you say that C Shell is better than Bourne Shell?

004
27)Which is the best Way To Pretty Print JSON On The Command-Line

000
28)What are the advantages and disadvantages of shell scripting?

001
29)Name the Command that used for Displaying the list of files in a directory

001
30)What are Shell Variables? Mention types of Shell Variables?

002
31)List out few unix commands used very often

001
32)Difference between process and thread

001
33)Without restarting the machine, how can we remove all the running processes?

001
34)Command to work with file permissions?

001
35)Command to append output to a file

001
36)Explain structure of File Permissions.

001
37)How can you get the PID of the current process?

101
38)What is “$*” in shell scripting?

001
39) What are Vi Editor modes available?

001
40)Syntax for ls command , cd command , mkdir and rmdir.

001
41)What is unix shell scripting?

002
42)What Is The Difference Between $* And $@?

001
43)How to get end line from a file?

001
44)How To Put Comments In Your Shell Script?

003
45)What Are The Special Variables Set By Bourne Shell For Command Line Arguments?

001
46)Give an example how to write function ?

000
47)How to add string to string ?

002
48)What it means by #!/bin/sh or #!/bin/bash at beginning of every script ?

001
49)What would be the output of command: [ -z "" ] && echo 0 || echo 1

001
50)What would be the output of the command: name=John && echo 'My name is $name'

001
51)How to redirect stdout and stderr streams to log.txt file from script inside ?

001
52)How to get home_dir with echo command

001
53)Write the program which counts unique primary groups for users and displays count and group name only

001
54)What difference between ${variable:-10} and ${variable: -10} ?

000
55)Write a Shell program to check the given number is even or odd. PROGRAM

001
56)Write the output for the following

000
57)Write the output for the following

000
58)Write the output for the following

000
59)How to get home_dir with echo command only if string variable="User:123:321:/home/dir" is given ?

001
60)Write the command which will print numbers from 0 to 100 and display every third (0 3 6 9 …) ?

001
61)Rewrite the command to print the sentence and converting variable to plural: item="car"; echo "I like $item" ?

001
62)How to print the first array element ?

101
63)What $? means ?

001
64)Write the command to test if $b les or equal 12 ?

000
65)Write down syntax for all loops in shell scripting ?

002
66)Write a Shell program to find the sum of odd digits and even digits from a number.

101
67)How will you connect to a database server from Linux?

001
68)I want to read all input to the command from file1 direct all output to file2 and error to file 3, how can I achieve this?

000
69)How will you print the login names of all users on a system?

000
70)How can I send a mail with a compressed file as an attachment?

000
71)How will you abort a shell script before it is successfully executed?

103
72)How to remove the headers from a file using command in Linux?

001
73) Is it possible to view all the non-printable characters from a text file on Linux System? How will you achieve this?

000
74)Solve the following

000
75)How many shell scripts come with UNIX operating system?

001
76)What is Shell?

001
77)What are the four fundamental components of every file system on Linux?

001
78)How will I insert a line "ABCDEF" at every 100th line of a file?

000
79) List some of the common and most widely used UNIX commands.

001
80)How will you emulate wc –l using awk?

000
81) I want to connect to a remote server and execute some commands, how can I achieve this?

000
82)What are hard links and soft links?

001
83)write a program to find whether a given number is prime or not

101
84)how many basic operators are there in bash/shell scripting

001
85)What Is Shebang In A Shell Script?

002
86)What Are The Different Commands Available To Check The Disk Usage?

001
87) What Is Ifs?

001
88) What Are Control Instructions?

001
89)What Are The Three Editors Available In Almost All The Versions Of Unix?

001
90)What is a file system?

101
91)What Are Positional Parameters?

001
92)What Is The Lifespan Of A Variable Inside A Shell Script?

001
93)How Are Shell Variables Stored?

001
94)Which of the following directive determines the maximum amount of time that a PHP script will spend attempting to parse input before registering a fatal error?

001
95)Why is shell script needed?

001
96)How to find the current shell which you are using?

001