Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

Linux MCQ Set 1

1. The soft link will increase the link counter of the file.(T/F)
a) True
b) False

View Answer

Answer: b [Reason:] None.

2. When you use the ln command, which of the following occurs?
a) a file is created that points to an existing file
b) a file is created that is a copy of an existing file
c) a file is moved from one location to another
d) a file is renamed

View Answer

Answer: a [Reason:] None.

3. srwxr-xrw- is a
a) internet socket file
b) unix domain socket file
c) symbolic link
d) shared file

View Answer

Answer: b [Reason:] None.

4. Binary or executable files are:
a) Regular files
b) Device files
c) Special files
d) Directory files

View Answer

Answer: a [Reason:] None.

5. The directory file contains:
a) File names & File Sizes
b) File names & Inode Numbers
c) File names & Address
d) File names & Permissions

View Answer

Answer: b [Reason:] None.

6. Which directory contain device special files?
a) /etc
b) /etc/dev
c) /root/bin
d) /dev

View Answer

Answer: d [Reason:] None.

7. Which of the following is not a valid file type on Linux
a) Socket
b) Softlink
c) Inode
d) FIFO

View Answer

Answer: c [Reason:] None.

8. Which of the following is not correct statement regarding file types?
a) Hard links share same inode number
b) Soft links cannot be created across partitions
c) Socket files are Unix domain sockets
d) Character file is a special file

View Answer

Answer: b [Reason:] None.

9. Which are the two types of device files?
a) Character & Block
b) Character & Socket
c) Block & FIFO
d) Input & output

View Answer

Answer: a [Reason:] None.

10. Which is an example for character special file?
a) Hard disk
b) CD-ROM
c) Terminal
d) Memory

View Answer

Answer: c [Reason:] None.

11. Which is an example for block special file?
a) Virtual Terminal
b) CD-ROM
c) Terminal
d) Serial modem

View Answer

Answer: b [Reason:] None.

12. All device files are stored in which directory?
a) /etc
b) /bin
c) /dev
d) /usr

View Answer

Answer: c [Reason:] None.

Linux MCQ Set 2

1. The dmesg command
a) Shows user login logoff attempts
b) Shows the syslog file for info messages
c) kernel log messages
d) Shows the daemon log messages

View Answer

Answer: c [Reason:] None.

2. The command “mknod myfifo b 4 16”
a) Will create a block device if user is root
b) Will create a block device for all users
c) Will create a FIFO if user is not root
d) None of the mentioned

View Answer

Answer: a [Reason:] None.

3. Which command is used to set terminal IO characteristic?
a) tty
b) ctty
c) ptty
d) stty

View Answer

Answer: d [Reason:] None.

4. Which command is used to record a user login session in a file
a) macro
b) read
c) script
d) none of the mentioned

View Answer

Answer: c [Reason:] None.

5. Which command is used to display the operating system name
a) os
b) unix
c) kernel
d) uname

View Answer

Answer: d [Reason:] None.

6. Which command is used to display the unix version
a) uname -r
b) uname -n
c) uname -t
d) kernel

View Answer

Answer: a [Reason:] None.

7. Which command is used to print a file
a) print
b) ptr
c) lpr
d) none of the mentioned

View Answer

Answer: c [Reason:] None.

8. Using which command you find resource limits to the session?
a) rlimit
b) ulimit
c) setrlimit
d) getrlimit

View Answer

Answer: b [Reason:] None.

9. Which option of ls command used to view file inode number
a) –l
b) -o
c) –a
d) –i

View Answer

Answer: d [Reason:] None.

10. Find / -name ‘*’ will
a) List all files and directories recursively starting from /
b) List a file named * in /
c) List all files in / directory
d) List all files and directories in / directory

View Answer

Answer: a [Reason:] None.

Linux MCQ Set 3

1. Command used to determine the path of an executable file is
a) which
b) where
c) wexec
d) what

View Answer

Answer: a [Reason:] None.

