473,472 Members | 2,191 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

66 New Member
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 3928
r035198x
13,262 MVP
Just to be sure, what does ll or ls -al report as the sizes of the files?
Sep 10 '08 #2
Nepomuk
3,112 Recognized Expert Specialist
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 Recognized Expert Contributor
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
dissectcode
66 New Member
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.