Operating Systems Concepts Practice Exam Quiz

Get solved practice exam answers for your midterm and final examinations

Operating Systems Concepts Practice Exam Quiz

 

Which of the following best describes an open-source operating system?

Proprietary software with restricted access to source code.
B. Software where the source code is freely available and can be modified.
C. Software used only by specific organizations.
D. Operating systems that exclusively use graphical interfaces.
Answer: B

What is the main purpose of a shell in an operating system?

To manage the file system.
B. To provide a user interface for interacting with the operating system.
C. To schedule processes and manage CPU time.
D. To handle memory allocation for applications.
Answer: B

Which UNIX command is used to list the contents of a directory?

ls
B. cd
C. pwd
D. mkdir
Answer: A

The man command in UNIX is used to:

Display a list of files in the current directory.
B. Provide manual pages for commands.
C. Modify system permissions.
D. Exit the operating system.
Answer: B

What does the term “kernel” refer to in an operating system?

A type of graphical user interface.
B. The central component that manages system resources and hardware.
C. A utility for managing files.
D. The part of the OS responsible for user authentication.
Answer: B

In UNIX, what does the cd command do?

Change file permissions.
B. Display the contents of a file.
C. Change the current directory.
D. Create a new directory.
Answer: C

Which of the following is NOT a type of shell?

Bash
B. Korn
C. C shell
D. TOS
Answer: D

What does the chmod command do?

Changes the name of a file.
B. Modifies file permissions.
C. Deletes files.
D. Moves files to a new directory.
Answer: B

What is the role of a file system in an operating system?

To manage hardware components.
B. To organize and store data on storage devices.
C. To compile source code into executable programs.
D. To manage user sessions.
Answer: B

Which editor is commonly used in UNIX environments?

MS Word
B. Vim
C. Notepad
D. Sublime Text
Answer: B

What is the significance of the pwd command in UNIX?

It prints the working directory.
B. It powers down the system.
C. It prints the file permissions.
D. It opens the password file.
Answer: A

Which of the following is a graphical user interface for Linux?

Bash
B. GNOME
C. Vim
D. SSH
Answer: B

What does the mkdir command do?

Deletes a directory.
B. Creates a new directory.
C. Lists files in a directory.
D. Moves files between directories.
Answer: B

The rm command is used to:

Rename files.
B. Remove files.
C. Retrieve lost files.
D. Reorganize directory structure.
Answer: B

What is the purpose of manual pages in UNIX?

To provide tutorials for advanced programming.
B. To document system calls and utilities.
C. To log user activities.
D. To monitor system performance.
Answer: B

Which command is used to display the first few lines of a file in UNIX?

tail
B. head
C. cat
D. more
Answer: B

What does the ps command display?

Current file permissions.
B. Processes running on the system.
C. Disk usage statistics.
D. Available system memory.
Answer: B

The grep command in UNIX is used for:

Searching text patterns in files.
B. Editing files interactively.
C. Displaying disk usage.
D. Listing active network connections.
Answer: A

Which of the following file permissions allows only the owner to read and write a file?

755
B. 644
C. 600
D. 777
Answer: C

What does tar stand for in UNIX?

Text Archive Resource
B. Tape Archive
C. Temporary Archive
D. Terminal Access Resource
Answer: B

Which command displays a real-time view of running processes?

ls
B. top
C. df
D. kill
Answer: B

What does the df command show?

Disk usage of a file.
B. Free and used space on file systems.
C. Detailed information about a directory.
D. File permissions of a directory.
Answer: B

Which shell is the default in most Linux distributions?

C shell
B. Korn shell
C. Bash shell
D. Z shell
Answer: C

What is a “process” in the context of operating systems?

A user’s interaction with the OS.
B. A running instance of a program.
C. A set of commands executed in a shell.
D. A method to organize files.
Answer: B

The echo command is used to:

Display a string of text in the terminal.
B. Write data to a file.
C. Redirect input from a file.
D. Monitor system logs.
Answer: A

What is the purpose of the kill command?

Restart the system.
B. Terminate a process.
C. Log out a user.
D. Update the kernel.
Answer: B

What is the vi command used for?

Viewing log files.
B. Editing text files.
C. Installing software.
D. Deleting files.
Answer: B

In UNIX, the touch command is used to:

Create an empty file.
B. Display file permissions.
C. Modify file ownership.
D. Open an editor.
Answer: A

The sudo command allows a user to:

Edit text files.
B. Execute commands with administrative privileges.
C. Transfer files between directories.
D. Create new user accounts.
Answer: B

Which of the following is a feature of UNIX-derived operating systems?

Closed-source codebase.
B. Limited multitasking capabilities.
C. Hierarchical file system.
D. Single-user environment only.
Answer: C

 

What is the primary advantage of using an open-source operating system?

It is fully controlled by a single company.
B. Users have no access to modify its source code.
C. It allows anyone to inspect, modify, and improve the code.
D. It supports only proprietary hardware.
Answer: C

Which of the following commands displays the contents of a file in UNIX?

cat
B. ls
C. cd
D. chmod
Answer: A

In a UNIX-based file system, the root directory is represented as:

/root
B. /home
C. /
D. root/
Answer: C

What is the difference between more and less commands in UNIX?

less can scroll both forward and backward, while more can only scroll forward.
B. more is faster than less.
C. less deletes files, while more displays files.
D. They perform the same function.
Answer: A

What does the who command do in UNIX?

Lists all users currently logged into the system.
B. Displays the history of executed commands.
C. Shows the current working directory.
D. Updates the system kernel.
Answer: A

Which of the following commands is used to terminate a user session in UNIX?

exit
B. logout
C. kill
D. Both A and B
Answer: D

What is the default permission for a new file created in UNIX?

644
B. 755
C. 777
D. 600
Answer: A

What does the uname command do in UNIX?

Prints the system name and details.
B. Updates the system kernel.
C. Displays the current user.
D. Lists files in the home directory.
Answer: A

What is the purpose of the scp command in UNIX?

To copy files securely between systems.
B. To change file permissions.
C. To display the contents of a file.
D. To manage system processes.
Answer: A

Which command shows the full path of a given command in UNIX?

which
B. pwd
C. man
D. echo
Answer: A

What is the main purpose of the crontab utility in UNIX?

To schedule and automate tasks.
B. To monitor disk usage.
C. To update the system.
D. To install software packages.
Answer: A

