Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Red Hat Certified System Administrator (RHCSA) · Red Hat
Hotspot Scenario
Select the appropriate option to complete the statement. Click Check Answer below to see the marked solution.
Hotspot Solution:
There is no specified if the content of destination file can be replaced. So i suppose that it can.. in that case these commands are correct: cat /etc/testfile | grep abcde > /tmp/testfile OR grep abcde /etc/testfile > /tmp/testfile In case that content of destination file should not be replaced, following command will work: cat /etc/testfile | while read line; do echo $line | grep abcde | tee -a /tmp/testfile; done There is missing ";" in "correct answer" here, so the command from there will work if you will copy paste it but if you need to write it on your own, you must add the ";" or use bash script!
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
awk '/abcde/ {print}' /etc/testfile >> /tmp/testfile
this is my error message after i executed the command grep abcde /etc/testfile > /tmp/testfil "grep : /etc/testfile: Is a directory"
#grep "abcde" /etc/testfile > /tmp/testfile