Tag Info

New answers tagged

1

Below mentioned solution might help: cat file_name.txt | fmt -w 80 > reduced_file_name.txt fmt - simple optimal text formatter.


3

Use fmt instead: fmt --width=80 file From man fmt: -w, --width=WIDTH maximum line width (default of 75 columns)


3

I would recommend less You can browse in any direction With less -S logfile -S or --chop-long-lines Causes lines longer than the screen width to be chopped rather than folded. That is, the portion of a long line that does not fit in the screen width is not shown. The default is to fold long lines; that is, display the remainder ...


7

Use recode, e.g.: recode /cr file Note: the fact that you can see the contents in the terminal with cat file is that the Mac end-of-line is CR, which puts the cursor at the beginning of the line without going to the next line, so that everything gets overwritten.


6

The less command by itself cannot do any diff'ing. You can use the diff -y command to show the diff of 2 files side-by-side and then pipe that into less however. Method #1 - using diff + less This will create 2 sample files. $ seq 100 > 1.txt $ seq 10 100 > 2.txt Now diff the 2 files: $ diff -y 1.txt 2.txt | less 1 ...


2

I am not sure if it is possible using less command. However, it is possible using the below command. From here, pr -m -t one.txt two.txt One more option that is useful though doesn't display side by side is, tail -f file1 -f file2


1

You can copy the lines of output without extra newlines (line breaks) if the text was output directly to the terminal. The terminal can keep track of where the real line ends are. But if the lines were output by less or a similar pager program, the terminal does not know where the newlines are. The pager uses the terminal as a full screen of characters, and ...



Top 50 recent answers are included