473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

File size's don't match in terminal vs. file browser window.

Hi - I have recently made some changes to a couple C files, and I need to report how much space we have saved in our firmware....

So I used du -kh for file1.c in a UNIX termial and it says 64K for the file size. I then looked at the original file and it ALSO said 64K! So, I opened up the windows to browse the filesystem using icons......and I can compare the two files and the file sizes are: 55.5KB for the original file, and 38.2KB for the modified file.

What is going on here? How can I find the file size without browsing using windows, and WHY is UNIX not correct?

thanks!
Sep 8 '08 #1
4 3927
r035198x
13,262 8TB
Just to be sure, what does ll or ls -al report as the sizes of the files?
Sep 10 '08 #2
Nepomuk
3,112 Expert 2GB
Just to be sure, what does ll or ls -al report as the sizes of the files?
... ll being an alias for ls -l. I also find ls -lh useful sometimes, but it would probably be to inaccurate here. (Note: those are all small "L's", not big "i's".)

Greetings,
Nepomuk
Sep 10 '08 #3
ashitpro
542 Expert 512MB
You could have used du -b <filename>
this would give you precise size.
When you use du -k <filename>, -k is equivalent to --block-size=1 and it would always give you the answer in terms of block..
Lets say you have file having 9 bytes in it. and assume block size as 4K i.e 4096 bytes.
when you say...
du -b <filename> ans: 9
du -k <filename> ans: 4
du -h <filename> ans: 4k
du -kh <filename> ans: 4k
It would always try to give the output in terms of block size or number of blocks.which would be round figured.
Sep 11 '08 #4
Just to be sure, what does ll or ls -al report as the sizes of the files?

> ll
39094

> du -k
64
Sep 11 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Michael Levin | last post by:
I've got the following problem. I'm a biologist and I have a device at work which monitors my frog habitat. The device has a bunch of sensors, and runs an embedded html server with some java...
7
by: Joe | last post by:
I have an upload file operation in the web application. UploadForm.asp is the form, and UploadAction.asp is the form processing. //UploadForm.asp <FORM NAME="InputForm"...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
2
by: hoenes1 | last post by:
I've got an aspx-Page "SendFile.aspx" which is called by a Link on "ShowListOfFiles.aspx" and sends the file in the OnLoad Eventhandler. The filename to download is stored in a Session variable....
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
6
by: qysbc | last post by:
I have a web page and there is a link to open a TIFF file. The way I do it is to have the server code open a binary stream, set the content type to "image/tiff" and call Response.BinaryWrite. On...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.