An administrator has a CSV file named hosts.csv . The contents of include the following: 192.168.2.57,lnx1prd.example.com,Linux,Production 192.168.2.58,lnx2prd.example.com,Linux,Production 192.168.1.4,server15.example.com,Windows,Development The administrator needs to create a second comma-separated list of only the Linux server IP addresses. Which of the following commands would achieve this need?
A) for ip in $(grep "Linux" hosts.csv | cut -d"," -f1) ; do echo -n "$ip,"; done
B) for ip in $( cut -d"," -f1 hosts.csv | grep "Linux") ; do echo -n "$ip,"; done
C) for ip in $(grep "Linux" hosts.csv | sed "/$1//') ; do echo -n "$ip,"; done
D) for ip in $(awk -F, '{print $1}' hosts.csv | grep "Linux") ; do echo -n "$ip,"; done
Correct Answer:
Verified
Q110: An administrator is reviewing suspicious activity on
Q111: A Linux administrator is helping the security
Q112: Users in the payroll department are not
Q113: An administrator receives the following message on
Q114: A junior systems administrator is scanning archive.tar
Q116: An administrator wants to know the amount
Q117: A Linux administrator needs to remove a
Q118: An issue was discovered on a testing
Q119: Which of the following would allow remote
Q120: In which of the following Linux GUI
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents