Next get the paths of the files which we can later use for reference purpose
cat thm-files.txt | while IFS= read line; do find / -name "$line" -type f 2>/dev/null; done | tee files.txt
Tasks
Question 1 : Which of the above files are owned by the best-group group(enter the answer separated by spaces in alphabetical order)
cat files.txt | while IFS= read line; do ls -laSh $line; done | grep "best-group"
Question 2 : Which of these files contain an IP address?
# Get the IP address along with the file name
cat files.txt| while IFS= read -r line; do grep -E -o '([0-9]{1,3}\.){3}[0-9]{1,3}' "$line" 2>/dev/null && echo "$line"; done
Question 3 : Which file has the SHA1 hash of 9d54da7584015647ba052173b84d45e8007eba94 ?
cat files.txt | while IFS= read -r line; do sha1sum $line; done | grep "9d54da7584015647ba052173b84d45e8007eba94"
Question 4 : Which file contains 230 lines?
cat files.txt | awk -F/ '{print $NF}' | sort -u > a.txt
cat thm-files.txt | sort -u > b.txt
diff a.txt b.txt
## the one file that is missing is marked with >
Question 5 : Which file's owner has an ID of 502?
cat files.txt | while IFS= read -r line; do ls -ln $line; done
# check the 3rd column which has all the IDs
# -rw-rw-r-- 1 502 501 14K Oct 23 2019
Question 6: Which file is executable by everyone?
cat files.txt | while IFS= read -r line; do ls -ln $line; done
### Look for -rwxrwxr-x