Multiple choice technology operating systems

"A user types history command and gets the following output 141 cd .tcs 142 ll tcs.lst 143 pwd 144 vi tcs.lst 145 ll -lrt | awk '{ print \$NF }' 146 echo ""Test"" 147 ps -ef | grep lsnr 148 grep a * 149 ls 150 echo \$PWD Refering to the scenario above, which one of the following is not a method for recovering the pwd command"

  1. r 143

  2. fc -e -r p

  3. fc -e 143

  4. r -8

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The question asks which is NOT a valid method to recover command 143 (pwd). 'r 143' re-executes command 143. 'fc -e 143' (or 'fc -s 143') re-runs command 143. 'r -8' runs command 8 back from current. 'fc -e -r p' attempts to run 'p' via fc -e, but 'p' isn't a valid history reference in this context - it would need to be a number or proper pattern. This is the invalid method.