SIMULATION -
Download the document from ftp://instructor.example.com/pub/testfile, find all lines containing [abcde] and redirect to /MNT/answer document, then rearrange the order according the original content.
SIMULATION -
Download the document from ftp://instructor.example.com/pub/testfile, find all lines containing [abcde] and redirect to /MNT/answer document, then rearrange the order according the original content.
To accomplish the task, follow these steps: First, download the file from the specified FTP server. Then, use the 'grep' command to search for lines containing any of the characters 'a', 'b', 'c', 'd', 'e' and redirect the output to the specified file location. The 'grep' command with a character class is used to match any single character specified within the brackets. Finally, ensure the file system path exists before redirecting the output. The correct command sequence should be as follows: wget ftp://instructor.example.com/pub/testfile, mkdir -p /MNT, grep [abcde] testfile > /MNT/answer.
# wget ftp://instructor.example.com/pub/testfile # mkdir -p /MNT/answer # grep ‘abcde’ testfile > /MNT/answer
mkdir will create a folder, to create a file we should use the touch command touch /mnt/answer
redirect will create the file automatically
sudo su mkdir -p /MNT wget ftp://instructor.example.com/pub/testfile grep 'abcde' testfile > /MNT/answer cat /MNT/answer (to verify)