We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
CUT AND SORT COMMAND
cut and sort command:
Another very useful command is cut.This command allows you to get fields from structured files.To do this, it helps if you tell cut what the field delimiter is. Sort can be used to sort the data in a particular order. Example: To display the last seven lines of the /etc/passwd file in which user accounts are stored, and then, I will pipe this to the cut command to filter out the first column.Then we can sort the list. tail -n 7 /etc/passwd tail -7 /etc/passwd | cut -d : -f 1 tail -7 /etc/passwd | cut -d : -f 1,7 tail -7 /etc/passwd | cut -d : -f 1 | sort -d = délimiter Sort –n or sort -r