Tuesday, October 24, 2017

LINUX COMMANDS: INTERVIEW QUESTIONS WITH ANSWERS FOR FRESHERS

50 INTERVIEW QUESTIONS FROM LINUX COMMANDS WITH ANSWERS FOR FRESHERS

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

2. The command syntax to display the file ‘sample.txt’ one page at a time is
a) man sample.txt>more
b) cat sample.txt<more
c) cat sample.txt|more
d) None of the above

3. Which one shows the name of the operating system?
a) uname -n
b) uname -r
c) uname -o
d) uname –m

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

5. How to execute ls command inside a vi editor?
a) !ls
b) :ls
c) :!ls
d) we can’t execute

6. Which command gives the first byte where the difference is in the file1 & file2?
a) diff
b) cmp
c) comm
d) ls -a

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

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

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

10. Which screen manipulation command sets the screen back to normal?
a) tput cup
b) tput smso
c) tput rmso
d) tput blink

11. Which command will you use to see the available routes?
a) show route
b) route status
c) netstat -r
d) none of the mentioned

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

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

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

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

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

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

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

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

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

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

22. Which command is used to display the octal value of the text
a) octal
b) text_oct
c) oct
d) od

23. Which command is used to view compressed text file contents
a) cat
b) type
c) zcat
d print

24. Which command changes a file’s group owner
a) cgrp
b) chgrp
c) change
d) group

25. Which command is used to extract intermediate result in a pipeline
a) tee
b) extract
c) exec
d) none of the above

26. Which command is used to extract a column from a text file
a) paste
b) get
c) cut
d) tar

27. Which command is used to display disk consumption of a specific directory
a) du
b) ds
c) dd
d) dds

28. Which command is used to perform backup in unix?
a) backup
b) cpio
c) zip
d) gzip

29. Which command creates an empty file if file does not exist?
a) cat
b) touch
c) ed
d) read

30. Which option of rm command is used to remove a directory with all its subdirectories
a) –b
b) –o
c) –p
d) –r

31. Which command is used to identify file type?
a) Type
b) File
c) Finfo
d) Info

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

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

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

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

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

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

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

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

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

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

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

43. Which of the following commands is expected to rename a file from ABC to file XYZ?
a) mv ABC XYZ
b) move ABC XYZ
c) cp ABC XYZ
d) rm ABC XYZ

44. Which of the following structures on the disk stores the attributes related to a file?
a) inode
b) Data block
c) Block in a file
d) Directory

45. How many links can get created for a new directory?
A)1
B. 2
C. 3
D. 4

46. Which of the following statements will stand false, if a user creates a link to a file using the command ?
A. Both the files have the same iNode number.
B. The number of links for file1 is 1.
C. The number of links for file1 is 2.
D. The number of links for file2 is 2.

47. What happens if we delete a file carrying two hard-links say h1 and h2 and one soft-link say sl?
A)We will be able to access the file with hl and h2 but not with sl.
B. We will not be able to access the file with hl and h2 but with sl.
C. We will be able to access the file with any of hl, h2 or sl.
D. We will not be able to access the file with any of hl, h2, and sl.

48. Which of the following inode structures have two files (belonging to the same partition) pointing to it?
A)Soft links
B. Hard links
C. Alias
D. Special files

49. Which of the following statements is true about the creation of hard links pointing across partitions?
A)Allowed only to root user.
B. Can be done by all users.
C. The effects are unspecified.
D. Not allowed.

50. Where are the printer devices rests in a Linux file system?
A)/etc
B. /dev
C. /lib
D. /printer

To Download Answers Click The Below Link
Linux Commands Answer Key

Monday, October 23, 2017

LINUX INTERVIEW QUESTIONS WITH ANSWERS


101 INTERVIEW QUESTIONS IN LINUX FOR FRESHERS


1.         What command is used to count the total number of lines, words, and characters contained in a file?

            A.countw
B.wcount
C.wc
D.count p
E.None of the above
Answer: Option C

2.         What command is used to remove files?

            A.dm
B.rm
C.delete
D.erase
E.None of the above
Answer: Option B

