NEW
Font size
WorksheetsCSE105 QUIZ01
Total questions: 15
Worksheet time: 8mins
What is a shell script?
group of commands
a file containing special symbols
a file containing a series of commands, written to perform certain task(s).
group of functions
Shell scripts need to be saved with an extension .sh.
True
False
The first line in any shell script begins with a _____
&
!
$
#
To run the script, we should make it executable first by using _____
chmod +x
chmod +r
chmod +w
chmod +rwx
Which command is used for making the scripts interactive?
grep
input
read
write
The first argument is read by the shell into the parameter ___
1$
$3
$$
$1
The complete set of positional parameters is stored in ______ as a single string.
$n
$#
$*
$$
Which of the following is used for storing the number of positional parameters?
$*
$2
$#
$n
Which symbol will be used with grep command to match the pattern pat at the beginning of a line?
^pat
$pat
pat$
pat^
Which command is used to sort the lines of data in a file in reverse order
sort
sh
st
sort -r
Which command is used to display the top of the file?
cat
head
more
grep
Which command is used to copy all files having the string chap and any two characters after that to the progs directory?
cp chap?? progs
cp chap* progs
cp chap[12] /progs/*.*
cp chap?? /progs/*
None of the above
Which command is used to remove a directory?
remove
rmdir
dldir
rdir
Which command is used to extract specific columns from the file?
cat
cut
grep
paste
Which command sends the word count of the file infile to the newfile.
wc infile >newfile
wc <infile >newfile
wc infile - newfile
wc infile | newfile
