Linux Basic Questions

This set of Linux / Unix multiple choice questions and Answers focuses on various Linux commands and their command line options & parameters. It will be useful for anyone learning Linux Basics, Essentials and/or Fundamentals.

linx interview questions and answers

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

Answer: c

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 above

Answer: a

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

Answer: d

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

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

Answer: d

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

Answer: d

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

Answer: c

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

Answer: b

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

Answer: d

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

Answer: a

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

Answer: d

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

Answer: c

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

Answer: b

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

Answer: a

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

Answer: c

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

Answer: a

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

Answer: b

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

Answer: b

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

Answer: d

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

Answer: b

Enjoy it!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.