Unix/Lunux/Linux Mcqs Questions Set 4 Sample Test,Sample questions

Question:
* Specifies

1.one or more character

2.zero or more charecter

3.nothing

4.none of the mentioned


Question:
? Specifies

1.one or more character

2.zero or more charecter

3.one character

4.none of the mentioned


Question:
Assuming the files fileA, fileB, fileAB, fileBC and fileABC, exist in a directory, which files match with the pattern file[ABC]?

1.fileA, fileB and fileABC

2.fileABC

3. fileA and fileB

4.fileAB, fileBC and fileABC


Question:
BASH shell stands for?

1.Bourne-again Shell

2.Basic Access Shell

3.Basic to Advanced Shell

4.Big & Advanced Shell


Question:
By default, a Linux user falls under which group?

1.staff

2.others

3.same as userid (UPG)

4.system


Question:
cat < file1 >> file2 | file3

1.file1 content will be appended to file2 and finally stored in file3

2.file1 content will be appended to file2 and file3 will be ignored

3. file2 and file3 will have same content

4.syntax error


Question:
cmd 2>&1 > abc will

1.Write file2 to file1

2.Write standard output and standard error to abc

3.Write standard error to abc

4.Write standard output to abc & standard error to monitor


Question:
Create a new file new.txt that is a concatenation of file1.txt and file2.txt

1.cp file.txt file2.txt new.txt

2.cat file1.txt file2.txt > new.txt

3.mv file[12].txt new.txt

4. ls file1.txt file2.txt | new.txt


Question:
Executing cat /etc/password > /dev/sda as superuser will

1.Write data into a regular file called /dev/sda

2.Write data to the physical device sda

3.Create a temporary file /dev/sda and write data to it

4.None of the mentioned


Question:
For every successful login, which script will be executed?

1./etc/inittab

2./etc/profile

3./etc/login

4./etc/init


Question:
Hidden files are

1.Those whose ‘read’ bit is set to ‘h’

2.Permitted for (can be accessed) only superusers

3.iles that begin with a ‘.’

4.Files that cannot be opened by ordinary user for writing


Question:
How can you search for blank line in a file?

1.$ grep “ “ file

2.$ grep “^$” file

3.$ grep [“ “] file

4.$ grep [^$] file


Question:
How do you print the lines between 5 and 10, both inclusive

1.cat filename | head | tail -6

2.cat filename | head | tail -5

3.cat filename | tail +5 | head

4.cat filename | tail -5 | head -10


Question:
If a file with execute permissions set, but with unknown file format is executed

1.The file is passed to /bin/sh

2.The system returns an error

3.The current shell will try to execute it

4.None of the mentioned


Question:
Indicate the right option to search for BOB, Bob, BOb or BoB?

1.grep –i Bob files

2.grep ‘B[oO][bB]’ files

3.grep ‘[BOB]’ files

4.grep -v ‘Bob’ files


Question:
Shell is ?

1.Command Interpreter

2.Interface between Kernel and Hardware

3.Interface between user and applications

4.Command Compiler


Question:
Syntax to suppress the display of command error to monitor?

1.command > &2

2.command 2> &1

3.command 2> &2

4.command 2> /dev/null


Question:
The $ variables in a shell script context designates

1.The runtime of the script

2.Number of command line arguments

3.PID of the shell running the script

4.The exit status of the shell script


Question:
The /etc/passwd file doesn’t contain

1.userid

2.home directory for a user

3. login shell name

4.none of the mentioned


Question:
The expression expr -9 % 2 evaluates to:

1.0

2.1

3.-1

4.2


Question:
The login shell is

1.The shell program that runs when the user logs in

2.The shell program that authenticates the user while logging in

3.Common shell for all the users that belong to the same group

4.None of the mentioned


Question:
The redirection 2> abc implies

1.Write file 2 to file abc

2.Write standard output to abc

3.Write standard error to abc

4.None of the mentioned


Question:
The statement z = expr 5 / 2 would store which of the following values in z?

1.0

2.1

3.2

4.2.5


Question:
To feed standard output of one command to standard input of another in a single shell session

1.IO redirection can be used

2.Named pipes can be used

3.The pipe operator provided by the shell can be used

4.It can not be done


Question:
User id 0 is

1.An innvalid user id

2.The id of the root user

3.The id of a user when the users account is deleted

4.None of the mentioned


Question:
What command would send the output of cmd1 to the input of cmd2?

1.cmd1 | cmd2

2.cmd1 || cmd2

3.cmd1 && cmd2

4.cmd1 ; cmd2


Question:
What does the following command do ?   who | wc –l

1.List the number of users logged in

2.List the users

3.List the number of users in the system

4.Display the content of who command


Question:
What is a shell in UNIX?

1.a program through which users can issue commands to UNIX

