Line Termination
Read a little about the different line termination characters used among various operating system platforms.
The exercise for you to perform:
Obtain copies of two files, abcwin.txt and abclin.txt. The former was made using the Notepad editor in Windows, the latter using vi editor in linux.
Both contain pretty much the same thing. They each have 3 lines. The first line has just the letter "a" on it. The second has "b" and the third has "c". Observe that in a couple of ways, first with the cat command then with the wc command:
cat abclin.txt
cat abcwin.txt
They look the same. Then use the wc (word count-- also does line count and characters count) command to query how many lines are in these files.
wc -l abclin.txt
wc -l abcwin.txt
wc reports 3 lines for each. But now query for the number of characters:
wc -c abclin.txt
wc -c abcwin.txt
They are different. Confirm that with the ls command, checking the size (5th) field:
ls -l abclin.txt
ls -l abcwin.txt
How come they are different when they look the same? We need a byte dump program that will reveal every byte in each file, and the byte's value:
xxd -g1 abclin.txt
( alternatively, " od -Ad -tx1z ... " in
place of " xxd -g1 ... " )
xxd -g1 abcwin.txt
Scrutinize these and make sure you can identify the line separator characters that appear, and the difference between those in one file and those in the other. If you have any doubt what your looking at or what the point is, consult your classmates or instructor.