In UNIX, how would you redirect both standard output and standard error to the same file?

command > file 2>&1
B. command >> file
C. command 1> file 2> file
D. command < file > file
Answer: A

Which process ID (PID) is assigned to the init process in UNIX?

0
B. 1
C. 100
D. Varies based on the system.
Answer: B

What is the role of a pipe (|) in UNIX?

To execute a program in the background.
B. To connect the output of one command to the input of another.
C. To copy files between directories.
D. To filter text in a file.
Answer: B

Which UNIX command is used to compress files?

gzip
B. tar
C. zip
D. Both A and C
Answer: D

What is the default shell in UNIX systems?

Bash
B. Zsh
C. Korn
D. Fish
Answer: A

In UNIX, what does the du command do?

Checks disk usage by files and directories.
B. Displays the current user.
C. Updates system packages.
D. Manages file permissions.
Answer: A

What is the purpose of the alias command in UNIX?

To create shortcuts for commands.
B. To change file permissions.
C. To copy files securely.
D. To terminate processes.
Answer: A

Which of the following commands shows the number of lines, words, and characters in a file?

wc
B. awk
C. sed
D. cut
Answer: A

What is a symbolic link in UNIX?

A pointer to a file or directory.
B. A command that combines files.
C. A permission type for users.
D. A tool for editing files.
Answer: A

 

What is the purpose of the ps command in UNIX?

To display process information.
B. To show system uptime.
C. To delete a running process.
D. To print system logs.
Answer: A

Which command in UNIX is used to search for a specific pattern in a file?

grep
B. find
C. locate
D. awk
Answer: A

What does the chmod command modify in UNIX?

File permissions.
B. File ownership.
C. File size.
D. File content.
Answer: A

Which file in UNIX contains information about user accounts?

/etc/passwd
B. /etc/shadow
C. /var/log/user.log
D. /usr/bin/userdata
Answer: A

What does the df command display in UNIX?

Disk space usage of file systems.
B. CPU utilization.
C. File size in a directory.
D. Number of open files.
Answer: A

What is the function of the kill command in UNIX?

To terminate a running process.
B. To start a background process.
C. To display active processes.
D. To change process priorities.
Answer: A

