190+ Linux Programming Solved MCQs

Chapters

Chapter: Unit 1
1.

Physical partitioning can be done using:

A. fdisk
B. Disk Driud
C. Both (a) and (b)
D. None
Answer» C. Both (a) and (b)
2.

RPM stands for

A. Random Process Management
B. Red Hat Package Manager
C. Both (a) and (b)
D. None
Answer» B. Red Hat Package Manager
3.

IP address is a

A. Static address
B. Dynamic address
C. Both (a) and (b)
D. None
Answer» C. Both (a) and (b)
4.

NFS stands for

A. New file system
B. Network file system
C. Netware file system
D. None of the above
Answer» B. Network file system
5.

By default, one can mount

A. CDs onto your device as root
B. Floppy disk onto your device as root
C. Pen drive
D. Magnetic tapes
Answer» A. CDs onto your device as root
6.

The agency that sits between the user and the LINUX system is called the

A. logic
B. shell
C. .profile
D. .exec
Answer» B. shell
7.

Which is the earliest and most widely used shell that came with the UNIX system?

A. C shell
B. Korn shell
C. Bourne shell
D. Smith Shell
Answer» C. Bourne shell
8.

In Bourne shell, which file sets the Unix environment for the user when the logs into his HOME directory.

A. .exec
B. .last login
C. .profile
D. .mbox
Answer» C. .profile
9.

The seventh field of /etc/password is

A. password
B. login
C. shell
D. home
Answer» C. shell
10.

The UNIX file system stores a date in physical blocks of

A. 1,024 bytes
B. 512 bytes
C. 2,048 bytes
D. 256 bytes
Answer» B. 512 bytes
11.

Which of the following is not the component of LINUX?

A. CPU
B. Kernel
C. Shell
D. Utilities
Answer» A. CPU
12.

What hardware architectures are not supported by Red Hat?

A. SPARC
B. IBM-compatible
C. Alpha
D. Macintosh
Answer» D. Macintosh
13.

How can you add Amit, a new user, to your system?

A. Using useradd
B. Using adduser
C. Using linuxconf
D. All of the above
Answer» D. All of the above
14.

How many primary partitions can exist on one drive?

A. 16
B. 4
C. 2
D. 1
Answer» B. 4
15.

RPM

A. stands for Red Hat Package Manager
B. is used to install, uninstall, and manage packages
C. is used to keep track of the users
D. assigns a dynamic IP address
Answer» A. stands for Red Hat Package Manager
16.

What command is used to query for a specific package with RPM?

A. rpm –q
B. rpm –a
C. rpm –d
D. rpm –l
Answer» A. rpm –q
17.

What script is run for setting bash global defaults for all users?

A. /etc/.profile
B. /etc/.bashrc
C. /etc/.log
D. /etc/profile
Answer» D. /etc/profile
18.

Who founded the Linux Kernel?

A. Bill Gates
B. Ben Thomas
C. Richard Stallman
D. Linus Torvalds
Answer» D. Linus Torvalds
19.

____ tool allows you to change your default X Window desktop.

A. Utilinux
B. Cempre
C. Switchdesk
D. Window
Answer» C. Switchdesk
20.

In what file can you specify which users are not allowed to access a system via FTP?

A. /etc/ftpusers
B. /etc/hosts.deny
C. /etc/ftpaccess
D. All of the above
Answer» A. /etc/ftpusers
21.

Which program is used to schedule particular jobs or programs at particular times on the system?

A. vi
B. Outlook
C. Scheduler
D. cron
Answer» D. cron
22.

Which command can force all buffers to disk?

A. save
B. sync
C. edbuff
D. flush
Answer» B. sync
23.

How many extended partitions can exist on one drive?

A. 16
B. 4
C. 2
D. 1
Answer» D. 1
24.

The location of some system configuration and system administrator executable files, is:

A. /home
B. /proc
C. /var
D. /sbin
Answer» D. /sbin
25.

The location for subdirectories for local programs and executables for user and administrative commands is:

A. /usr
B. /tmp
C. /opt
D. /mnt
Answer» A. /usr
26.

LILO

A. stands for Linux loader
B. is the Linux boot loader
C. is a tool used to boot the Kernel on x86 hardware
D. All of the above
Answer» D. All of the above
27.

Which of the following tool is used to partition your hard drive?

A. mkfs
B. fdisk
C. fsck
D. mount
Answer» B. fdisk
28.

What command can be used to get information about yourself?

A. which
B. pwd
C. i/4
D. who am i
Answer» D. who am i
29.

Which of the following tool allows the user to change the default X Window desktop?

A. Switchdesk
B. Intrc
C. Xinitre
D. Xchange
Answer» A. Switchdesk
30.

What command is used to halt a Linux system?

A. init 0
B. Shutdown –t
C. Shutdown -g -y0
D. Ctrl+Alt+Del
Answer» A. init 0
31.

SVR4 was developed by

A. Sun Microsystems
B. AT&T
C. University of Berkeley
D. Sun and AT&T jointly
Answer» D. Sun and AT&T jointly
32.