3.         What command is used to remove the directory?

            A.rdir
B.remove
C.rd
D.rmdir
E.None of the above
Answer: Option D

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

            A.x
B.y
C.a
D.z
E.None of the above
Answer: Option A

5.         What hardware architectures are not supported by Red Hat?

            A.SPARC
B.IBM-compatible
C.Alpha
D.Macintosh
E.None of the above
Answer: Option D

6.         The physical layer of a network

            A.constructs packets of data and sends them across the network
B.controls error detection and correction
C.defines the electrical characteristics of signals passed between the computer and communication devices
D.All of the above
E.None of the above
Answer: Option C

7.         What TCP/IP protocol is used for remote terminal connection service?

            A.UDP
B.RARP
C.FTP
D.TELNET
E.None of the above
Answer: Option D

8.         How many networks and nodes per network, are allowed by the Class B network?

            A.127 networks and 16,777,216 nodes per network
B.16,384 networks and 65,534 nodes per network
C.2,097,152 networks and 254 nodes per network
D.All of the above
E.None of the above
Answer: Option B

9.         What service is used to translate domain names to IP addresses?

            A.NFS
B.SMB
C.NIS
D.DNS
E.None of the above
Answer: Option D

10.       Which of the following command is used to create a Linux installation boot floppy?

            A.mkboot disk
B.bootfp disk
C.ww and rawwrite
D.dd and rawrite
E.None of the above
Answer: Option D

11.       How can you add Jiju, a new user, to your system?

            A.Using useradd
B.Using adduser
C.Using linuxconf
D.All of the above
E.None of the above
Answer: Option D

12.       What file specifies the order in which to use specified name services?

            A./etc/services
B./etc/nsorder
C./etc/nsswitch.conf
D./etc/hosts
E.None of the above
Answer: Option C

13.       How many primary partitions can exist on one drive?

            A.16
B.4
C.2
D.1
E.None of the above
Answer: Option B

14.       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
E.None of the above
Answer: Option C

15.       How could you install the file ipchains-1.3.9-5.i386.rpm?

            A.rpm -qip ipchains
B.rpm -Uvh ipchains
C.rpm -i ipchains* .i386.rpm
D.rpm -e ipchains-1.3.9-5.i386.rpm
E.None of the above
Answer: Option C

16.       What does FSF stand for?

            A.Free Software File
B.File Server First
C.First Serve First
D.Free Software Foundation
E.None of the above
Answer: Option D

17.       Which of the following is a valid format for mounting a CD-ROM drive?

            A.mount -t iso9660 /dev/cdrom / mnt/cdrom
B.mount /dev/cdrom
C.mount /mnt/cdrom
D.All of the above
E.None of the above
Answer: Option D

18.       What command do you use to create Linux file systems?

            A.fdisk
B.mkfs
C.fsck
D.mount
E.None of the above
Answer: Option B

19.       Which of the following command can you execute to count the number of lines in a file?

            A.lc
B.wc - l
C.cl
D.count
E.None of the above
Answer: Option B

20.       Which of the following is not a communication command?

            A.grep
B.mail
C.mesg
D.write
E.None of the above
Answer: Option A

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

            A.au
B.ps
C.du
D.pid
E.None of the above
Answer: Option B

22.       What command is not used to list the files chap01, chap02 and chap04?

            A.ls chap*
B.ls chap[124]
C.ls - x chap0[124]
D.ls chap0[124]
E.None of the above
Answer: Option B

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

            A.S
B.s
C.R
D.r
E.None of the above
Answer: Option C

24.       What sign is used to back up over typing errors in vi?

            A.!
B.$
C.#
D.@
E.None of the above
Answer: Option C

25.       What sign is used to erase or kill an entire line you have typed and start you are on a new line (but not display a new prompt)?

            A.!
B.$
C.#
D.@
E.None of the above
Answer: Option D

26.       What command is used to sort the lines of data in a file in alphabetical order?

            A.sort - r
B.st
C.sh
D.sort
E.None of the above
Answer: Option D

27.       What command is used with vi editor to save file and remain in the editing mode?

            A.x
B.q!
C.:w
D.:q
E.None of the above
Answer: Option C

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
E.None of the above
Answer: Option D

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

            A.??
B.//
C.?
D./
E.None of the above
Answer: Option D

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

            A.lpd
B.lpr
C.lpq
D.lpc
E.None of the above
Answer: Option B

31.       What protocol(s) is(are) allowed a user to retrieve her/his mail from the mail server to her/his mail reader?

            A.POP3
B.FTP
C.MAP
D.All of the above
E.None of the above
Answer: Option A

32.       What project is currently developing X server support?

            A.XFree86 Project, Inc.
B.RHAD Labs
C.GNOME Project
D.All of the above
E.None of the above
Answer: Option A

33.       What X-based tool is available for configuring the X Window system?

            A.XConfigurator
B.XF86Setup
C.xf86config
D.All of the above
E.None of the above
Answer: Option B

34.       Which of the following server is used with the BIND package?

            A.httpd
B.shttp
C.dns
D.named
E.None of the above
Answer: Option D

35.       What port does squid listen, by default?

            A.4322
B.2314
C.7334
D.3128
E.None of the above
Answer: Option D

36.       Which of the following is the main Apache configuration file?

            A./etc/apache.conf
B./etc/httpd/config.ini
C./etc/httpd/conf/httpd.conf
D./etc/srm.conf
E.None of the above
Answer: Option C

37.       Which of the following command is used to access an SMB share on a Linux system?

            A.NFS
B.SMD
C.smbclient
D.smbserver
E.None of the above
Answer: Option C

38.       Which of the following command is used to see the services running in NFS server?

            A.rpcinfo
B.serverinfo
C.NFSinfo
D.infserv
E.None of the above
Answer: Option A

39.       In which tcp_wrappers file can you specify to allow all connections from all hosts?

            A./etc/hosts.allow
B./etc/hosts.deny
C./etc/hosts
D./etc/tcp.conf
E.None of the above
Answer: Option A

40.       What does GNU stand for?

            A.GNU's not Unix
B.Greek Needed Unix
C.General Unix
D.General Noble Unix
E.None of the above
Answer: Option A

41.       What shell's wild-card is used to match any number of characters including none?

            A.*
B.?
C.[!ijk]
D.[ijk]
E.None of the above
Answer: Option A

42.       What command is used to list contents of directories?

            A.tar
B.dir
C.lp
D.ls
E.None of the above
Answer: Option D

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

            A.I
B.i
C.a
D.A
E.None of the above
Answer: Option D

44.       What command is used to copy directory structures in and out?

            A.copy
B.cp - p
C.cpio
D.cp
E.None of the above
Answer: Option C

45.       In OSI network architecture, the dialogue control and token management are responsible of

            A.data link layer
B.transport layer
C.network layer
D.session layer
E.None of the above
Answer: Option D

46.       Layer one of the OSI model is

            A.network layer
B.transport layer
C.link layer
D.physical layer
E.None of the above
Answer: Option D

47.       What layer of OSI determines the interface of the system with the user?

            A.Session
B.Data-link
C.Application
D.Network
E.None of the above
Answer: Option C

48.       What command is used to remove jobs from the print queue?

            A.lpq
B.lpr
C.lprm
D.lpc
E.None of the above
Answer: Option C

49.        Which of the following subdirectory(ies) contains the system boot scripts.

            A./dev
B./bin
C./etc
D./home
E.None of the above
Answer: Option C

50.       What of the following tool is used to check and repair Linux file systems?

            A.mkfs
B.fdisk
C.fsck
D.mount
E.None of the above
Answer: Option C

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

            A.mkfs
B.fdisk
C.fsck
D.mount
E.None of the above
Answer: Option B

52.       Where can system and mail logs be found in Ret Hat Linux?

            A./var/log
B./etc/log
C./mail
D.All of the above
E.None of the above
Answer: Option A

53.       What command is used to display and create files?

            A.lyrix
B.ed
C.vi
D.cat
E.None of the above
Answer: Option D

54.       Which of the following command can be used to rename a file in UNIX?

            A.ren