What does the shebang (#!) at the beginning of a script file indicate?

It specifies the interpreter to execute the script.
B. It comments out the rest of the script.
C. It disables the script execution.
D. It displays the current shell version.
Answer: A

Which of the following commands is used to display the manual pages for a command in UNIX?

man
B. help
C. info
D. doc
Answer: A

In UNIX, what does the mv command do?

Moves or renames files and directories.
B. Copies files and directories.
C. Deletes files and directories.
D. Displays file metadata.
Answer: A

What does the top command display in UNIX?

Real-time information about system processes.
B. Current users logged into the system.
C. Disk usage statistics.
D. Recent login attempts.
Answer: A

Which command is used to display the system’s kernel version in UNIX?

uname -r
B. uname -s
C. kernel -v
D. sysinfo -k
Answer: A

What does the touch command do in UNIX?

Creates an empty file or updates the timestamp of an existing file.
B. Displays file content.
C. Deletes a file.
D. Changes file permissions.
Answer: A

What is the purpose of the ssh command in UNIX?

To securely connect to a remote server.
B. To schedule tasks.
C. To display the shell history.
D. To compress files.
Answer: A

Which command is used to extract files from a .tar archive?

tar -xvf
B. tar -cvf
C. tar -avf
D. tar -mvf
Answer: A

What is the default location for user home directories in UNIX?

/home/
B. /usr/
C. /var/
D. /etc/
Answer: A

What is the purpose of the export command in UNIX?

To set environment variables for child processes.
B. To remove environment variables.
C. To display system processes.
D. To transfer files between systems.
Answer: A

Which command in UNIX is used to view the running kernel’s log messages?

dmesg
B. syslog
C. kernelmsg
D. logview
Answer: A

What does the head command do in UNIX?

Displays the first few lines of a file.
B. Displays the last few lines of a file.
C. Deletes the first line of a file.
D. Copies the first line of a file.
Answer: A

In UNIX, what does the alias command allow users to do?

Create a shortcut for a frequently used command.
B. Run processes in the background.
C. Connect to a remote server.
D. Monitor file system usage.
Answer: A

What does the pwd command display in UNIX?

The current working directory.
B. The parent directory of a file.
C. The process ID of the current shell.
D. The permissions of a directory.
Answer: A

 

What does the who command do in UNIX?

Displays the users currently logged into the system.
B. Shows the last login details of users.
C. Displays user permissions.
D. Deletes a user account.
Answer: A

Which command in UNIX is used to compress files?

gzip
B. zip
C. compress
D. tar
Answer: A

What is the function of the crontab command in UNIX?

Schedules recurring tasks.
B. Starts and stops services.
C. Deletes temporary files.
D. Displays CPU usage.
Answer: A

Which command lists the contents of a directory, including hidden files in UNIX?

ls -a
B. ls -l
C. ls -h
D. ls -r
Answer: A

What is the purpose of the nohup command in UNIX?

Runs a command immune to hangups (continues after logout).
B. Lists all background jobs.
C. Displays network configuration.
D. Displays user processes.
Answer: A

What does the ln command do in UNIX?

Creates links to files or directories.
B. Deletes files or directories.
C. Displays file information.
D. Renames files or directories.
Answer: A

Which file contains information about mounted file systems in UNIX?

/etc/mtab
B. /etc/fstab
C. /etc/mounts
D. /var/log/mounts
Answer: A

What does the uname -a command display?

All system information, including kernel and architecture details.
B. Only the kernel version.
C. System uptime.
D. Hardware configuration.
Answer: A

Which command is used to show the full path of a command in UNIX?

which
B. find
C. locate
D. path
Answer: A

In UNIX, what does the /etc/hosts file contain?

Hostname to IP address mappings.
B. System process details.
C. Network connection logs.
D. User login history.
Answer: A

What does the fg command do in UNIX?

Brings a background process to the foreground.
B. Stops a foreground process.
C. Lists background jobs.
D. Kills a running process.
Answer: A

Which UNIX command is used to extract compressed .gz files?

gunzip
B. gzip
C. unzip
D. tar
Answer: A

What does the mount command do in UNIX?

Attaches a file system to the directory tree.
B. Displays disk usage information.
C. Creates new directories.
D. Deletes partitions.
Answer: A

What is the role of the scp command in UNIX?

Securely copies files between systems.
B. Displays shell configuration profiles.
C. Encrypts a file for transfer.
D. Shows CPU statistics.
Answer: A

Which command in UNIX displays the amount of free and used memory?

free
B. top
C. vmstat
D. meminfo
Answer: A

In UNIX, what is the default signal sent by the kill command?

SIGTERM (15)
B. SIGHUP (1)
C. SIGKILL (9)
D. SIGSTOP (19)
Answer: A

What does the echo command do in UNIX?

Displays text or variables to the terminal.
B. Executes a program.
C. Displays environment variables.
D. Displays shell history.
Answer: A

Which shell is the default on most Linux distributions?

Bash
B. Zsh
C. Fish
D. Csh
Answer: A

What does the tail -f command do in UNIX?

Displays real-time updates to the end of a file.
B. Displays the first lines of a file.
C. Finds a specific pattern in a file.
D. Copies the contents of a file.
Answer: A

What does the uptime command display in UNIX?

How long the system has been running.
B. The number of users logged in.
C. The load average.
D. All of the above.
Answer: D

 

What is the function of the ps command in UNIX?

Displays information about active processes.
B. Shows the disk usage statistics.
C. Terminates a process by ID.
D. Lists installed software.
Answer: A

Which command in UNIX displays the manual page for a given command?

man
B. help
C. info
D. doc
Answer: A

What does the chmod 755 command do in UNIX?

Sets read, write, and execute permissions for the owner, and read/execute for others.
B. Sets read and write permissions for all users.
C. Sets read and execute permissions for the owner only.
D. Removes all permissions from the file.
Answer: A

Which of the following commands is used to delete a directory in UNIX?

rmdir
B. rm -d
C. delete
D. del
Answer: A

In UNIX, what is the purpose of the /var/log directory?

Stores system log files.
B. Contains executable files.
C. Stores user configuration files.
D. Contains temporary files.
Answer: A

What does the pwd command display?

The current working directory.
B. The parent directory of the current folder.
C. A list of all directories in the system.
D. The default user directory.
Answer: A

Which command in UNIX is used to terminate a user session?

logout
B. exit
C. shutdown
D. Both A and B.
Answer: D

What is the purpose of the alias command in UNIX?

Creates a shortcut for commands.
B. Sets environmental variables.
C. Creates symbolic links.
D. Displays user profiles.
Answer: A

What does the df command in UNIX show?

Disk space usage.
B. CPU utilization.
C. Memory usage.
D. Network activity.
Answer: A

Which UNIX command is used to display the first 10 lines of a file by default?

head
B. tail
C. cat
D. less
Answer: A

Which of the following commands is used to count the number of words in a file?

wc
B. count
C. grep
D. awk
Answer: A

What does the ping command do in UNIX?

Checks the connectivity to another network host.
B. Displays the routing table.
C. Monitors network traffic.
D. Displays IP address configuration.
Answer: A

What does the grep command do in UNIX?

Searches for a pattern within files.
B. Displays file system usage.
C. Sorts the contents of a file.
D. Displays hidden files.
Answer: A

What is the default shell in most UNIX-based systems?

Bash
B. Zsh
C. Ksh
D. Tcsh
Answer: A

Which command is used to remove a file forcefully in UNIX?

rm -f
B. del
C. rmdir
D. erase
Answer: A

In UNIX, what does the history command display?

A list of previously executed commands.
B. A summary of system logs.
C. User login history.
D. A record of file modifications.
Answer: A

What is the function of the du command in UNIX?

Displays the disk usage of files and directories.
B. Deletes unused files.
C. Updates system configurations.
D. Displays user permissions.
Answer: A

Which command in UNIX is used to display the process ID of the last background job?

jobs
B. !
C. bg
D. !$
Answer: B

What does the export command do in UNIX?

Sets environment variables to be available to child processes.
B. Shares files with other systems.
C. Displays shell variables.
D. Exports log files.
Answer: A

What is the purpose of the /bin directory in UNIX?

Stores essential system binaries and commands.
B. Stores user-generated data.
C. Stores temporary files.
D. Contains hardware configuration files.
Answer: A

 

Which UNIX command is used to display the contents of a text file, one screen at a time?

less
B. more
C. cat
D. Both A and B
Answer: D

What is the purpose of the touch command in UNIX?

To create an empty file or update the timestamp of an existing file.
B. To delete a file.
C. To modify file permissions.
D. To display file contents.
Answer: A

Which command is used to change a user’s password in UNIX?

passwd
B. chpasswd
C. pwdchange
D. changepass
Answer: A

In UNIX, what does the umask command control?

Default file permissions for newly created files and directories.
B. The display format of files.
C. User access to certain system resources.
D. System-wide environment variables.
Answer: A

What is the purpose of the /etc/passwd file in UNIX?

Stores information about user accounts.
B. Contains user passwords in plaintext.
C. Logs system activities.
D. Manages user groups.
Answer: A

Which command is used to schedule a job to run at a specific time in UNIX?

at
B. cron
C. schedule
D. task
Answer: A

What does the kill command do in UNIX?

Terminates a process by its process ID.
B. Removes a file or directory.
C. Stops all active network connections.
D. Restarts the operating system.
Answer: A

What does the tail -f command do in UNIX?

Displays the last lines of a file and continuously monitors it for updates.
B. Deletes the last few lines of a file.
C. Appends text to the end of a file.
D. Copies the last lines of a file to another file.
Answer: A

What is the purpose of the env command in UNIX?

Displays the current environment variables.
B. Creates new user profiles.
C. Modifies system files.
D. Installs new software.
Answer: A

Which of the following commands can be used to display running processes in UNIX?

top
B. htop
C. ps
D. All of the above
Answer: D

What does the ln -s command do in UNIX?

Creates a symbolic link to a file or directory.
B. Moves a file to a different location.
C. Displays a file’s properties.
D. Lists all symbolic links in a directory.
Answer: A

Which command in UNIX is used to check the amount of free disk space?

df
B. du
C. free
D. diskcheck
Answer: A

What is the purpose of the sudo command in UNIX?

Allows a user to execute commands with superuser privileges.
B. Switches to a different user account.
C. Suspends active processes.
D. Displays system updates.
Answer: A

What does the awk command do in UNIX?

Processes and analyzes text files based on patterns.
B. Deletes files in bulk.
C. Displays system logs.
D. Compiles source code.
Answer: A

Which file contains information about system services in UNIX?

/etc/services
B. /etc/passwd
C. /var/log/services
D. /etc/system
Answer: A

Which command can be used to find the path of an executable file in UNIX?

which
B. whereis
C. locate
D. All of the above
Answer: D

What does the hostname command display in UNIX?

The name of the machine on the network.
B. The current user’s username.
C. The primary domain name server.
D. The IP address of the machine.
Answer: A

Which command in UNIX shows the detailed contents of a directory, including file permissions, ownership, and size?

ls -l
B. dir -l
C. ls -a
D. showfiles
Answer: A

What is the function of the uniq command in UNIX?

Filters out or reports duplicate lines in a file.
B. Deletes all duplicate files in a directory.
C. Finds unique files on the system.
D. Creates unique file names.
Answer: A

What is the primary role of the shell in a UNIX operating system?

Acts as an interface between the user and the kernel.
B. Manages hardware resources.
C. Handles file systems and directories.
D. Provides network security.
Answer: A

 

What is the function of the top command in UNIX?

Displays the most recently accessed files.
B. Displays the processes currently running on the system.
C. Displays disk usage statistics.
D. Displays the most recent system errors.
Answer: B

What is a symbolic link in UNIX?

A link to a file or directory that points to another file or directory.
B. A backup copy of a file.
C. A compressed version of a file.
D. A process running in the background.
Answer: A

Which of the following commands will show all the currently logged-in users in UNIX?

who
B. users
C. whoami
D. id
Answer: A

Which of the following is true about the UNIX kernel?

It is the part of the system responsible for managing hardware and system resources.
B. It is only responsible for running user programs.
C. It provides graphical user interface support.
D. It is the part of the system where files are stored.
Answer: A

What is the purpose of the grep command in UNIX?

It is used to filter and display lines in files that match a given pattern.
B. It lists all available commands in UNIX.
C. It shows the disk usage statistics for files.
D. It displays the content of a file.
Answer: A

What does the cp command do in UNIX?

Copies files or directories.
B. Compresses files.
C. Changes the file permissions.
D. Creates symbolic links.
Answer: A

What is the function of the chmod command in UNIX?

Changes the permissions of a file or directory.
B. Changes the ownership of a file or directory.
C. Changes the name of a file or directory.
D. Changes the content of a file.
Answer: A

What does the df -h command display in UNIX?

The disk space usage in human-readable format.
B. The list of active processes.
C. The file contents of a directory.
D. The running processes’ memory usage.
Answer: A

What is the purpose of the chmod 777 command in UNIX?

Gives full read, write, and execute permissions to the owner, group, and others.
B. Restricts access to the file for all users.
C. Grants read-only permission to the owner.
D. Changes the file’s name.
Answer: A

Which of the following UNIX commands is used to search for files in the filesystem?

find
B. locate
C. search
D. Both A and B
Answer: D

Which command in UNIX is used to change the owner of a file?

chown
B. chgrp
C. chmod
D. chperm
Answer: A

In UNIX, what is the default file permission for a newly created file?

666
B. 777
C. 644
D. 444
Answer: C

Which of the following commands is used to display a file’s contents in reverse order?

tac
B. rev
C. cat
D. tail
Answer: A

What is the purpose of the tar command in UNIX?

To create or extract compressed archive files.
B. To delete files.
C. To rename files.
D. To manage users and groups.
Answer: A

Which command is used to display information about the operating system in UNIX?

uname
B. info
C. osinfo
D. version
Answer: A

What does the cat command do in UNIX?

Concatenates and displays the contents of one or more files.
B. Changes file permissions.
C. Creates new directories.
D. Deletes files.
Answer: A

Which command is used to display system resource usage such as CPU and memory in UNIX?

top
B. ps
C. free
D. uptime
Answer: A

What is the purpose of the echo command in UNIX?

Displays a message or the value of a variable.
B. Deletes files.
C. Changes file permissions.
D. Lists files in a directory.
Answer: A

What does the ls -a command do in UNIX?

Lists all files, including hidden files, in the current directory.
B. Lists only directories in the current directory.
C. Lists files in ascending order.
D. Lists files in alphabetical order.
Answer: A

What is the purpose of the /etc/fstab file in UNIX?

Contains information about disk drives and partitions.
B. Stores user account information.
C. Contains system log files.
D. Stores shell commands for startup.
Answer: A

 

Which command is used to display the manual page for a command in UNIX?

man
B. help
C. info
D. guide
Answer: A

What does the ps aux command display in UNIX?

A list of all processes running on the system, with details.
B. A list of user accounts.
C. The disk space usage of processes.
D. The available memory in the system.
Answer: A

Which of the following commands is used to compare two files in UNIX?

cmp
B. diff
C. compare
D. match
Answer: B

What does the chmod 755 command do in UNIX?

Grants read, write, and execute permissions to the owner and read and execute permissions to the group and others.
B. Grants full read, write, and execute permissions to all users.
C. Grants read and write permissions to the owner only.
D. Grants read and execute permissions to the owner and group.
Answer: A

Which of the following is the correct location for temporary files in UNIX?

/tmp
B. /var/tmp
C. /etc/tmp
D. /home/tmp
Answer: A

Which command is used to display the last part of a file in UNIX?

head
B. tail
C. cut
D. last
Answer: B

What does the df command do in UNIX?

Displays disk space usage.
B. Displays free memory space.
C. Displays file permissions.
D. Displays the directory tree structure.
Answer: A

What is the primary function of the init process in UNIX?

It is the first process started during boot and manages other system processes.
B. It handles user authentication.
C. It controls the network interfaces.
D. It is responsible for file management.
Answer: A

What does the ls -l command in UNIX display?

A list of files and directories in the current directory with detailed information.
B. A list of all active processes.
C. A list of all users on the system.
D. A list of all open network connections.
Answer: A

Which of the following UNIX commands is used to schedule a recurring job?

at
B. cron
C. schedule
D. time
Answer: B

What is the purpose of the /etc/hostname file in UNIX?

It stores the hostname of the system.
B. It stores the system’s IP address.
C. It stores user information.
D. It stores the system’s timezone configuration.
Answer: A

What is the default shell in most UNIX systems?

sh
B. bash
C. zsh
D. fish
Answer: B

Which command is used to display the available system memory in UNIX?

free
B. top
C. memory
D. ps
Answer: A

What does the echo $SHELL command display in UNIX?

The path of the current shell being used.
B. The version of the operating system.
C. The list of all shell variables.
D. The number of active processes.
Answer: A

What does the tar -czf command do in UNIX?

Creates a compressed archive file.
B. Extracts a compressed archive file.
C. Lists the contents of a tar archive.
D. Deletes an archive file.
Answer: A

Which of the following commands is used to remove an empty directory in UNIX?

rm
B. rmdir
C. del
D. unlink
Answer: B

What does the id command in UNIX display?

The user and group ID of the current user.
B. The system’s hardware information.
C. The current working directory.
D. The list of active network interfaces.
Answer: A

What is the function of the kill -9 command in UNIX?

Forcefully terminates a process.
B. Pauses a process temporarily.
C. Renames a process.
D. Changes the priority of a process.
Answer: A

What is the purpose of the wc command in UNIX?

Counts the number of lines, words, and characters in a file.
B. Clears the terminal screen.
C. Compresses files.
D. Displays system log messages.
Answer: A

Which command in UNIX is used to search for a specific pattern in files?

find
B. grep
C. locate
D. search
Answer: B

What is the purpose of the useradd command in UNIX?

Adds a new user to the system.
B. Changes the user’s password.
C. Removes a user from the system.
D. Displays information about the current user.
Answer: A

What is the function of the /var/log/ directory in UNIX?

It stores log files for system activities and services.
B. It stores the user data.
C. It stores configuration files for system services.
D. It stores temporary files for running processes.
Answer: A

 

What is the function of the lsof command in UNIX?

Lists open files and the processes that opened them.
B. Lists the available disk space.
C. Displays the status of network connections.
D. Displays the content of a file.
Answer: A

What does the killall command do in UNIX?

Terminates all processes with a specified name.
B. Displays a list of all running processes.
C. Starts a new process.
D. Lists all system logs.
Answer: A

Which file contains the user’s password in UNIX systems?

/etc/passwd
B. /etc/shadow
C. /etc/group
D. /home/user/passwd
Answer: B

Which command is used to display the network interfaces and their status in UNIX?

netstat
B. ifconfig
C. ip addr
D. showip
Answer: B

What is the purpose of the chmod 600 command in UNIX?

Grants read and write permissions to the owner and no permissions to the group and others.
B. Grants full permissions to all users.
C. Grants read, write, and execute permissions to the owner only.
D. Grants only read permissions to the owner.
Answer: A

In UNIX, what is the default file system for most distributions?

FAT32
B. ext4
C. NTFS
D. HFS+
Answer: B

Which command is used to display information about the system’s hardware in UNIX?

hardware
B. lscpu
C. sysinfo
D. hwinfo
Answer: B

Which of the following is a valid shell in UNIX?

Zsh
B. Bash
C. Csh
D. All of the above
Answer: D

What does the chmod 444 command do in UNIX?

Grants read-only permission to all users.
B. Grants write-only permission to all users.
C. Grants read, write, and execute permissions to the owner.
D. Grants execute permission to the owner only.
Answer: A

What is the purpose of the tar -xvf command in UNIX?

Extracts files from a tar archive.
B. Compresses files into a tar archive.
C. Lists files in a tar archive.
D. Deletes a tar archive.
Answer: A

Which command in UNIX is used to display the system’s uptime?

uptime
B. time
C. sysstat
D. uptime -s
Answer: A

In UNIX, what does the whois command do?

Displays information about a domain or IP address.
B. Lists all the users currently logged in.
C. Lists file ownership and permissions.
D. Displays the active processes.
Answer: A

Which command is used to modify the contents of a file in UNIX?

edit
B. nano
C. vim
D. Both B and C
Answer: D

What is the function of the strace command in UNIX?

It traces system calls and signals of a process.
B. It provides disk space usage statistics.
C. It tracks user login/logout events.
D. It traces the network traffic.
Answer: A

What is the function of the /proc directory in UNIX?

It contains information about running processes and kernel parameters.
B. It contains system-wide configuration files.
C. It stores user data and configurations.
D. It stores system log files.
Answer: A

Which of the following is the correct format for displaying the manual page for a command in UNIX?

man command
B. help command
C. info command
D. guide command
Answer: A

What is the primary purpose of the mount command in UNIX?

To attach a file system to a directory.
B. To remove a file system from the system.
C. To check file system integrity.
D. To display the current file system’s disk usage.
Answer: A

Which command is used to display disk usage statistics for files and directories in UNIX?

du
B. df
C. ls
D. stat
Answer: A

What does the ln -s command do in UNIX?

Creates a symbolic link to a file or directory.
B. Changes file permissions.
C. Renames a file or directory.
D. Deletes a file or directory.
Answer: A

Which command is used to display the current directory in UNIX?

pwd
B. cd
C. ls
D. current
Answer: A

Which directory in UNIX stores user-specific configuration files?

/usr
B. /etc
C. /home
D. /var
Answer: C

What does the cp -r command do in UNIX?

Copies directories and their contents recursively.
B. Removes directories and their contents recursively.
C. Moves files and directories recursively.
D. Creates symbolic links recursively.
Answer: A

Which of the following UNIX commands is used to modify a file’s timestamp?

touch
B. date
C. modtime
D. settime
Answer: A

 

Which of the following commands is used to display the list of users currently logged into the system?

who
B. users
C. logins
D. w
Answer: A

Which of the following files contains information about the system’s hardware in UNIX?

/etc/fstab
B. /proc/cpuinfo
C. /etc/passwd
D. /proc/sys
Answer: B

Which of the following is used to change the current directory in UNIX?

chdir
B. cd
C. ls
D. dir
Answer: B

What does the grep command do in UNIX?

Searches for a pattern in files.
B. Lists files in a directory.
C. Prints the contents of a file.
D. Creates a new file.
Answer: A

Which of the following commands is used to create a new directory in UNIX?

mkdir
B. touch
C. dircreate
D. makedir
Answer: A

Which file contains system-wide configuration settings in UNIX?

/etc/passwd
B. /etc/fstab
C. /etc/hostname
D. /etc/environment
Answer: B

Which of the following commands is used to view the manual page for a command in UNIX?

man
B. info
C. help
D. doc
Answer: A

What does the ps command do in UNIX?

Displays a list of running processes.
B. Displays a list of users logged into the system.
C. Displays the status of network connections.
D. Displays the disk usage statistics.
Answer: A

Which command is used to remove a directory and its contents in UNIX?

rm
B. rmdir
C. rm -r
D. del -r
Answer: C

Which command is used to search for files in UNIX by name?

locate
B. find
C. search
D. dirsearch
Answer: B

What is the function of the df command in UNIX?

Displays free disk space.
B. Displays the system’s memory usage.
C. Displays the list of running processes.
D. Displays the file system hierarchy.
Answer: A

Which of the following commands is used to change the file permissions in UNIX?

chmod
B. chown
C. chgrp
D. ls -l
Answer: A

Which file contains a list of available disks and partitions in UNIX?

/etc/passwd
B. /etc/mtab
C. /etc/fstab
D. /etc/groups
Answer: C

In UNIX, what does the ps aux command do?

Displays all processes running on the system.
B. Displays disk usage information.
C. Displays a list of users currently logged in.
D. Displays the network connections.
Answer: A

What is the purpose of the useradd command in UNIX?

Adds a new user to the system.
B. Modifies an existing user’s properties.
C. Deletes a user from the system.
D. Displays user information.
Answer: A

Which of the following files is used to configure network settings in UNIX?

/etc/hosts
B. /etc/passwd
C. /etc/netconfig
D. /etc/network/interfaces
Answer: D

What does the chmod 777 command do in UNIX?

Grants full read, write, and execute permissions to the owner, group, and others.
B. Grants read and write permissions to the owner and group only.
C. Grants read, write, and execute permissions to the owner only.
D. Grants execute permissions to the owner only.
Answer: A

What is the primary function of the init process in UNIX?

It initializes system processes at boot time.
B. It handles system hardware interrupts.
C. It manages memory allocation.
D. It runs user applications.
Answer: A

Which of the following commands is used to display the system’s hostname in UNIX?

hostname
B. sysname
C. name
D. host
Answer: A

What does the sudo command do in UNIX?

Allows a permitted user to execute a command as the superuser or another user.
B. Displays the current working directory.
C. Logs out a user from the system.
D. Lists the system processes.
Answer: A

Which of the following commands is used to rename a file in UNIX?

mv
B. rename
C. chfile
D. change
Answer: A

Which of the following commands is used to display a list of files and directories in UNIX?

list
B. ls
C. dir
D. show
Answer: B

Which of the following commands is used to display the last few lines of a file in UNIX?

head
B. tail
C. lines
D. show
Answer: B

What does the grep -i command do in UNIX?

Searches for a pattern in files, ignoring case.
B. Searches for a pattern in files, considering case.
C. Displays information about the files that contain a pattern.
D. Displays the number of occurrences of a pattern in files.
Answer: A

Which of the following commands is used to stop a running process in UNIX?

stop
B. kill
C. end
D. terminate
Answer: B

 

What is the default shell in most UNIX-based systems?

sh
B. bash
C. zsh
D. csh
Answer: B

Which of the following commands is used to display the calendar in UNIX?

date
B. cal
C. showcalendar
D. calendar
Answer: B

Which of the following commands is used to change the ownership of a file in UNIX?

chown
B. chmod
C. chgrp
D. chfile
Answer: A

What does the top command do in UNIX?

Displays the system’s current disk usage.
B. Displays the top processes running on the system.
C. Displays the system’s memory usage.
D. Displays the system’s network connections.
Answer: B

Which of the following commands is used to display the environment variables in UNIX?

env
B. setenv
C. printenv
D. showenv
Answer: C

What is the command used to create a symbolic link in UNIX?

ln -s
B. link
C. symlink
D. ln -l
Answer: A

Which of the following commands is used to remove a file in UNIX?

rm
B. del
C. erase
D. delete
Answer: A

What is the primary purpose of the shell in UNIX?

It handles all user input and output.
B. It manages hardware devices.
C. It acts as the system’s security manager.
D. It is used to compile and execute programs.
Answer: A

Which of the following commands is used to display the disk usage in UNIX?

df
B. du
C. diskusage
D. ls -d
Answer: B

What does the exit command do in UNIX?

Exits the current shell.
B. Exits the system completely.
C. Logs out a user.
D. Exits from a running process.
Answer: A

Which of the following directories contains system configuration files in UNIX?

/etc
B. /bin
C. /home
D. /usr
Answer: A

What is the purpose of the tar command in UNIX?

To copy files.
B. To compress files.
C. To archive files.
D. To move files.
Answer: C

What does the whoami command display in UNIX?

The current user’s ID.
B. The name of the currently logged-in user.
C. The system’s hostname.
D. The user’s last login time.
Answer: B

Which of the following commands is used to monitor network connections in UNIX?

netstat
B. ping
C. traceroute
D. ipconfig
Answer: A

What does the ls -l command do in UNIX?

Lists files in a directory with detailed information.
B. Lists only hidden files in a directory.
C. Lists files and directories in the current working directory.
D. Lists files in a directory in long format.
Answer: A

Which of the following commands is used to remove an empty directory in UNIX?

rmdir
B. rm
C. del
D. remove
Answer: A

What does the find command do in UNIX?

Finds files in the current directory.
B. Finds files and directories recursively.
C. Finds hidden files only.
D. Finds system configuration files.
Answer: B

Which of the following commands is used to display the current working directory in UNIX?

pwd
B. dir
C. whereami
D. path
Answer: A

Which of the following is the correct file permission representation in UNIX?

rw-r–r–
B. rwxrwxrwx
C. rw-rw-rw-
D. r-xr-xr-x
Answer: B

What is the ln command used for in UNIX?

To create symbolic links.
B. To display the contents of a file.
C. To change file permissions.
D. To rename files.
Answer: A

What is the function of the umask command in UNIX?

To set the default permissions for new files.
B. To mask a file or directory.
C. To configure the shell environment.
D. To check for errors in file permissions.
Answer: A

What is the function of the mount command in UNIX?

To attach a file system to the system.
B. To display information about mounted file systems.
C. To unmount a file system.
D. To check the integrity of a file system.
Answer: A

What does the ls -a command do in UNIX?

Lists all files, including hidden files, in the directory.
B. Lists only the directories in the current directory.
C. Lists all file types in a directory.
D. Lists files and directories in long format.
Answer: A

What does the chmod command with the numeric argument 777 do?

Grants full permissions to the owner, group, and others.
B. Revokes all permissions from the file.
C. Grants read and write permissions to the owner and group only.
D. Grants execute permission to the owner and group only.
Answer: A

 

Which of the following commands is used to change the group ownership of a file in UNIX?

chgroup
B. chown
C. chmod
D. chgrp
Answer: D

Which of the following commands is used to copy files or directories in UNIX?

mv
B. cp
C. clone
D. duplicate
Answer: B

Which of the following commands is used to display the manual pages for a command in UNIX?

help
B. man
C. info
D. docs
Answer: B

What is the purpose of the kill command in UNIX?

To kill a running process by name.
B. To terminate a running process by process ID.
C. To display process information.
D. To suspend a process.
Answer: B

In UNIX, which of the following file extensions is used for shell scripts?

.txt
B. .sh
C. .exe
D. .script
Answer: B

Which of the following files is used to configure system settings for users in UNIX?

/etc/passwd
B. /home/user/.bashrc
C. /etc/rc.local
D. /etc/sudoers
Answer: B

Which of the following commands is used to search for files in a directory in UNIX?

locate
B. grep
C. find
D. search
Answer: C

What does the ps command display in UNIX?

Displays a list of processes running on the system.
B. Displays system resource usage.
C. Displays the status of the system’s hardware.
D. Displays the current disk partitions.
Answer: A

Which of the following file permissions corresponds to “read” only for the owner in UNIX?

rwx——
B. r-xr-xr-x
C. rw-r–r–
D. r——–
Answer: D

What is the function of the sudo command in UNIX?

Allows the user to execute commands as another user, typically as root.
B. Allows the user to list all files in the system.
C. Changes the system’s security settings.
D. Monitors user activities.
Answer: A

Which of the following commands is used to list all the processes in UNIX?

ls
B. ps -ef
C. top
D. proc
Answer: B

Which of the following is the default text editor in most UNIX systems?

nano
B. vim
C. vi
D. emacs
Answer: C

Which of the following commands is used to display the amount of free memory in UNIX?

free
B. memory
C. memstat
D. top
Answer: A

Which of the following commands is used to display the amount of disk space used by files and directories in UNIX?

du
B. df
C. ls -lh
D. diskusage
Answer: A

What does the chmod +x command do in UNIX?

Adds execute permission for the file owner.
B. Adds read and write permission for the file owner.
C. Changes the file type.
D. Removes execute permission.
Answer: A

Which of the following commands is used to create a new directory in UNIX?

create
B. mkdir
C. newdir
D. makedir
Answer: B

What does the who command display in UNIX?

Displays who is currently logged into the system.
B. Displays the last login time of the user.
C. Displays information about all processes.
D. Displays the system’s kernel version.
Answer: A

Which of the following commands is used to display the current system time and date in UNIX?

date
B. time
C. clock
D. sysdate
Answer: A

Which of the following is the correct way to change file permissions in UNIX?

chmod 755 file.txt
B. chmod 7777 file.txt
C. chmod rwx file.txt
D. chmod u+x file.txt
Answer: A

What does the ln -s command do in UNIX?

Creates a symbolic link to a file.
B. Lists files in a directory.
C. Creates a hard link to a file.
D. Removes a symbolic link to a file.
Answer: A

What is the grep command used for in UNIX?

To search for text in a file.
B. To copy files.
C. To rename files.
D. To change the file permissions.
Answer: A

 

Which of the following commands is used to remove a file in UNIX?

rm
B. del
C. delete
D. remove
Answer: A

In UNIX, which of the following is used to get detailed information about the disk usage of a directory?

diskusage
B. du -h
C. ls -lh
D. df -h
Answer: B

What is the function of the mount command in UNIX?

It is used to display the contents of a directory.
B. It is used to install applications.
C. It is used to attach a file system to the file hierarchy.
D. It is used to remove a file system from the file hierarchy.
Answer: C

Which of the following commands is used to show the current directory in UNIX?

cd
B. pwd
C. dir
D. ls
Answer: B

In UNIX, which command is used to change the current working directory?

chdir
B. cd
C. move
D. switch
Answer: B

Which of the following commands is used to display the last logged-in users in UNIX?

whoami
B. last
C. users
D. w
Answer: B

In UNIX, which of the following commands is used to search the system’s manual pages for a keyword?

man -k
B. search
C. man
D. find
Answer: A

Which of the following commands is used to display the current users logged in and their processes?

ps
B. w
C. who
D. top
Answer: B

What does the df command display in UNIX?

Displays free disk space of file systems.
B. Displays the number of files in the system.
C. Displays the status of the network.
D. Displays the processes running in the system.
Answer: A

Which of the following commands is used to display the list of files in a directory in UNIX?

list
B. dir
C. ls
D. files
Answer: C

Which command is used to shut down a UNIX system immediately?

shutdown
B. halt
C. poweroff
D. reboot
Answer: A

In UNIX, which command is used to print text to the terminal?

echo
B. print
C. type
D. out
Answer: A

What does the chmod command control in UNIX?

File ownership
B. File permissions
C. File execution
D. File compression
Answer: B

In UNIX, which of the following commands is used to find out the network status?

netstat
B. ifconfig
C. ping
D. nslookup
Answer: A

Which of the following commands is used to get the system’s kernel version in UNIX?

uname -r
B. sysversion
C. kernel
D. version
Answer: A

What does the tar command do in UNIX?

Compresses a file.
B. Archives files and directories into a single file.
C. Renames files.
D. Extracts files from a compressed archive.
Answer: B

Which of the following file permissions corresponds to “write” for the group only in UNIX?

rw-r–r–
B. rwxrw-r–
C. r–rw-r–
D. r-xr-xr–
Answer: B

What does the sort command do in UNIX?

Sorts the contents of a file or output.
B. Combines files.
C. Displays the contents of a file.
D. Redirects the output of a command to a file.
Answer: A

Which of the following is the correct syntax for appending text to a file in UNIX?

echo “text” >> file.txt
B. echo “text” > file.txt
C. append “text” file.txt
D. add “text” file.txt
Answer: A

Which of the following is the correct command to change the file owner in UNIX?

chown username file.txt
B. changeowner file.txt username
C. setowner file.txt username
D. newowner file.txt username
Answer: A

Which command in UNIX is used to list all users currently logged in?

listusers
B. whoami
C. who
D. users
Answer: C

What is the function of the finger command in UNIX?

Displays information about the system’s hardware.
B. Displays detailed information about users.
C. Displays running processes.
D. Displays the last modified files.
Answer: B

 

Which of the following is used to stop a process in UNIX?

kill
B. stop
C. end
D. terminate
Answer: A

What does the top command do in UNIX?

Displays the real-time system performance statistics.
B. Displays the list of all installed software.
C. Displays the user accounts on the system.
D. Displays disk usage for the entire system.
Answer: A

Which of the following directories contains the user’s home directory in UNIX?

/bin
B. /etc
C. /usr
D. /home
Answer: D

What is the purpose of the alias command in UNIX?

To create shortcuts for commands.
B. To list all files in a directory.
C. To assign ownership to a file.
D. To search for files in the system.
Answer: A

Which of the following commands is used to display all environment variables in UNIX?

env
B. echo
C. set
D. export
Answer: A

Which of the following commands is used to display a file’s inode number in UNIX?

ls -i
B. file -i
C. inodes
D. inode
Answer: A

In UNIX, which of the following commands is used to change a file’s timestamp?

touch
B. settime
C. changetime
D. modtime
Answer: A

What does the free command do in UNIX?

Displays information about free system memory.
B. Terminates processes.
C. Displays free disk space.
D. Frees up the system cache.
Answer: A

Which of the following commands is used to view the network interfaces in UNIX?

netstat
B. ifconfig
C. iwconfig
D. ping
Answer: B

Which of the following commands is used to change the permissions of a file in UNIX?

chmod
B. chown
C. chperm
D. setperm
Answer: A

In UNIX, what does the man command display?

Displays the list of installed packages.
B. Displays system usage statistics.
C. Displays the manual page for a command.
D. Displays the system kernel version.
Answer: C

Which of the following file types represents a symbolic link in UNIX?


B. d
C. l
D. p
Answer: C

Which of the following directories contains system binaries in UNIX?

/bin
B. /usr
C. /etc
D. /lib
Answer: A

Which of the following commands is used to display the path of the current working directory in UNIX?

pwd
B. path
C. ls
D. cd
Answer: A

What does the rm -rf command do in UNIX?

Removes all files and directories recursively.
B. Renames a file or directory.
C. Removes a read-only file.
D. Frees up memory by removing files.
Answer: A

Which of the following commands is used to monitor the disk usage of a file system in UNIX?

df
B. du
C. diskusage
D. diskfree
Answer: A

What is the function of the uname -a command in UNIX?

Displays system and kernel information.
B. Displays the current date and time.
C. Displays the list of processes running on the system.
D. Displays the file system details.
Answer: A

Which of the following file permissions corresponds to “write” for others in UNIX?

rw-r–r–
B. rwxrwxrwx
C. rw-rw-rw-
D. r–r–r–
Answer: B

What does the scp command do in UNIX?

Copies files between systems over a network.
B. Creates an archive of files.
C. Monitors network traffic.
D. Displays the status of the system’s processes.
Answer: A

Which of the following is the correct syntax to append the output of a command to a file in UNIX?

command > file.txt
B. command >> file.txt
C. command : file.txt
D. command file.txt
Answer: B

In UNIX, which of the following commands is used to check the disk space usage for a directory?

ls -l
B. df
C. du
D. diskspace
Answer: C

Which of the following commands is used to change a file’s ownership in UNIX?

chown
B. chmod
C. chfile
D. setowner
Answer: A

 

Which of the following commands is used to display the disk usage of files and directories in UNIX?

diskusage
B. df
C. du
D. ls -l
Answer: C

Which of the following commands is used to change the group ownership of a file in UNIX?

chgroup
B. chown
C. chmod
D. chgrp
Answer: D

What is the main purpose of the cron daemon in UNIX?

To schedule and automate tasks.
B. To display the system status.
C. To manage system resources.
D. To monitor network connections.
Answer: A

Which of the following commands is used to terminate a process by its ID in UNIX?

kill
B. stop
C. end
D. terminate
Answer: A

In UNIX, what does the grep command do?

It searches for patterns within files.
B. It changes the ownership of a file.
C. It shows the file permissions.
D. It creates a new directory.
Answer: A

Which of the following is the default shell in most UNIX-like systems?

zsh
B. bash
C. csh
D. ksh
Answer: B

Which of the following commands is used to display the last few lines of a file in UNIX?

tail
B. head
C. cat
D. more
Answer: A

What is the purpose of the /etc/passwd file in UNIX?

To store user account information.
B. To store the kernel configuration.
C. To store system log information.
D. To store the system’s environment variables.
Answer: A

Which of the following commands is used to change the name of a file in UNIX?

move
B. rename
C. mv
D. renamefile
Answer: C

What is the purpose of the chmod command in UNIX?

To change the ownership of a file.
B. To change the permissions of a file.
C. To list the contents of a directory.
D. To change the group ownership of a file.
Answer: B

Which of the following commands is used to find a file in a directory in UNIX?

find
B. search
C. locate
D. grep
Answer: A

What is the primary function of the init process in UNIX?

To manage system files.
B. To initialize system services during startup.
C. To monitor system performance.
D. To manage user accounts.
Answer: B

Which of the following commands is used to copy a file from one location to another in UNIX?

move
B. cp
C. copy
D. duplicate
Answer: B

What does the ps command display in UNIX?

Displays information about running processes.
B. Displays the current system usage.
C. Displays the list of users logged into the system.
D. Displays the file permissions of a directory.
Answer: A

Which of the following is a valid file permission in UNIX?

rw-
B. rwxx
C. rwx–
D. rw
Answer: A

What does the whoami command do in UNIX?

Displays the current user’s username.
B. Displays all logged-in users.
C. Displays the current system uptime.
D. Displays the current working directory.
Answer: A

Which of the following commands is used to concatenate and display the content of files in UNIX?

cat
B. echo
C. concatenate
D. more
Answer: A

What does the uptime command display in UNIX?

Displays the system’s uptime and load averages.
B. Displays the current date and time.
C. Displays the file system status.
D. Displays the system’s memory usage.
Answer: A

Which of the following is used to assign a password to a user account in UNIX?

passwd
B. setpassword
C. userpass
D. changepass
Answer: A

Which of the following is the correct command to change the owner of a file in UNIX?

chmod
B. chown
C. chgrp
D. mv
Answer: B