|
| ||||||||||
| Tags: grep, linux, sort, uniq, unix |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Printing unique lines in the Linux
|
|
#2
| ||||
| ||||
| Re: Printing unique lines in the Linux
Well looking at your situation I am suggesting you to use grep command. This command is used for searching of the text in the file. You can provide every single line of the file to the command. It will count the total number of similar line the file. If the total count is one then it will echo the line on the screen. I think grep command will definitely solve your problem. Thanking you for the reading the solution. |
|
#3
| ||||
| ||||
| Re: Printing unique lines in the Linux
I am suggesting you to use Sort command to get the appropriate results. ‘sort’ command sorts the line according to argument list provided. You have to use the following code sort <file> | uniq. ‘sort’ will sort the file and ‘uniq’ command will extract t unique line from the file. It is another great solution for you. If it does not working for you can follow other forums also on the internet. Try your Luck!. It may help you. |
|
#4
| |||
| |||
| Re: Printing unique lines in the Linux
You can use ‘sort’ command in more efficient manner as below. Type following command on the terminal sort –u somefile | lpr’. You have to sort the file and the desired output is redirected to lpr. On above example somefile is source file and the lpr is the destination file where output is redirected. I want to say thank you to all of you for replying and suggesting idea on this matter. I really want to appreciate your efforts that you have put in. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Printing unique lines in the Linux" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What is unique about the Linux | Kavanagh | Operating Systems | 4 | 06-02-2012 08:31 PM |
| Unable to open printing preferences while printing from Dell Inkjet Photo Printer 720 | LaurenBc | Portable Devices | 2 | 11-11-2011 05:54 PM |
| Printing MPP files to Adobe and then printing on paper | mbbackus | Microsoft Project | 2 | 28-09-2011 06:10 PM |
| What is a unique device ID in PDA | Austin Power | Portable Devices | 5 | 01-03-2011 11:09 PM |
| Printing With Lexmark X5320 connected with Linux Mint 10 | NamJam | Portable Devices | 3 | 02-01-2011 07:17 AM |