B.mv
C.remove
D.change
E.None of the above
Answer: Option B

55.       What command is used to remove a file?

            A.del
B.mv
C.rm
D.remove
E.None of the above
Answer: Option C

56.       What command is used to display the top of the file?

            A.grep
B.more
C.head
D.cat
E.None of the above
Answer: Option C

57.       What command can be used to get information about yourself?

            A.which
B.pwd
C.i /4
D.who am i
E.None of the above
Answer: Option D

58.       What layer protocol is responsible for user and the application programme support such as passwords, resource sharing, file transfer and network management?

            A.Layer 4 protocols
B.Layer 5 protocols
C.Layer 6 protocols
D.Layer 7 protocols
E.None of the above
Answer: Option D

59.       What package group will you select during the custom configuration to enable the machine to communicate with Windows clients?

            A.SMB (Samba) Connectivity
B.IPX/NetWare Connectivity
C.Dial-up Workstation
D.All of the above
E.None of the above
Answer: Option A

60.       Which of the following tool allows you to change your default X Window desktop?

            A.switchdesk
B.intrc
C.xinitre
D.Xchange
E.None of the above
Answer: Option A

61.       Which of the following is the main Apache configuration file?

            A.httpd.conf
B.apache.con
C./etc/profile
D.system.ini
E.None of the above
Answer: Option A

62.       What command is used to sort the lines of data in a file in reverse order?

            A.sort - r
B.st
C.sh
D.sort
E.None of the above
Answer: Option A

63.       What command is used to print a file?

            A.lp
B.pg
C.prn
D.print
E.None of the above
Answer: Option A

64.       The command chmod 761 letter is equivalent to

            A.chmod 4=7, g = 6, o = 1 letter
B.chmod a = 761 letter
C.chmod u = rwx, g = rw, o = x letter
D.chmod 167 letter
E.None of the above
Answer: Option C

65.       What command is used with vi editor to move forward to the end of a word?

            A.c
B.d
C.b
D.e
E.None of the above
Answer: Option D

66.       The IP address are based on

            A.16-bit addresses
B.32-bit addresses
C.64-bit addresses
D.8-bit addresses
E.None of the above
Answer: Option B

67.       What TCP/IP protocol is used for file transfer with minimal capability and minimal overhead?

            A.TELNET
B.TFTP
C.FTP
D.RARP
E.None of the above
Answer: Option B

68.       What TCP/IP protocol is used for transferring electronic mail messages from one machine to another?

            A.FTP
B.SNMP
C.SMTP
D.RPC
E.None of the above
Answer: Option C

69.       What command is used to halt a Linux system?

            A.init 0
B.Shutdown -t
C.Shutdown -g -y0
D.Ctrl+Alt+Del
E.None of the above
Answer: Option A

70.       Which daemon is used for the Apache server?

            A.apached
B.httpd
C.html
D.shttp
E.None of the above
Answer: Option B

71.       GNOME is based on

            A.CORBA toolkit
B.COM/DCOM toolkit
C.ORE toolkit
D.OLE DB toolkit
E.None of the above
Answer: Option A

72.       What can he used to set up a firewall on a Linux system?

            A.netstat
B.route
C.trace
D.ipchains
E.None of the above
Answer: Option D

73.       Which program is used to automatically install Red Mat Linux on identical hardware?

            A.bzimage.img
B.tar
C.ghost
D.mkkickstart
E.None of the above
Answer: Option D

74.       What service is not monitored by inetd ?

            A.SSH
B.time
C.ntalk
D.finger
E.None of the above
Answer: Option A

75.       Who founded the FSF?

            A.Linus Torvalds
B.Richard Stallman
C.Bob Young
D.All of the above
E.None of the above
Answer: Option B

76.       What shell's wild-card is used to match a single character?

            A.[!ijk]
B.[ijk]
C.?
D.*
E.None of the above
Answer: Option C

77.       What command is used to copy a file?

            A.tar
B.cpio
C.cp
D.copy
E.None of the above
Answer: Option C

78.       What command is used to display your current working directory?

            A.path
