Linux Shell Scripting
Shell Scripting is a command line interpreter program or script written on shell that allows a user to interact with LINUX/UNIX OS. It helps to combine sequence of repetitive and lengthy commands in a single file and when made an executable code, it will help users to automate tasks. Although there are many types of shells but the Bourne Shell and C shell are the major ones. One of the most popular derivatives of Bourne Shell used by programmers is Bourne-Again Shell.
Take this assessment to know how good you are with the Shell Scripting.
Read FAQs tab carefully for Instructions before beginning the assessment.
NYXPoints are used to generate the Leaderboard (coming soon). They are awarded for achieving a certain score.
- 200 nyxpoints for a passing score of 80% or more
- 300 nyxpoints for a perfect score of 100%
- Didn’t pass? You still get 30 nyxpoints for attempting the assesment
IMPORTANT instructions for taking the Assessment
- The timer starts when you click Start Assessment
- DO NOT refresh/reload the page or use the back button to navigate away from the page.
- Navigating away from the assessment page DOES NOT stop/pause the timer and the will restart the assessment when you come back to it. The answers are NOT saved.
General
- There are NO pre-requisites to take this assessment. Take this assessment even if you are completely new to Linux.
- The assessment is completely FREE.
- Preferably take it in a closed book mode.
- DO NOT copy/paste, share or upload questions elsewhere.
Eligible Rewards
![](https://tap.thinknyx.com/wp-content/uploads/2022/03/reward-nyxpoints-300x300.png)
300 NyxCoins*
* NyxCoins vary on score
Assessment Summary
0 of 30 Questions completed
Questions:
Information
You have already completed the assessment before. Hence you can not start it again.
Assessment is loading…
You must sign in or sign up to start the assessment.
You must first complete the following:
Results
Results
0 of 30 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Average score |
|
Your score |
|
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- Current
- Review
- Answered
- Correct
- Incorrect
-
Question 1 of 30
1. Question
Which of the following statement is not true about a SHELL in Linux?
CorrectIncorrect -
Question 2 of 30
2. Question
What is the command used to add a user in Linux and create the user’s home directory if it does not exist?
CorrectIncorrect -
Question 3 of 30
3. Question
What is/are the keywords used with for and while loop in shell?
CorrectIncorrect -
Question 4 of 30
4. Question
The command used to take input from a user in Bash is _________.
CorrectIncorrect -
Question 5 of 30
5. Question
Which of the following lines is used as first line in a bash script?
CorrectIncorrect -
Question 6 of 30
6. Question
What is the command written to make the file executable, to run a script?
CorrectIncorrect -
Question 7 of 30
7. Question
Which command in Linux shell is used in listing the names of files in descending chronologically?
CorrectIncorrect -
Question 8 of 30
8. Question
The two mandatory characters followed by the path which is always used to start the first line of the shell scripting are called as:
CorrectIncorrect -
Question 9 of 30
9. Question
What are the variables in bash shell called which accepts arguments from the command line?
CorrectIncorrect -
Question 10 of 30
10. Question
What is the total number of variables or arguments that can be entered from command line?
CorrectIncorrect -
Question 11 of 30
11. Question
Select the Shell command which is used to display the count of characters of a file and store the output in another file.
CorrectIncorrect -
Question 12 of 30
12. Question
Which command in Linux shell is used to delete the user as well as the home directory?
CorrectIncorrect -
Question 13 of 30
13. Question
The command used in Linux shell to extract and display the characters from 4th character to end of line for each line of the specified filename?
CorrectIncorrect -
Question 14 of 30
14. Question
What is the command to show the last five activity done of a recent login in a system?
CorrectIncorrect -
Question 15 of 30
15. Question
_________________ command in bash is used to extract the total number of parameters passed in command line.
CorrectIncorrect -
Question 16 of 30
16. Question
What is the default access permission allotted on creation of a file in shell?
CorrectIncorrect -
Question 17 of 30
17. Question
Which key combination is used in vi editor to delete the entire line on which the cursor is present?
CorrectIncorrect -
Question 18 of 30
18. Question
What is the command to write start and end of case statements in shell?
CorrectIncorrect -
Question 19 of 30
19. Question
What will be the expected output of the given code?
#!/bin/bash
arr1[1] =He
arr1[2] =Knows
arr1[3] =Shell_Scripting
echo ${arr1[@]}
exit 0
CorrectIncorrect -
Question 20 of 30
20. Question
Which among the following is not a valid variable in Shell?
CorrectIncorrect -
Question 21 of 30
21. Question
Predict the output of the following script:
#!/bin/bash
my_function() {
echo “Welcome to my world”
var1=Let
echo “$var1 $var2 $var3 Learn Shell Scripting”
}
var2=me
var3=us
unset var3
my_function
exit 0
CorrectIncorrect -
Question 22 of 30
22. Question
The command written inside a shell code to display the filename of the invoked file:
CorrectIncorrect -
Question 23 of 30
23. Question
What is the command used in shell to declare a variable whose value cannot be overwritten?
CorrectIncorrect -
Question 24 of 30
24. Question
What is the special character to display the shells process ID?
CorrectIncorrect -
Question 25 of 30
25. Question
The__________ metacharacter in Shell can be used for appending the file content to another file.
CorrectIncorrect -
Question 26 of 30
26. Question
Which of the following commands in Shell can be used in displaying the current username?
CorrectIncorrect -
Question 27 of 30
27. Question
What will be displayed after execution of the following Shell code?
my_function(){
echo “Welcome to my world”
echo “to learn Shell”
}
unset -f my_function
my_function
CorrectIncorrect -
Question 28 of 30
28. Question
Predict the output of following Shell code:
day= date | awk ‘{print $2,$3}’
echo $day
CorrectIncorrect -
Question 29 of 30
29. Question
Predict the output of the following BASH script:
#!/bin/bash
ls -lrt | grep ^- | awk ‘END{print $NF}’
CorrectIncorrect -
Question 30 of 30
30. Question
In the command given below -d option of cut is used to:
day1=`date | cut -d” ” -f1`
echo $day1
CorrectIncorrect