Linux CLI - Text ProcessingWhat is the output of the command:echo "banana" | tr 'an' '12'?Ab21212Bb12121CbananaDb11111Check Answer
Step-by-Step SolutionSolution:Step 1: Map characters 'a' and 'n' to '1' and '2'In the input 'banana', 'a' is replaced by '1' and 'n' by '2'.Step 2: Apply replacements to each character'b' remains 'b', 'a' becomes '1', 'n' becomes '2', so 'banana' becomes 'b12121'.Final Answer:b12121 -> Option BQuick Check:Character translation = b12121 [OK]Quick Trick: Match each source char to target char positionally [OK]Common Mistakes:Swapping target charactersNot replacing all occurrencesConfusing character order
Master "Text Processing" in Linux CLI9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Linux CLI Quizzes Networking Commands - curl for HTTP requests - Quiz 11easy Pipes and Redirection - stdin redirection (<) - Quiz 10hard Pipes and Redirection - stdin redirection (<) - Quiz 7medium Searching and Finding - find command basics - Quiz 8hard Searching and Finding - find by modification time - Quiz 3easy Searching and Finding - find with -exec for actions - Quiz 3easy Text Processing - cut (extract columns) - Quiz 14medium Text Processing - awk patterns and actions - Quiz 1easy Text Processing - grep with regex (-E) - Quiz 13medium Text Processing - grep (search text patterns) - Quiz 13medium