In this case, why 1 byte extra when computing the file size? [closed] In this case, why 1 byte extra when computing the file size? [closed] windows windows

In this case, why 1 byte extra when computing the file size? [closed]


It's due to text editor you are getting this.YOu must have pressed extra terminating character such as newline.

If you want 1 byte size for 1 character in a file.

Just do like this on you terminal.

#cat > file // create a file for inputx{CTRL+D}  // after inputting one character 'x' , press CTRL+D twice           // one for terminating file and one for killing the cat process.#ls -l  // list the file

You will get exactly 1 byte file size.

Try it. (It's working on my system Ubuntu 11.04)


Most likely the extra character is the newline character at the end of each line in a Unix/Linux text file. You should be able to see that char using the command 'od -c file'.