2. Command used to count number of character in a file is
a) grep
b) wc
c) count
d) cut

View Answer

Answer: b [Reason:] None.

3. Which of these commands could you use to show one page of output at a time?
a) less
b) sed
c) pause
d) grep

View Answer

Answer: a [Reason:] None.

4. Which commands will give you information about how much disk space each file in the current directory uses?
a) ls -l
b) ls -la
c) du
d) ls -a

View Answer

Answer: c [Reason:] None.

5. Which of the following command output contains userid?
a) ls
b) help
c) date
d) ls –l

View Answer

Answer: d [Reason:] None.

6. Which command is used to display all the files including hidden files in your current and its subdirectories ?
a) ls –aR
b) ls –a
c) ls –R
d) ls –l

View Answer

Answer: a [Reason:] None.

7. Which of the following commands can be used to copy files across systems?
a) ssh
b) telnet
c) rsh
d) ftp

View Answer

Answer: d [Reason:] None.

8. pwd command displays
a) user password
b) password file content
c) present working directory
d) none of the mentioned

View Answer

Answer: c [Reason:] None.

9. Which of the following commands can be used to change default permissions for files and directories at the time of creation
a) Chmod
b) Chown
c) Umask
d) Chgrp

View Answer

Answer: c [Reason:] None.

10. Which tar command option is used to list the files in a tape archive format?
a) cvf
b) tvf
c) xvf
d) ovf

View Answer

Answer: b [Reason:] None.

11. Which of the following commands will allow the user to search contents of a file for a particular pattern
a) touch
b) grep
c) find
d) ls

View Answer

Answer: b [Reason:] None.

Linux MCQ Set 4

1. To increase the response time and throughput, the kernel minimizes the frequency of disk access by keeping a pool of internal data buffer called
a) Pooling
b) Spooling
c) Buffer cache
d) Swapping

View Answer

Answer: c [Reason:] None.

2. At start of process execution, STDOUT & STDERR
a) Point to current terminal device
b) Are closed
c) Point to special files on the system
d) None of the mentioned

View Answer

Answer: a [Reason:] None.

3. wtmp and utmp files contain:
a) Temporary system data
b) User login-logout log
c) The user’s command execution log
d) The user’s su and sudo attempts

View Answer

Answer: b [Reason:] None.

4. Which is the core of the operating system?
a) Shell
b) Kernel
c) Commands
d) Script

View Answer

Answer: b [Reason:] None.

5. ILP32 stands for
a) 32 bit Integer, Long & Pointer
b) 32 bit Integrated Long & Pointer
c) 32 bit Intelligent Long & Pointer
d) 32 bit Long & Pointer

View Answer

Answer: a [Reason:] None.

6. Single Unix Specification Version 2 provides enhanced support for
a) 16 bit Unix
b) 32 bit Unix
c) 64 bit Unix
d) 8 bit Unix

View Answer

Answer: c [Reason:] None.

7. Under UNIX the key board is the default input device and the monitor is the default output device
a) True
b) False

View Answer

Answer: a [Reason:] None.

8. Which among the following interacts directly with system hardware?
a) Shell
b) Commands
c) Kernel
d) Applications

View Answer

Answer: c [Reason:] None.

9. Applications communicate with kernel by using:
a) System Calls
b) C Programs
c) Shell Script
d) Shell

View Answer

Answer: a [Reason:] None.

Linux MCQ Set 5

1. Solaris is the name of a flavor of UNIX from
a) HP
b) IBM
c) Digital Equipment Corp
d) Sun Microsystems

View Answer

Answer: d [Reason:] None.

2. Which of the following is “NOT” a UNIX variant ?
a) Solaris
b) AIX
c) IRIX
d) AS400

View Answer

Answer: d [Reason:] None.

3. The system calls in UNIX is written using which language
a) C
b) C++
c) Assembly Language
d) Fortran

View Answer

Answer: a [Reason:] None.

