McqMate
601. |
The statement z = ‘expr 5 / 2′ would store which of the following values in z? |
A. | 0 |
B. | 1 |
C. | 2 |
D. | 2.5 |
Answer» C. 2 |
602. |
The expression expr -9 % 2 evaluates to: |
A. | 0 |
B. | 1 |
C. | -1 |
D. | 2 |
Answer» C. -1 |
603. |
What is the output of the following program?b =
|
A. | 1 1 |
B. | 2 2 |
C. | 0 0 |
D. | 0 1 |
Answer» C. 0 0 |
604. |
What is the output of the following program? [ -n $HOME ]
|
A. | 0 1 |
B. | 1 0 |
C. | 0 0 |
D. | 1 1 |
Answer» A. 0 1 |
605. |
What is the output of the following program? x = 3; y = 5; z = 10;
|
A. | 1 |
B. | 3 |
C. | 5 |
D. | error |
Answer» B. 3 |
606. |
What is the return value ($?) of this code:os = Unix [$osName = UnixName] && exit 2 [${os}Name = UnixName] && exit 3 |
A. | 0 |
B. | 1 |
C. | 2 |
D. | 3 |
Answer» D. 3 |
607. |
What is the output of the following code: s=Unix echo 1.$os 2."$os" 3.'$os' 4.$os |
A. | 1.unix 2.unix 3.unix 4.unix |
B. | 1.unix 2.unix 3.$os 4.unix |
C. | 1.unix 2.unix 3.unix 4.$os |
D. | 1.unix 2.$os 3.$os 4.$os |
Answer» B. 1.unix 2.unix 3.$os 4.unix |
608. |
which of these is NOT a valid variable in bash |
A. | (double underscore) |
B. | _1var (underscore 1 var ) |
C. | _var_ (underscore var underscore) |
D. | some-var (some hyphen var) |
Answer» D. some-var (some hyphen var) |
609. |
What will be output of following command:$ echo "The process id is" $$$$ |
A. | the process id is $$ |
B. | the process id is $<pid>$<pid> |
C. | the process id is <pid><pid> |
D. | the process id is $$$$ |
Answer» C. the process id is <pid><pid> |
610. |
What would be the current working directory at the end of the following command sequence? $ pwd
|
A. | /home/user1/proj |
B. | /home/user1/proj/sr c |
C. | /home/user1 |
D. | /home/user1/proj /src/generic |
Answer» D. /home/user1/proj /src/generic |
611. |
How do you print the lines between 5 and 10, both inclusive |
A. | cat filename | head | tail 6 |
B. | cat filename | head | tail -5 |
C. | cat filename | tail +5 | head |
D. | cat filename | tail -5 | head -10 |
Answer» A. cat filename | head | tail 6 |
612. |
Create a new file “new.txt” that is a concatenation of “file1.txt” and “file2.txt” |
A. | cp file.txt file2.txt new.txt |
B. | cat file1.txt file2.txt > new.txt |
C. | mv file[12].txt new.txt |
D. | ls file1.txt file2.txt | new.txt |
Answer» B. cat file1.txt file2.txt > new.txt |
613. |
If a file with execute permissions set, but with unknown file format is executed |
A. | the file is passed to /bin/sh |
B. | the system returns an error |
C. | the current shell will try to execute it |
D. | none of the mentioned |
Answer» C. the current shell will try to execute it |
614. |
Which of the following is true? |
A. | shell is a process and can be started by superuser only |
B. | shell is a built-in kernel functionality |
C. | shell is a wrapper for all the commands and utilities |
D. | none of the mentioned |
Answer» C. shell is a wrapper for all the commands and utilities |
615. |
Which is true with regards to the shell prompt |
A. | it can be accidentally erased with backspace |
B. | the prompt cannot be modified |
C. | the prompt can be customized (modified) |
D. | none of the mentioned |
Answer» C. the prompt can be customized (modified) |
616. |
What is a shell in UNIX? |
A. | a program through which users can issue commands to unix |
B. | a window management system |
C. | the login screen |
D. | the thing that rides on the back of a turtle in unix |
Answer» A. a program through which users can issue commands to unix |
617. |
Which of the following represents an absolute path? |
A. | ../home/file.txt |
B. | bin/cat |
C. | cs2204/ |
D. | /usr/bin/cat |
Answer» D. /usr/bin/cat |
618. |
The user bhojas logged in and performed the following sequence of command. What will be the output of the last command? $ cd project/module1 $ pwd |
A. | /home/bhojas/project/m odule1 |
B. | /home/project/mod ule1 |
C. | /usr/bhojas/project /module1 |
D. | project/module1 |
Answer» A. /home/bhojas/project/m odule1 |
619. |
BASH shell stands for? |
A. | bourne-again shell |
B. | basic access shell |
C. | basic to advanced shell |
D. | big & advanced shell |
Answer» A. bourne-again shell |
620. |
Which of the following files will not be displayed by the command cat re* ? |
A. | reminder |
B. | receipt |
C. | receipt |
D. | recipe-cake |
Answer» C. receipt |
621. |
The redirection 2> abc implies |
A. | write file 2 to file abc |
B. | write standard output to abc |
C. | write standard error to abc |
D. | none of the mentioned |
Answer» C. write standard error to abc |
622. |
cmd 2>&1 > abc will |
A. | write file2 to file1 |
B. | write standard output and standard error to abc |
C. | write standard error to abc |
D. | write standard output to abc & standard error to monitor |
Answer» D. write standard output to abc & standard error to monitor |
623. |
cmd > abc 2>&1 will |
A. | write file2 to file1 |
B. | write standard output and standard error to abc |
C. | write standard error to abc |
D. | write standard output to abc & standard error to monitor |
Answer» B. write standard output and standard error to abc |
624. |
Which of these is the correct method for appending “foo” in /tmp/bar file? |
A. | echo foo > /tmp/bar |
B. | echo foo >> /tmp/bar |
C. | echo foo | /tmp/var |
D. | /tmp/bar < echo foo |
Answer» B. echo foo >> /tmp/bar |
625. |
Syntax to suppress the display of command error to monitor? |
A. | command > &2 |
B. | command 2> &1 |
C. | command 2> &2 |
D. | command 2> /dev/null |
Answer» D. command 2> /dev/null |
626. |
The following commands gives the output like this #cat file1 file2
|
A. | cat: file1: no such file or directory hello |
B. | no output is displayed |
C. | cat: 1>2: no such file or directory |
D. | hello |
Answer» B. no output is displayed |
627. |
cat < file1 >> file2 | file3 |
A. | file1 content will be appended to file2 and finally stored in file3 |
B. | file1 content will be appended to file2 and file3 will be ignored |
C. | file2 and file3 will have same content |
D. | syntax error |
Answer» D. syntax error |
628. |
Executing cat /etc/password > /dev/sda as superuser will |
A. | write data into a regular file called /dev/sda |
B. | write data to the physical device sda |
C. | it |
D. | none of the above |
Answer» B. write data to the physical device sda |
629. |
rom where would the read statement read if the following statements were executed? exec < file1 exec < file2 exec < file3 read line |
A. | it would read all the files |
B. | it would not read any files |
C. | t would read all the files in reverse order |
D. | it would read only file3 |
Answer» B. it would not read any files |
Done Reading?