Which of these is not a Unix Flavor?

A. BSD
B. MAC
C. AIX
D. IRIX
Answer» B. MAC
33.

Which of the following statement is FALSE?

A. Unix supports multiple users
B. Linux is an open source operating system and the source code is shared
C. Shell takes care of inter process communication
D. Shell provides the feature of I/O Redirection
Answer» C. Shell takes care of inter process communication
34.

Which of the following UNIX flavor is from IBM?

A. BSD
B. Solaris
C. HP-UX
D. AIX
Answer» D. AIX
35.

x86-32 uses which programming model?

A. IP16
B. IP32
C. ILP16
D. ILP32
Answer» D. ILP32
36.

What are the sizes of (Integer/Long/Pointer) in LP64 programming model?

A. 8/8/8
B. 4/4/8
C. 4/8/8
D. 4/8/4
Answer» C. 4/8/8
37.

Which among the following is used to write small programs to control Unix functionalities?

A. Shell Commands
B. Shell Script
C. Filters
D. C Language
Answer» B. Shell Script
38.

What control character signals the end of the input file?

A. ctrl + a
B. ctrl + b
C. ctrl + c
D. ctrl + d
Answer» D. ctrl + d
39.

How do the user gets the help about the command “cp”?

A. help cp
B. man cp
C. cd ?
D. none
Answer» B. man cp
40.

UNIX/Linux kernel is?

A. Monolithic
B. micro
C. Exo
D. nano
Answer» A. Monolithic
41.

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
Answer» C. Buffer cache
42.

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 above
Answer» A. Point to current terminal device
43.

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
Answer» B. User login-logout log
44.

Which is the core of the operating system?

A. Shell
B. Kernel
C. Commands
D. Script
Answer» B. Kernel
45.

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
Answer» A. 32 bit Integer, Long & Pointer
46.

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
Answer» C. 64 bit Unix
47.

Under UNIX the key board is the default input device and the monitor is the default output device

A. True
B. False
C. none
D. all
Answer» A. True
48.

Which among the following interacts directly with system hardware?

A. Shell
B. Commands
C. Kernel
D. Applications
Answer» C. Kernel
49.

Applications communicate with kernel by using:

A. System Calls
B. C Programs
C. Shell Script
D. Shell
Answer» A. System Calls
50.

Solaris is the name of a flavor of UNIX from

A. HP
B. IBM
C. Digital Equipment Corp
D. Sun Microsystems
Answer» D. Sun Microsystems
Chapter: Unit 2
51.

Which of the following commands is used to summarize the disk usage?

A. chkdsk
B. du
C. fdisk
D. disk
Answer» B. du
52.

Which of the following commands is used to copy directory structures in and out?

A. cp
B. cp-p
C. cpio
D. copy
Answer» C. cpio
53.

Which of the following commands is used to change the working directory?

A. cd
B. chdir
C. changedir
D. cdir
Answer» A. cd
54.

Which of the following commands is used to count the total number of line, words and characters contained in a file?

A. count p
B. wcount
C. wc
D. countw
Answer» C. wc
55.

Which of the following commands is used to list contents of directories?

A. 1s
B. dir
C. 1p
D. tar
Answer» A. 1s
56.

Which of the following commands is used to list remove files?

A. erase
B. rm
C. delete
D. dm
Answer» B. rm
57.

Which of the following commands is used to count just the number of lines contained in a file?

A. wc – 1
B. wc - w
C. wc - c
D. wc - r
Answer» A. wc – 1
58.

Which of the following directories contain all the files created by a user, including his login directory?

A. /tmp
B. /usr
C. /etc
D. /dev
Answer» B. /usr
59.

Which command is used to copy the three files wb, collect and mon into the misc directory, under the same, when you were currently in the programs directory?

A. copywb collect mon /mis
B. cpwb collect mon ../misc
C. copywb ../misccollect ../mismon ../misc
D. tarwb collect mon /misc
Answer» B. cpwb collect mon ../misc
60.

Which command is used to assign only read permission to all three categories of the file ‘note’?

A. chmod a-rw
B. chmodgo+r note
C. chmodugo = r = note
D. chmodu+r, g+r, o-x note
Answer» C. chmodugo = r = note
61.

Which command is used to make all files and sub-directories in the directory (prog) executable by all users?

A. chmod –R a+xprogs
B. chmod –x a+xprogs
C. chmod -1 a+xprogs
D. chmod –R 222 progs
Answer» A. chmod –R a+xprogs
62.

The chmodugo+rw note command can be represented in octal notation as

A. chmod 555 note
B. chmod 666 note
C. chmod 333 note
D. chmod 444 note
Answer» B. chmod 666 note
63.

Which of the following commands is used to view the file 24 lines at a time?

A. pg
B. 1p
C. cat
D. /p
Answer» A. pg
64.

The second set of the three permissions (r-) indicates that

