SortSort is not really a filter, but is useful when combined with filters. Sort will sort lines of a file either alphabetically or numerically. Sort has a lot of options, but by default it sorts lines alphabetically starting with the first non-blank character of the line.The format for the sort command is similiar to the other filters. You can feed it input via a pipe, e.g. "cat file | sort". Or you can call sort directly and give it a file, e.g. "sort file".
Here are some examples:
UniqThe uniq command is a filter to remove duplicate lines.The -c option adds a count, and -d only shows duplicate lines. Here are a couple of examples:
AssignmentCopy the file "lab19.txt" from the home directory of dannelly. E.g.,cp /home/ACC.dannellys2/lab19.txt . That data file is another version of the graduation list that you have been working with. Write a one line command (not a script file) to print the names of students in the file lab19.txt who did a double option. For example, Ian Anderson was both a CIFS and ACCT student.
By the way, there were four such students:
|