2.a window management system

3.the login screen

4.the thing that rides on the back of a turtle in UNIX


Question:
What is the output of the following command for bash shell: echo linux $0

1.linux echo

2.linux linux

3.linux bash

4.linux


Question:
What will be printed for the command below? $ grep –c “^echo” abc

1.The count of lines that do not contain the pattern echo in file abc

2.The count of lines which begin with the pattern echo in file abc

3.The count of lines that ends with the pattern echo in file abc

4.None of the mentioned


Question:
Which command can be used to test various file attributes

1.if

2.file

3.test

4.type


Question:
Which command is used to debug a shell script program

1.set

2.set -x

3.debug

4.db


Question:
Which is true with regards to the shell prompt

1.It can be accidentally erased with backspace

2.The prompt cannot be modified

3.The prompt can be customized (modified)

4.None of the mentioned


Question:
Which of the following command can be used to change the user password?

1.user cant change the password

2.passwd

3.passd

4.pwd


Question:
Which of the following commands allows definition and assignment of environment variables under bash

1.env

2.export

3.environ

4.setenviron


Question:
Which of the following file set in the current directory are identified by the regular expression a?b*

1.afcc, aabb

2.aabb, axbc

3.abbb, abxy

4.abcd, axbb


Question:
Which of the following files need to be referred for users secondary group?

1./etc/passwd

2./etc/shadow

3./etc/group

4./etc/profile


Question:
Which of the following files will not be displayed by the command cat re* ?

1.reminder

2.receipt

3.Receipt

4.recipe-cake


Question:
Which of the following identifiers associated with a process decide its privilege level

1.uid

2.suid

3.euid

4.gid


Question:
Which of the following is true?

1.Shell is a process and can be started by superuser only

2.Shell is a built-in Kernel functionality

3.Shell is a wrapper for all the commands and utilities

4.None of the mentioned


Question:
Which of the following represents an absolute path?

1.../home/file.txt

2.bin/cat

3.cs2204/

4./usr/bin/cat


Question:
which of these is NOT a valid variable in bash

1.__ (double underscore)

2._1var (underscore 1 var )

3._var_ (underscore var underscore)

4.some-var (some hyphen var)


Question:
Which of these is the correct method for appending “foo” in /tmp/bar file?

1.echo foo > /tmp/bar

2.echo foo >> /tmp/bar

3.echo foo | /tmp/var

4./tmp/bar < echo foo


Question:
Which one is used to select only one copy of the repeated lines?

1.uniq -u

2.uniq -d

3.uniq -c

4.uniq –I


Question:
Which option of grep displays the line number as well?

1.-v

2.-l

3.-n

4.-E


Question:
Which variable contains current shell process id

1.$*

2.$?

3.$$

4.$!


Question:
Which variable contains last background job process id

1.$*

2.$?

3.$$

4.$!


Question:
Which variable is used to display number of arguments specified in command line

1.$0

2. $#

3.$*

4.$?


Question:
Which variable will display the list of the positional parameters?

1.$#

2.$*

3.$?

4.$$


Question:
While executing a command, the shell

1.Executes it in the same process (as shell)

2.Creates a child shell to execute it

3.Loads a special program to take care of the execution

4.None of the mentioned


More MCQS

  1. Unix MCQS Set 1
  2. Unix MCQS Set 2
  3. Unix MCQS Set 3
  4. Unix MCQS Set 4
  5. Linux Mcqs Questions Set 1
  6. Linux Mcqs Questions Set 2
  7. Linux Mcqs Questions Set 3
  8. Linux Mcqs Questions Set 4
  9. Linux Mcqs Questions Set 5
  10. Linux Mcqs Questions Set 6
  11. Linux Mcqs Questions Set 7
  12. Linux Mcqs Questions Set 8
  13. Linux Mcqs Questions Set 9
  14. Linux Mcqs Questions Set 10
  15. Linux Mcqs Questions Set 11
  16. Linux Mcqs Questions Set 12
  17. Linux Mcqs Questions Set 13
  18. Linux Mcqs Questions Set 14
  19. Unix MCQ Set 01
  20. Unix MCQ Set 02
  21. UNIX SYSTEM Mcq
  22. Unix MCQ
  23. Linux MCQ Unit 1
  24. Linux MCQ Unit 2
  25. LINUX MCQ QUESTIONS AND ANSWER
  26. Linux File Permissions MCQ Questions Answers
  27. Linux Administration MCQ question and answer
  28. Linux MCQ QUESTIONS AND ANSWER
Learn Linux Mcqs Questions Set 4,Learn Unix/Lunux Objetive choice questions and answers,Unix/Lunux Multiple choice questions and answers,Unix/Lunux objective, Unix/Lunux questions , Unix/Lunux answers,Unix/Lunux MCQs questions and answer
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!