A. group has read permission only
B. other has read permission only
C. group has write permission only
D. owner has read permission only
Answer» A. group has read permission only
65.

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
Answer» C. Kernel log messages
66.

The command “mknodmyfifo 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 above
Answer» A. Will create a block device if user is root
67.

Which command is used to set terminal IO characteristic?

A. tty
B. ctty
C. ptty
D. stty
Answer» D. stty
68.

Which command is used to record a user login session in a file ?

A. macro
B. read
C. script
D. none of the above
Answer» C. script
69.

Which command is used to display the operating system name ?

A. os
B. Unix
C. kernel
D. uname
Answer» D. uname
70.

Which command is used to display the unix version ?

A. uname -r
B. uname -n
C. uname -t
D. kernel
Answer» A. uname -r
71.

Which command is used to print a file ?

A. print
B. ptr
C. lpr
D. none of the above
Answer» C. lpr
72.

Using which command you find resource limits to the session?

A. rlimit
B. ulimit
C. setrlimit
D. getrlimit
Answer» B. ulimit
73.

Which option of ls command used to view file inode number ?

A. –l
B. -o
C. –a
D. –i
Answer» D. –i
74.

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
Answer» A. List all files and directories recursively starting from /
75.

In which directory can you store system user default files used for creating user directories?

A. /usr/tmp
B. /etc/default
C. /etc/skel
D. /etc/users
Answer» C. /etc/skel
76.

What command do you use to create Linux file systems?

A. fdisk
B. mkfs
C. fsck
D. mount
Answer» B. mkfs
77.

What command is used to display the characteristics of a process?

A. au
B. ps
C. du
D. pid
Answer» B. ps
78.

What command is used to list the files chap0l, chap02 and chap04?

A. ls chap*
B. ls chap[124]
C. ls - x chap0[124]
D. ls chap0[124]
Answer» C. ls - x chap0[124]
79.

What command is used to add printing jobs to the queue?

A. lpd
B. lpr
C. lpq
D. lpc
Answer» B. lpr
80.

What command is used to list contents of directories?

A. tar
B. dir
C. lp
D. ls
Answer» D. ls
81.

Command used to determine the path of an executable file is

A. which
B. where
C. wexec
D. what
Answer» A. which
82.

Command used to count number of character in a file is

A. grep
B. wc
C. count
D. cut
Answer» B. wc
83.

Which of these commands could you use to show one page of output at a time?

A. less
B. sed
C. pause
D. grep
Answer» A. less
84.

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
Answer» C. du
85.

Which of the following command output contains userid?

A. ls
B. help
C. date
D. ls –l
Answer» D. ls –l
86.

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
Answer» A. ls –aR
87.

Which of the following commands can be used to copy files across systems?

A. ssh
B. telnet
C. rsh
D. ftp
Answer» D. ftp
88.

pwd command displays

A. user password
B. password file content
C. present working directory
D. none of the mentioned
Answer» C. present working directory
89.

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
Answer» C. Umask
90.

Which tar command option is used to list the files in a tape archive format?

A. cvf
B. tvf
C. xvf
D. ovf
Answer» B. tvf
91.

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
Answer» B. grep
92.

Write the command to display the current date in the form dd/mm/yyyy.

A. date +%d/%m/%Y
B. date +”%d/%m/%Y”
C. date +/%d/%m/20%y
D. date +”/%d/%m/20%y”
Answer» A. date +%d/%m/%Y
93.

Which one shows the name of the operating system?

A. uname -n
B. uname -r
C. uname -o
D. uname –m
Answer» C. uname -o
94.

How do you add (append) a file “file1” to the example.tar file

A. no you cannot add a file to example.tar
B. tar -cvf example.tar file1
C. tar -rvf file1 example.tar
D. tar -evf file1 example.tar
Answer» C. tar -rvf file1 example.tar
95.

How to execute ls command inside a vi editor?

A. !ls
B. :ls
C. :!ls
D. we can’t execute
Answer» C. :!ls
96.

Which command gives the first byte where the difference is in the file1 & file2?

A. diff
B. cmp
C. comm
D. ls -a
Answer» B. cmp
97.

To open a file file1 with cursor at line number 4

A. vi +num file1
B. vi +set num file1
C. vi + “set num” file1
D. vi +/se nu file1
Answer» A. vi +num file1
98.

sed is a command typically used for

A. Perform complex calculations
B. Perform FIFO based non-blocking I/O
C. Modify/print selective contents of a file
D. None of the mentioned
Answer» C. Modify/print selective contents of a file
99.

What communication command provides communication to another user logged on by writing to the bottom of their terminal?

A. talk
B. write
C. chat
D. transmit
Answer» A. talk
100.

Which screen manipulation command sets the screen back to normal?

A. tput cup
B. tput smso
C. tput rmso
D. tput blink
Answer» C. tput rmso
Tags
Question and answers in Linux Programming, Linux Programming multiple choice questions and answers, Linux Programming Important MCQs, Solved MCQs for Linux Programming, Linux Programming MCQs with answers PDF download