Home > Linux > Quizzes > Linux Basics Practice Test: Linux Shell Programming
Linux Basics Practice Test: Linux Shell Programming
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 67% Most missed: “Which is true with regards to the shell prompt”
Quiz questions on Shell Programming, Shell Environment, Redirection, Special symbols, Shell functions, & Shell variables. Shell programming in Linux is a type of programming that allows you to control your computer using the command line. It is a powerful tool that can be used to automate tasks, manage files, and interact with other programs. The shell is the program that interprets your commands and executes them. There are many different shells available for Linux, but the most popular one is Bash. To write a shell script, you simply need to create a text file with a .sh extension and... Show more
Linux Basics Practice Test: Linux Shell Programming
Time left 00:00
25 Questions

1. What will be printed for the command below?
$ grep –c “^echo” abc
2. Which of the following file set in the current directory are identified by the regular expression a?b*
3. One of the entry of /etc/passwd file is shown below:
user1:x:1111:2222:Fatskills:/home/user1:/bin/bash
Which among the following will print userid and home dir in the following pattern “user1:/home/user1”
4. Which variable is used to display number of arguments specified in command line
5. Which one of the following is not a valid shell variable?
6. What is a shell in UNIX?
7. How can you search for blank line in a file?
8. Which one is used to select only one copy of the repeated lines?
9. Which character to use to escape meaning of special characters in search operations?
10. Which of the following files will not be displayed by the command cat re* ?
11. Which of these is NOT a valid variable in bash
12. From where would the read statement read if the following statements were executed?
exec < file1
exec < file2
exec < file3
read line
13. Which of the following represents an absolute path?
14. cmd 2>&1 > abc will
15. When the return value of any function is not specified within the function, what function returns?
16. Shell is ?
17. Functions improves the shell’s programmability significantly, because
18. What is the command that can print lines of first file matching with second file?
19. What is the output of the following command for bash shell:
echo linux $0
20. To feed standard output of one command to standard input of another in a single shell session
21. Which command is used to debug a shell script program
22. The redirection 2> abc implies
23. * Specifies
24. To redefine a variable, it can be removed from the list of variables by using the command
25. cmd > abc 2>&1 will