0% found this document useful (0 votes)
56 views8 pages

UNIX Module 2 MCQ QUESTION

The document provides a list of 50 questions about Unix/Linux commands and concepts. It covers topics like the file system, directories, permissions, users/groups, compression/archiving, searching, and more. The questions are multiple choice to test one's knowledge of Unix/Linux systems administration.

Uploaded by

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

UNIX Module 2 MCQ QUESTION

The document provides a list of 50 questions about Unix/Linux commands and concepts. It covers topics like the file system, directories, permissions, users/groups, compression/archiving, searching, and more. The questions are multiple choice to test one's knowledge of Unix/Linux systems administration.

Uploaded by

Mahesh A.V
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

UNIX SHELL PROGRAMMING

MODULE – 2
1. What is the primary purpose of the Unix file system?
a) Data storage
b) User authentication
c) Graphics rendering
d) Network communication

2. Which command is used to create a new directory in Unix?


A) create
B) mkdir
C) newdir
D) Touchdir

3. In Unix, what is the root directory denoted by?


a. /
b. .
c. ~
d. *

4. Which command is used to list the contents of a directory in Unix?


A) ls
B) dir
C) list
D) show

5. The "chmod" command is used for what purpose in Unix?


A) Changing the computer mode
B) Changing file permissions
C) Changing the file's owner
D) Changing the file's name

6. Which permission set in Unix allows a user to read a file?


A) r
B) w
C) x
D) Rw
7. The "chown" command in Unix is used for what purpose?
A) Changing the owner of a file
B) Changing the group of a file
C) Changing the file's permissions
D) Changing the file's location

8. What is the maximum number of characters allowed in a Unix filename?


A) 32
B) 64
C) 128
D) Unlimited

9. Which command is used to copy files or directories in Unix?


A) cp
B) mv
C) copy
D) duplicate

10. In Unix, which character represents the home directory of the current user?
A) /
B) .
C) ~
D) *

11. The "rm" command is used in Unix to:


A) Rename a file
B) Remove a file
C) Move a file
D) Make a file

12. Which command is used to navigate to the parent directory in Unix?


A) cd ..
B) cd /
C) cd ~
D) cd .

13. Is the "ln" command in Unix used for what purpose?


A) Listing files
B) Creating symbolic links
C) Changing file permissions
D) Moving files
14. What is the purpose of the "df" command in Unix?
A) Displaying file contents
B) Deleting files
C) Displaying free disk space
D) Moving files between directories

15. In Unix, what is the purpose of the "du" command?


A) Displaying disk usage of files
B) Displaying directory structure
C) Displaying system uptime
D) Displaying available disk space

16. Which command is used to change the current user's password in Unix?
A) passwd
B) password
C) pwd
D) pswd

17. The "touch" command in Unix is used to:


A) Move a file
B) Delete a file
C) Create an empty file
D) Rename a file

18. In Unix, which permission set allows a user to execute a file?


A) r
B) w
C) x
D) rx

19. What is the purpose of the "find" command in Unix?


a) Finding files and directories
b) Deleting files
c) Copying files
d) Displaying system information

20. Which command is used to remove an empty directory in Unix?


A) del
B) rm
C) remove
D) rmdir
21. In Unix, what does the "umask" value determine?
A) User's login shell
B) User's default directory
C) Permissions of newly created files and directories
D) User's password

22. Which command is used to display the last lines of a file in Unix?
A) head
B) display
C) read
D) tail

23. What is the purpose of the "grep" command in Unix?


A) Copying files
B) Deleting files
C) Searching for patterns in files
D) Moving files

24. In Unix, how do you give execute permission to all users on a file?
A) chmod u+x file.txt
B) chmod g+x file.txt
C) chmod o+x file.txt
D) chmod a+x file.txt

25. Which command is used to change the group ownership of a file in Unix?
a) chgrp
b) chown
c) groupchown
d) owngrp

26. What does the "mv" command do in Unix?


A) Move a file or directory
B) Copy a file or directory
C) Rename a file or directory
D) Create a new file

27. Which command is used to display the manual pages in Unix?


A) man
B) help
C) Manual
D) Page
28. In Unix, which command is used to create a symbolic link?
A) Smlink
B) ln –s
C) Link
D) Symlink

29. What is the purpose of the "cd" command in Unix?


A) Copying files
B) Moving files
C) Changing the current directory
D) Displaying file contents

30. Which file contains a user's personalized environment settings in Unix?


A) .env
B) .bashrc
C) .profile
D) .config

31. In Unix, what is the purpose of the "tar" command?


A) List the contents of a directory
B) Move files to another location
C) Create a new directory
D) Extract files from a compressed archive

32. Which command is used to remove a file in Unix?


A) rm
B) del
C) erase
D) remove

33. What is the purpose of the "chmod 755" command in Unix?


A) Give read, write, and execute permission to the owner, and read and execute
permission to others
B) Give full permission to everyone
C) Give read and write permission to the owner, and read permission to others
D) Remove all permissions

34. In Unix, which command is used to compress files?


A) unzip
B) pack
C) gzip
D) compress
35. What is the purpose of the "cat" command in Unix?
A) Display the contents of a file
B) Concatenate multiple files
C) Compress files
D) Copy files

36. In Unix, what is the purpose of the "ln" command without the "-s" option?
A) Create a hard link
B) Create a symbolic link
C) List files in a directory
D) Remove a file

37. Which command is used to change the ownership of a file and its group in Unix?
A) chown
B) chgrp
C) chmod
D) ownchown

38. In Unix, what is the purpose of the "echo" command?


A) Display the contents of a file
B) Create a new file
C) Print a message to the terminal
D) Delete a file

39. What is the purpose of the "head" command in Unix?


A) Display the first lines of a file
B) Display the last lines of a file
C) Create a new file
D) Move a file

40. Which command is used to display the current working directory in Unix?
A) pwd
B) dir
C) cd
D) ls

41. In Unix, what is the purpose of the "mv" command with the "-i" option?
A) Move files and ask for confirmation before overwriting
B) Move files and overwrite without asking for confirmation
C) Move files and preserve timestamps
D) Move files and make them hidden
42. Which command is used to display the permissions of a file in Unix?
A) chmod
B) chown
C) ls
D) perm

43. In Unix, what is the purpose of the "passwd" command?


A) Change the file's password
B) Change the permissions of a file
C) Change the user's password
D) Change the group's password

44. What is the purpose of the "sort" command in Unix?


A) Display sorted file contents
B) Search for files
C) Copy files
D) Rename files

45. In Unix, which command is used to display the environment variables?


A) env
B) variables
C) showenv
D) printenv

46. Which command is used to search for a specific string within files in Unix?
A) find
B) Grep
C) locate
D) Search

47. In Unix, what does the "umask" value 022 mean?


A) Full permissions for owner, no permissions for group and others
B) No permissions for owner, full permissions for group and others
C) Read and execute permissions for owner, no permissions for group and others
D) Read and write permissions for owner, read permissions for group and others

48. What is the purpose of the "wc" command in Unix?


A) Move files
B) Display the contents of a file
C) Copy files
D) Count the number of words in a file
49. In Unix, what is the purpose of the "mkdir -p" command?
A) Move a directory
B) Create a new directory
C) Create parent directories if they don't exist
D) Delete a directory

50. Which command is used to rename a file or directory in Unix?


A) rename
B) mv
C) rn
D) move

You might also like