Top Linux Multiple Choice Questions(MCQ) 2024
Explore the top Linux Multiple Choice Questions (MCQ) for 2024. Test your skills and stay ahead in the world of open-source technology. a) Bash b) Korn c) C Shell d) Z Shell Answer: a) Bash a) /* comment */ b) // comment c) # comment d) <!– comment –> Answer: c) # comment a) Checks the existence of a file b) Performs arithmetic operations c) Executes commands based on conditions d) Prints text to the console Answer: c) Executes commands based on conditions a) == b) != c) <> d) >< Answer: b) != a) Prints the contents of a file b) Executes a command c) Displays output to the terminal d) Copies files Answer: c) Displays output to the terminal a) variable = value b) variable := value c) variable = “value” d) variable=”value” Answer: d) variable=”value” a) Repeats a command indefinitely b) Executes commands based on conditions c) Iterates through a list of items d) Checks file permissions Answer: c) Iterates through a list of items a) input b) read c) get d) accept Answer: b) read a) > b) >> c) | d) &> Answer: a) > a) Closes the terminal b) Exits the current loop c) Terminates the script execution d) Restarts the system Answer: c) Terminates the script execution a) {} b) () c) <> d) “ Answer: d) “ (backticks) a) Defines constants b) Executes commands based on conditions c) Performs arithmetic operations d) Checks file permissions Answer: b) Executes commands based on conditions a) rm b) delete c) erase d) del Answer: a) rm a) function_name() { } b) define function_name() c) function function_name { } d) func function_name() { } Answer: a) function_name() { } a) Shuts down the system b) Pauses the script execution for a specified duration c) Displays system uptime d) Checks network connectivity Answer: b) Pauses the script execution for a specified duration a) $arg b) $* c) $arguments d) $1, $2, … Answer: d) $1, $2, … a) concat b) merge c) cat d) append Answer: c) cat a) Deletes a variable b) Sets a variable value c) Imports environment variables d) Makes a variable available to child processes Answer: d) Makes a variable available to child processes a) /* comment */ b) <!– comment –> c) # comment d) : ‘ comment ‘ Answer: d) : ‘ … ‘ a) Terminates the script b) Skips the current iteration in a loop c) Moves to the next line d) Restarts the script execution Answer: b) Skips the current iteration in a loop a) test -f b) check -d c) [ -d ] d) test -d Answer: d) test -d a) Search for text patterns in files b) Display disk usage c) Print the current date and time d) Group multiple commands Answer: a) Search for text patterns in files a) chmod +x script.sh b) execute script.sh c) run script.sh d) permit script.sh Answer: a) chmod +x script.sh a) read b) readfile c) cat d) open Answer: a) read a) Cut the first part of a file b) Split files into smaller parts c) Extract specific columns from a file d) Remove content from a file Answer: c) Extract specific columns from a file a) variable = command b) variable := command c) variable=$(command) d) variable-command Answer: c) variable=$(command) a) Moves a file from one directory to another b) Shifts command-line arguments c) Deletes a variable d) Exits the script Answer: b) Shifts command-line arguments a) & b) + c) . d) % Answer: c) . a) Prints the working directory b) Displays the base name of a file path c) Deletes a file d) Extracts file permissions Answer: b) Displays the base name of a file path a) Terminate the script b) Capture signals and perform specified actions c) Display a message d) Trigger an error Answer: b) Capture signals and perform specified actions a) ln -s b) symlink c) mklink d) link Answer: a) ln -s a) Evaluate expressions b) Export variables c) Execute a script d) Expand variables Answer: a) Evaluate expressions a) {} b) () c) {} d) “ Answer: d) “ (backticks) a) Combine multiple files b) Display file contents c) Redirect output to multiple files and terminal d) Merge file contents Answer: c) Redirect output to multiple files and terminal a) Using the $arguments variable b) Using input() c) By declaring parameters d) By using the -args flag Answer: c) By declaring parameters a) len b) strlen c) strlength d) length Answer: b) strlen a) Display the current directory b) Print the directory path of a file c) Delete a directory d) Show file permissions Answer: b) Print the directory path of a file a) /* comment */ b) <!– comment –> c) # comment d) : ‘ … ‘ Answer: c) # comment What does the ‘read -p’ command do in shell scripting? a) Reads user input with a specified prompt b) Reads the content of a file c) Reads environment variables d) Reads a file permission Answer: a) Reads user input with a specified prompt
Top Linux Multiple Choice Questions(MCQ) 2024 Read More »