B.pwd
C.prompt $p$g
D.dir
E.None of the above
Answer: Option B

79.       What command is used with vi editor to move the cursor to the left?

            A.h
B.k
C.j
D.i
E.None of the above
Answer: Option A

80.       What command do you use to add routes to a Linux router?

            A.addroute
B.route
C.netstat
D.net
E.None of the above
Answer: Option B

81.       Which of the following command is used to mount NFS filesystems?

            A.nfsmount
B.knfsd
C.mount
D.All of the above
E.None of the above
Answer: Option C

82.       To build a modularized kernel, the kernel-headers and kernel-source packages must first be installed. Where will you find the kernel-headers and kernel-source?

            A./usr/local
B./usr/src/linux
C./usr/sre/redhat
D./usr/bin
E.None of the above
Answer: Option B

83.       After you have compiled your kernel, what do you have to edit to boot your new kernel image?

            A./boot/lilo.conf
B./etc/conf.modules
C./etc/named.boot
D./etc/lilo.conf
E.None of the above
Answer: Option D

84.       To create an installation boot floppy disk from Linux (or another Unix) machine, what command could you use?

            A.fdisk
B.fsck
C.dd
D.rawrite
E.None of the above
Answer: Option C

85.       You just added a new user, kara, to the system. What group is kara added to by default?

            A.root
B.kara
C.group
D.user
E.None of the above
Answer: Option B

86.       What are the appropriate Hex codes for setting Linux swap and Linux native partition types in fdisk?

            A.82 and 83
B.92 and 93
C.63 and 64
D.82 and 85
E.None of the above
Answer: Option A

87.       What command do you use to delete a file?

            A.rename
B.delete
C.rm
D.cp
E.None of the above
Answer: Option C

88.       Which of the following command lists the last 10 lines of a file?

            A.grep
B.tail
C.head
D.cat
E.None of the above
Answer: Option B

89.       What command is used to terminate a process?

            A.kill
B.cancel
C.haltsys
D.shutdown
E.None of the above
Answer: Option A

90.       What command is used with vi editor to delete three words?

            A.3$d
B.3 dw
C.3 x
D.3 dd
E.None of the above
Answer: Option B

91.       What command is used to assign only read permission to all three categories of the file'letter'?

            A.chmod u + r, g + r, o - x letter
B.chmod ugo = r letter
C.chmod a - rw letter
D.chmod go + r letter
E.None of the above
Answer: Option B

92.       What command is used with file named 'letter' to remove the executable permission from the user and assign read permission to the group and others?

            A.chmod go + x, u - x letter
B.chmod g - x, uo + r letter
C.chmod go + r, u + x letter
D.chmod u - x, go + r letter
E.None of the above
Answer: Option D

93.       What command is used to assign executable permission to the owner of the file named "letter"?

            A.chmod ugo + x letter
B.chmod u + x letter
C.chmod u + w letter
D.chmod g + x letter
E.None of the above
Answer: Option B

94.       What command is used to compare the files?

            A.ccp
B.du
C.cmp
D.comp
E.None of the above
Answer: Option C

95.       What command is used to summarize the disk usage?

            A.disk
B.du
C.fdisk
D.chkdsk
E.None of the above
Answer: Option B

96.       What command is used to list the jobs currently in print queues?

            A.lpq
B.lpr
C.lprm
D.lpc
E.None of the above
Answer: Option A

97.       Which of the following format of partition tables does Linux use?

            A.Linux
B.BSD
C.UnixWare
D.DOS
E.None of the above
Answer: Option D

98.       Which of the following NIS clients returns the name of the NIS server used by the NIS client?

            A.ypwhich
B.ypbind
C.ypcat
D.yppoll
E.None of the above
Answer: Option A

99. 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
E. None of the above
Answer: Option B

100. What hardware architectures are not supported by Red Hat?

            A. SPARC
            B. IBM-compatible
            C. Alpha
            D. Macintosh
E. None of the above
Answer: Option D

101. Which command is used to set terminal IO characteristic?

A. tty
            B. ctty
            C. ptty
            D. stty
E. None of the above
Answer: Option D