Linux Questions & Answers on Shell Special Symbols for Freshers

1. The $ variables in a shell script context designates

a) The runtime of the script
b) Number of command line arguments
c) PID of the shell running the script
d) The exit status of the shell script
Answer: c
2. Which variable is used to display number of arguments specified in command line

a) $0
b) $#
c) $*
d) $?
Answer: b
3. Which variable contains last background job process id

a) $*
b) $?
c) $$
d) $!
Answer: d
4. Which command can be used to test various file attributes

a) if
b) file
c) test
d) type
Answer: c
5. * Specifies
a) one or more character
b) zero or more charecter
c) nothing
d) none of the mentioned
Answer: b
6. ? Specifies
a) one or more character
b) zero or more charecter
c) one character
d) none of the mentioned
Answer: c
7. Which of the following file set in the current directory are identified by the regular expression a?b*

a) afcc, aabb
b) aabb, axbc
c) abbb, abxy
d) abcd, axbb
Answer: b
8. What command would send the output of cmd1 to the input of cmd2?

a) cmd1 | cmd2
b) cmd1 || cmd2
c) cmd1 && cmd2
d) cmd1 ; cmd2
Answer: a
9. What is the output of the following command for bash shell:
echo linux $0

a) linux echo
b) linux linux
c) linux bash
d) linux
Answer: c
10. Which variable will display the list of the positional parameters?

a) $#
b) $*
c) $?
d) $$
Answer: b

Related

C# Question & Answers on Maths Class for Freshers

1. Which of these classes contains only floating point functions? a) Mathb) Processc) Systemd) Object Answer: a Explanation: Math class contains all the floating point functions that are used for...

Linux Bash Shell Questions & Answers on Built-in Commands for Freshers

1. Which command sets up shorthand for command or command line? a) set b) alias c) new d) echo Answer: b 2. What is the function of bind command in bash shell? a) defining new macros b) defini...

C# Questions & Answers on Collection Classes for Fresher

1. Which among the following is not the ordered collection class? a) BitArrayb) Queuec) Stackd) None of the mentioned Answer: a 2. Which among the following is not an interface declared in System...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item