Linux Solved MCQs

1.

Maximum how long can a Linux filename be?

A. 128 bytes
B. 255 bytes
C. 32 bytes
D. 64 bytes
Answer» B. 255 bytes
2.

Which combination of keys is used to exit from terminal?

A. Ctrl + t
B. Ctrl + z
C. Ctrl + d
D. Ctrl + e
Answer» C. Ctrl + d
3.

Which command(s) is/are used to get help about a command in Linux?

A. info
B. man
C. None of these
D. Both a and b
Answer» A. info
4.

Which command is used to get the kernel version in Linux?

A. uname -r
B. kernel
C. uname -n
D. uname –s
Answer» A. uname -r
5.

Which command is used to list all the files in your current directory(including hidden)?

A. ls -l
B. ls -t
C. ls -a
D. ls –i
Answer» C. ls -a
6.

Which command is/are used to remove directory in Linux?

A. rmdir
B. rm -r
C. only b
D. Both a and b
Answer» D. Both a and b
7.

Which of the following command is used to create file in Linux?

A. touch
B. cat
C. echo
D. All of the above
Answer» D. All of the above
8.

In Linux everything stored as a

A. file
B. directory
C. executables
D. None of the above
Answer» A. file
9.

Which of the following command can be used as an alternative to echo command?

A. print
B. printr
C. printf
D. none of these
Answer» C. printf
10.

Which command is used see the list of users who are currently logged-in?

A. login
B. users
C. who
D. which
Answer» C. who
11.

Which directory in Linux contains all the config file of the system?

A. /etc
B. /var
C. /lib
D. /bin
Answer» A. /etc
12.

Which of the following command is used to count number of lines in a file?

A. wc -l
B. wc -c
C. wc -w
D. None of these
Answer» A. wc -l
13.

Which command is used to copy entire directory?

A. cp -r
B. cp -i
C. cp
D. none of these
Answer» A. cp -r
14.

Which special character should be avoided during naming a file?

A. .(dot)
B. $
C. _(underscore)
D. -(Hyphen)
Answer» D. -(Hyphen)
15.

Suppose I am in /etc directoy, after executing cd .(single dot), where am I now?

A. /etc
B. /(root)
C. /home
D. None of these
Answer» A. /etc
16.

mv command can be used to ?

A. Move the file to different directory.
B. Renaming a file
C. Both a and b.
D. Only a.
Answer» C. Both a and b.
17.

Which command is used to print the login shell of an user?

A. echo $SHELL
B. echo $LOGIN
C. echo $LSHELL
D. None of the Above
Answer» A. echo $SHELL
18.

which command is used to print the current working direcotry?

A. pwd
B. echo $PWD
C. Both A and B
D. Only A
Answer» C. Both A and B
19.

Which command is used to set terminal IO characteristic?

A. tty
B. ctty
C. ptty
D. sty
Answer» D. sty
20.

Which option of ls command used to view file inode number

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

Which directory contains all the files needed to boot the Linux system?

A. /dev
B. /boot
C. /bin
D. none
Answer» B. /boot
22.

What is the right command to save file and exit in Vim?

A. :wq
B. :a
C. :q
D. :q!
Answer» A. :wq
23.

Which of the following is not an editor?

A. expr
B. vi
C. emacs
D. ex
Answer» A. expr
24.

In a date +format, you add the hour in 24 hours format using:

A. %f
B. %H
C. %F
D. %h
Answer» B. %H
25.

What command is used with vi editor to delete a single character?

A. x
B. y
C. a
D. None of the above
Answer» A. x
26.

Which of the following is not a communication command?

A. grep
B. mail
C. mesg
D. write
Answer» A. grep
27.

What command is used with vi editor to replace text from cursor to right

A. S
B. s
C. R
D. r
Answer» C. R
28.

What command is used with vi editor to move back to the beginning of a word?

A. w
B. e
C. a
D. b
Answer» D. b
29.

What command is used with vi editor to search a pattern in the forward direction?

A. ??
B. //
C. ?
D. /
Answer» D. /
30.

What command is used with vi editor to append text at end of line?

A. I
B. i
C. a
D. A
Answer» D. A
31.

Which of the following is not a filter command?

A. sort
B. wc
C. grep
D. cat
Answer» D. cat
32.

While executing a command, the shell

A. Executes it in the same process (as shell)
B. Creates a child shell to execute it
C. Loads a special program to take care of the execution
D. None of the mentioned
Answer» B. Creates a child shell to execute it
33.

Which variable contains current shell process id

A. $*
B. $?
C. $$
D. $!
Answer» C. $$
34.

Hidden files are

A. Those whose ‘read’ bit is set to ‘h’
B. Permitted for (can be accessed) only superusers
C. Files that begin with a ‘.’
D. Files that cannot be opened by ordinary user for writing
Answer» C. Files that begin with a ‘.’
35.

Shell is ?

A. Command Interpreter
B. Interface between Kernel and Hardware
C. Interface between user and applications
D. Command Compiler
Answer» A. Command Interpreter
36.

Which command searches the string in file opened in vi editor?

A. / or ?
B. f or F
C. t or T
D. none of the mentioned
Answer» A. / or ?
37.

Which command sets the number for all lines?

A. :set li
B. :set ln
C. :set nu
D. :set nl
Answer» C. :set nu
38.

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

The permission -rwxr–r– represented in octal expression will be

A. 777
B. 666
C. 744
D. 711
Answer» C. 744
40.

Effective group id can be set using following permission

A. 0777
B. 2666
C. 4744
D. 1711
Answer» B. 2666
41.

The permission -rwSr–r– represented in octal expression will be

A. 0777
B. 2666
C. 4744
D. 4644
Answer» D. 4644
42.

Which command is used to assign read-write permission to the owner?

A. chmod a+r file
B. chmod o+r file
C. chmod u=rw file
D. chmod og-r file
Answer» C. chmod u=rw file
43.

Which of the following umask settings doesn’t allow execute permission to be set by default on directory files

A. 222
B. 111
C. 000
D. 444
Answer» C. 000
44.

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

How to execute ls command inside a vi editor?

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

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. tr
Answer» A. talk
47.

Which of the following command output contains userid?

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

pwd command displays

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

What is the default number of files open per user process?

A. 0
B. 1
C. 2
D. 3
Answer» D. 3
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
Tags
Question and answers in Linux, Linux multiple choice questions and answers, Linux Important MCQs, Solved MCQs for Linux, Linux MCQs with answers PDF download