3 ms·
Don't forget "tac" - the reverse of "cat".
by AdamGibbins 15y ago
Don't forget "tac" - the reverse of "cat".
- neilk 15y agoNo, that just concatenates a file reading bytes from the end, backwards. The real opposite of cat would be a putative 'trunc'. So if you typed $ cat somefile It would print the file to your terminal. And then if you said $ trunc somefile The printed lines would be removed from your terminal. :)
- burgerbrain 15y agoIn case you missed it, "tac" is literally the reverse of "cat". As in "cat".reverse() or something.
- sciurus 15y agoI get that tac exists and is useful for concatenating and printing files in reverse. Neilk was just humorously pointing out that since cat stands for concatenate, its reverse should be truncate, and since cat is often abused to print a single file to a terminal this fictional trunc should "unprint" it. Arguably you could view 'comm -3' as the reverse of cat. # output is all the lines of file1 and file2 cat file1 file2 # output is the lines in file1 not in file 2, and vice verse comm -3 file1 file2
- emmelaich 15y ago> cat stands for concatenate I almost resisted the urge, but no, the pedant in me :-) insists on pointing out that cat is short for catenate