I made this following observations after making a text file on Ubuntu 12.10 through GUI (alt+enter) as well as in Terminal (ls -l).
Why 1 byte extra when the file just contains one character, i know this is not because of End-Of-File because when i wrote a c program the loop terminated when it reached End-Of-File and it gave me the same results, so obviously this doesn't count, then what is it?
But on windows when the file contained one character the file size was just 1 byte, it was normal. What are the things behind all this stuffs?
Because of the way file systems organize and track your data on disk, size may be displayed differently in one place than in another. When backing up online, my pictures only take up ~65 GB, but ~88 GB are reported on my computer.
PSD and RAW take up so much space on devices mostly because people collect so many photos. High-quality photo files take up the most space on your device. The more dots per inch (DPI) — an indicator of photo clarity — in a photo, the more space it takes up.
Zero-byte files can occur when file transfers do not complete successfully. This may happen when a file is incompletely downloaded via the Web or an FTP (file transfer protocol) client, or when an email attachment is not transmitted correctly. The result may be a file that has a name, but no data.
If they have a different size, then they definitely have different contents. A file is (pretty much) just a sequence of bytes - and if two sequences have different lengths, they're different sequences.
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 input
x{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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With