Introduction to Linux and Programming, End Term
file1.txt and file2.txt contains ID, Name of persons. Which of the following command Sort and merge the two files such that:
o The output should contain all the IDs from both files.
o The records should be listed in ascending order of ID.
o If an ID appears in both files, merge the records into one
file1.txt and file2.txt contains ID, Name of persons. Which of the following command Sort and merge the two files such that:\ o The output should contain all the IDs from both files.\ o The records should be listed in ascending order of ID.\ o If an ID appears in both files, merge the records into one { for (i = 1; i <= NF; i++) { count[$i]++ } } END { n = asorti(count, rcount) for (i = 1; i <= n; i++) { print rcount[i], count[rcount[i]] } } What is the primary purpose of this AWK script? what does the following script do choose most prominent answer #!/bin/bash exclude_commands=("sudo" "history") get_top_commands() { cat ~/.bash_history | \ sed 's/^[^a-zA-Z0-9]*//' | \ awk '{print $1}' | \ grep -vE "^(${exclude_commands[@]})$" | \ sort | \ uniq -c | \ sort -nr | \ head -n 5 } get_top_commands