Don't be afraid to ask... first always try the "man" command, it will teach you a lot... use it with "man command"...
Now, to answer to your question, and straight from the man page of ls command...
Quote:
ls -l (the long list) prints its output as follows for the
POSIX locale:
-rwxrwxrwx+ 1 smith dev 10876 May 16 9:42 part2
Reading from right to left, you see that the current direc-
tory holds one file, named part2. Next, the last time that
file's contents were modified was 9:42 A.M. on May 16. The
file contains 10,876 characters, or bytes. The owner of the
file, or the user, belongs to the group dev (perhaps indi-
cating ``development''), and his or her login name is smith.
The number, in this case 1, indicates the number of links to
file part2 (see cp(1)). The plus sign indicates that there
is an ACL associated with the file. Note: If the -@ option
has been specified, the presence of extended attributes will
supersede the presence of an ACL and the plus sign will be
replaced with an 'at' sign (@). Finally, the dash and
letters tell you that user, group, and others have permis-
sions to read, write, and execute part2.
Things are not quite this simple. There are two different concepts of size here.
The 1558 does mean that a program can read 1558 bytes from this files. An attempt to read byte 1559 will fail with an EOF being returned. This is one concept of size.
But I think that Alan is actually interested in the second concept which is how much disk space is consumed by the file. The answer is that 8 * 512 = 4096 bytes of disk space is being using by this file. And that 8 came from the first column of the "ls" listing.
So if a program adds a byte to the file, making that 1558 to be a 1559, no additional disk space is needed.
This difference becomes very important because unix supports sparce files. If Alan wrote a program that seeks to byte 1,999,999,999 and writes a single byte, he will see something like this:
16 -rwx------ 1 root sys 2000000000 Dec 30 14:06 sparsefile
(Hmmmm... I would have predicted 8. Apparently a full block was allocated instead of a fragment. This was on HP-UX 11.00 on a vxfs filesystem.)
Database programs like Oracle will do this so it happens more often than you may think.
Here is my program in case you'd like to try it...
When I create a bootable Linux distro installation USB drive, I use this command: sudo dd if=/Path/to/linux_distro.iso of=/dev/rdisk<disk number>
bs=<number of bytes>
When I look it up, I've seen variations of people choosing 4M, and I think 8M, 2M, and maybe even 1M.
If I leave the operand... (4 Replies)
I have file listed like below
-rw-r--r--+ 1 test test 17M Nov 26 14:43 test1.gz
-rw-r--r--+ 1 test test 0 Nov 26 14:44 test2.gz
-rw-r--r--+ 1 test test 0 Nov 27 10:41 test3.gz
-rw-r--r--+ 1 test test 244K Nov 27 10:41 test4.gz
-rw-r--r--+ 1 test test 17M Nov 27 10:41 test5.gz
I... (5 Replies)
I have been searching both on Unix.com and Google and have not been able to find the answer to my question. I think it is partly because I can't come up with the right search terms.
Recently, my virtual server switched storage devices and I think the problem may be related to that change.... (2 Replies)
Hi Experts,
I have a script like
$ORACLE_HOME/bin/sqlplus username/password # << ENDSQL
set pagesize 0 trim on feedback off verify off echo off newp none timing off
set serveroutput on
set heading off
spool Schemaerrtmp.txt
select ' TIMESTAMP COMPUTER NAME ... (5 Replies)
Hi everybody,
I need to calculate the tcp buffer size of a network switch, since it's not specified in the manual; how do I do this?
I have some machines connected to the switch and I can run some socket tests written in C between these machines (I can choose how many bytes to send and... (0 Replies)
#!/bin/sh
##########################################################################################################
#This script is being used for AOK application for cleaning up the .out files and zip it under logs directory.
# IBM
# Created
#For pdocap201/pdoca202 .out files for AOK
#1.... (0 Replies)
Hi
is there a cmd in hpux 11 to determine the physical size of the hard disk.
not bdf command.
i have searched the other threads here but cant find an answer.
thank you guys (4 Replies)
hi all,
in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders...
please help me, how can i find the total size of these specific files in the server... (3 Replies)
Does anyone know a way to determine the maximum filesize on a file system on Solaris, HP-UX, AIX, Linux, and OSF1 using the command line?
TIA (2 Replies)