Linux CLI - Linux Basics and TerminalIdentify the error in the command: grep -i 'hello' file.txt -rAThe -r option is misplaced and invalid hereBThe quotes around 'hello' are incorrectCThe file name should come before optionsDThere is no error in this commandCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand grep options and order'-i' is a valid option for case-insensitive search. '-r' is for recursive search but must come before arguments.Step 2: Check option placementOptions should come before arguments. Here, '-r' is after the file name, which is incorrect and causes error.Final Answer:The -r option is misplaced and invalid here -> Option AQuick Check:Options before arguments [OK]Quick Trick: Put all options before arguments in commands [OK]Common Mistakes:Placing options after argumentsMisusing quotesAssuming no error when order is wrong
Master "Linux Basics and Terminal" in Linux CLI9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Linux CLI Quizzes File Permissions and Ownership - Permission types (read, write, execute) - Quiz 6medium File Permissions and Ownership - Special permissions (setuid, setgid, sticky bit) - Quiz 14medium File Permissions and Ownership - chown (change ownership) - Quiz 1easy File and Directory Operations - File globbing (wildcards *, ?, []) - Quiz 15hard File and Directory Operations - cp (copy files and directories) - Quiz 10hard Linux Basics and Terminal - Terminal vs GUI - Quiz 14medium Navigating the File System - cd (change directory) - Quiz 4medium Users and Groups - passwd (change password) - Quiz 12easy Users and Groups - passwd (change password) - Quiz 14medium Users and Groups - groups and group management - Quiz 2easy