0% found this document useful (0 votes)
58 views6 pages

Unix Linux MCQ Set

The document contains a series of questions and answers related to Linux commands and their functions. It covers various commands for file management, system information, and user account management. Each question is followed by the correct answer, providing a quick reference for Linux command usage.

Uploaded by

anand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views6 pages

Unix Linux MCQ Set

The document contains a series of questions and answers related to Linux commands and their functions. It covers various commands for file management, system information, and user account management. Each question is followed by the correct answer, providing a quick reference for Linux command usage.

Uploaded by

anand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1. Which command is used to list all files including hidden ones?

a) ls -a
b) ls -l
c) ls -h
d) ls –r
Answer: A

2. Which command removes a file in Linux?


a) delete
b) rm
c) erase
d) clear
Answer: B

3. To view the contents of a file page by page:


a) less
b) read
c) view
d) cat
Answer: A

6. Which command is used to count lines, words, and characters in a file?


a) count
b) wc
c) lines
d) cat –n
Answer: B

7. In Linux, chmod 755 [Link] means:


a) Read/write only
b) Read/write/execute for owner, read/execute for others
c) No permission for others
d) Execute only
Answer: B

8. Which command is used to change ownership of a file?


a) change
b) chown
c) chmod
d) owner
Answer: B

9. To check running processes:


a) top
b) run
c) listproc
d) status
Answer: A

10. Which command is used to display the first 10 lines of a file?


a) head
b) start
c) begin
d) cat –n
Answer: A

11. To search for a pattern in a file:


a) find
b) grep
c) search
d) scan
Answer: B

12. Which command is used to move files?


a) mv
b) move
c) transfer
d) shift
Answer: A

13. df -h command shows:


a) Disk usage
b) CPU usage
c) Memory usage
d) File count
Answer: A

14. To see memory usage in Linux:


a) free -m
b) mem
c) memory -s
d) sysmem
Answer: A

15. Which command is used to compress files in Linux?


a) compress
b) tar/gzip
c) zipfile
d) zf
Answer: B

16. whoami displays:


a) Current username
b) Current group
c) Current directory
d) Hostname
Answer: A

17. To display the system’s date and time:


a) date
b) time
c) clock
d) sysdate
Answer: A

18. To shut down a Linux system immediately:


a) poweroff
b) exit
c) close
d) off
Answer: A

19. Which command is used to rename a file?


a) rename
b) mv
c) rn
d) setname
Answer: B

20. Which command shows the manual of a Linux command?


a) help
b) man
c) info
d) doc
Answer: B

21. Which command finds files by name?


a) search
b) find
c) locate
d) grep
Answer: B

22. Which command lists active network connections?


a) netstat
b) netconfig
c) ifconfig
d) ping
Answer: A
23. Which command displays IP address in Ubuntu?
a) ifconfig
b) ipshow
c) netshow
d) configip
Answer: A

24. Which command is used to remove a directory in Linux?


a) rmdir
b) deldir
c) rm -dir
d) deletedir
Answer: A

25. uname -a displays:


a) System information
b) Username
c) Hostname
d) Process list
Answer: A

26. Which command is used to concatenate and display files?


a) cat
b) join
c) merge
d) paste
Answer: A

27. Which Linux distribution is most popular for desktops?


A) CentOS
B) Ubuntu
C) Fedora
D) Arch
Answer: B

28. What is the default shell in most Linux distributions?


A) sh
B) bash
C) zsh
D) fish
Answer: B

29. What does the 'sudo' command do?


A) Deletes files
B) Opens editor
C) Runs command as superuser
D) Restarts the system
Answer: C

30. Which file contains user account information in Linux?


A) /etc/group
B) /etc/passwd
C) /etc/shadow
D) /etc/profile
Answer: B

31. Which of the following is a package manager for Ubuntu?


A) rpm
B) yum
C) apt
D) dnf
Answer: C

32. Which command is used to list all files and directories in Linux?
A) ls
B) dir
C) list
D) show
Answer: A

33. Which command is used to change the current directory in Linux?


A) chdir
B) cd
C) move
D) mv
Answer: B

34. What does the 'pwd' command do in Unix?


A) Prints password
B) Prints working directory
C) Prints write data
D) None
Answer: B

35. Which command is used to display the contents of a file in Unix?


A) read
B) open
C) cat
D) echo
Answer: C

36. What is the purpose of the 'mkdir' command?


A) To make a new file
B) To make a new directory
C) To delete directory
D) To rename directory
Answer: B

You might also like