4. Which of the following enables multi-tasking in UNIX?
a) Time Sharing
b) Multi programming
c) Multi user
d) Modularity

View Answer

Answer: a [Reason:] None.

5. Which of the following is considered as the super daemon in Unix?
a) sysinit
b) init
c) inetd
d) proc

View Answer

Answer: b [Reason:] None.

6. Unix is which kind of Operating System?
a) Multi User
b) Multi Processes
c) Multi Tasking
d) All of the mentioned

View Answer

Answer: d [Reason:] None.

7. SVR4 stands for?
a) Standard Version Release 4
b) System Version Release 4
c) Standard Five Release 4
d) System Five Release 4

View Answer

Answer: d [Reason:] None.

8. Lp0 device file is used to access:
a) Floppy
b) Cdrom
c) Printer
d) Tape drive

View Answer

Answer: c [Reason:] None.

9. Syntax of any Unix command is:
a) command [options] [arguments].
b) command options [arguments].
c) command [options] [arguments].
d) command options arguments

View Answer

Answer: a [Reason:] None.

Linux MCQ Set 6

1. 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

View Answer

Answer: c [Reason:] None.

2. 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

View Answer

Answer: c [Reason:] None.

3. 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

View Answer

Answer: c [Reason:] None.

4. 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

View Answer

Answer: a [Reason:] None.

5. Which of the following represents an absolute path?
a) ../home/file.txt
b) bin/cat
c) cs2204/
d) /usr/bin/cat

View Answer

Answer: d [Reason:] None.

6. 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/module1
b) /home/project/module1
c) /usr/bhojas/project/module1
d) project/module1

View Answer

Answer: a [Reason:] None.

7. BASH shell stands for?
a) Bourne-again Shell
b) Basic Access Shell
c) Basic to Advanced Shell
d) Big & Advanced Shell

View Answer

Answer: a [Reason:] None.

8. Which of the following files will not be displayed by the command cat re* ?
a) reminder
b) receipt
c) Receipt
d) recipe-cake

View Answer

Answer: c [Reason:] None.

Linux MCQ Set 7

1. 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 $$$$

View Answer

Answer: c [Reason:] None.

2. What would be the current working directory at the end of the following command sequence?

 $ pwd
 /home/user1/proj
 $ cd  src
 $ cd  generic
 $ cd  .
 $ pwd

a) /home/user1/proj
b) /home/user1/proj/src
c) /home/user1
d) /home/user1/proj/src/generic

View Answer

Answer: d [Reason:] None.

3. 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

View Answer

Answer: a [Reason:] None.

4. 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

View Answer

Answer: b [Reason:] None.

5. 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)

View Answer

Answer: d [Reason:] None.

6. What is the output of the following code:

os=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

View Answer

Answer: b [Reason:] None.

7. 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

View Answer

Answer: d [Reason:] None.

8. What is the output of the following program?

x = 3; y = 5; z = 10;
if [( $x -eq 3 ) -a ( $y -eq 5 -o  $z -eq 10 )]
then
    echo $x
else
    echo $y
fi

a) 1
b) 3
c) 5
d) Error

View Answer

Answer: b [Reason:] None.

9. What is the output of the following program?

[ -n $HOME ]
echo $?
[ -z $HOME ]
echo $?
a) 0
   1
b) 1
   0
c) 0
   0
d) 1
   1

View Answer

Answer: a [Reason:] None.

10. What is the output of the following program?

b = 
[ -n $b ]
    echo $?
[ -z $b ]
    echo $?
a) 1
   1
b) 2
   2
c) 0
   0
d) 0
   1

View Answer

Answer: c [Reason:] None.

11. The expression expr -9 % 2 evaluates to:
a) 0
b) 1
c) -1
d) 2

View Answer

Answer: c [Reason:] None.

12. The statement z = ‘expr 5 / 2’ would store which of the following values in z?
a) 0
b) 1
c) 2
d) 2.5

View Answer

Answer: c [Reason:] None.