Category Archives: Daily Hacks

Hack #15 -> Uniq Command

Uniq command is mostly used in combination with sort command, as uniq removes duplicates only from a sorted file. i.e In order for uniq to work, all the duplicate entries should be in the adjacent lines. The following are some common examples. When you have an employee file with duplicate entries, you can do the following to remove duplicates. $

Read more

Hack #14 -> Sort Command

Sort command sorts the lines of a text file. Following are several practical examples on how to use the sort command based on the following sample text file that has employee information in the format: employee_name:employee_id:department_name. $ cat names.txt Emma Thomas:100:Marketing Alex Jason:200:Sales Madison Randy:300:Product Development Sanjay Gupta:400:Support Nisha Singh:500:Sales Sort a text file in ascending order $ sort names.txt

Read more
« Older Entries Recent Entries »