Can you please tell me how can I compare two files in Unix I know that I must use diff or cmp but it is for a specific use, I want to compare only the 10 first lines of those two files, thanks in advance.
What type of comparison are you wanting? You can use head to select the first 10 lines without too much trouble and then just compare the results between the two. Easiest way would be to take the results of that and just put them in temporary files to compare. But I do know that there are more sophisticated ways of doing it, if more complicated to actually do.
Thank you for you answer, I just want to compare but with a single command, I don't know if it is possible to mix diff or cmp with the head command, may someone give me the command to use, thanks in advance.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.