09-15-2010
Quote:
So 'du' cmd show how many blocks a particular file or directory occupies on the disk geometry but the actual size of the object should be read from ls -la cmd ?
Correct.
Also if you have two identical size files according to "ls" you can get different sizes from "du" due to fragmentation.
It is inefficient to have very large numbers of small files, but no worse in unix than Windows. You will notice that a directory file never shrinks.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
We use a UNIX-based system (Lawson) at work and I was given this command to request a data extract from the db admin. The only thing I really understand is the last line as it appears to be joining the files created from the first three lines into one. Is there anyone who can help me breakdown the... (4 Replies)
Discussion started by: KGee
4 Replies
2. Shell Programming and Scripting
Guys,
I am trying to understand the sed command here.
adx001 $ a=/clocal/dctrdata/user/dctrdat1/trdroot/recouncil
adx001 $ b=`echo $a | sed 's/\//\\\\\//g'`
adx001 $ echo $b
\/clocal\/dctrdata\/user\/dctrdat1\/trdroot\/recouncil
The sed command i took it from the script.
Please... (3 Replies)
Discussion started by: mac4rfree
3 Replies
3. Shell Programming and Scripting
Hi All,
I search the forum for my query, Glad that got solution to it. But i really want to understand how does this command work.
sed -e ':a' -e 's/\("*\),\(*"\)/\1~\2/;ta'
Basically it is replacing all the comma(,) characters in between quotes with a tilde.
Specially what does ':a' ,... (2 Replies)
Discussion started by: DSDexter
2 Replies
4. Shell Programming and Scripting
Hi Guys,
I like to know if i have a process which triggers 10 different child processes.
How to identify out of the 11 processes running which is the parent process and what are the child process?
And if i kill the parent process will the child process be killed.. if not is there a way to... (2 Replies)
Discussion started by: mac4rfree
2 Replies
5. Shell Programming and Scripting
hi
i was moving a file from one directory to another with the following cmmand
mv /home/hsghh/dfd/parent/file.txt .
while doing so i i accidently
mv /home/hsghh/dfd/dfd .
although i gave ctrl c and terminate the move command some of the file are missing in the parent directory and... (1 Reply)
Discussion started by: saravanan71184
1 Replies
6. UNIX for Dummies Questions & Answers
Could you please explain me whats happening in the below code, appreciate your help, Thank you.
/product/apps/informatica/v7/pc/ExtProc/NewDAC/dacRecBuilder.sh
/product/apps/informatica/v7/pc/TgtFiles/NEW_DAC/DAC_Pos_TradeInv_Records.out ... (5 Replies)
Discussion started by: Ariean
5 Replies
7. Shell Programming and Scripting
I want to understand what does this command do:confused::confused: find . \( -type f -o -type 1 \) Plz someone explain me ! Thanks much in advance!! (2 Replies)
Discussion started by: sears
2 Replies
8. UNIX for Dummies Questions & Answers
After running nm command on any object file from out put can we get to know that wheather a symbol is a call to a function or definition of function ?
I am searching a class and function definitions inside many .so files.
I have 3 files which contain the symbol but I don't know wheather they... (2 Replies)
Discussion started by: yatrik007
2 Replies
9. UNIX for Dummies Questions & Answers
Hi Friends,
I need a small help in understanding the below sed command.
$ cat t4.txt
1 root 1 58 0 888K 368K sleep 4:06 0.00% init
1 root 1 58 0 888K 368K sleep 4:06 0.00% init last
$ sed 's/*$//' t4.txt
1 root 1 58 0 888K ... (3 Replies)
Discussion started by: forroughuse
3 Replies
10. Shell Programming and Scripting
Hello
I am working on a Change request and Stuck at a point. The below awk command is used in the function.
float_test ( ) {
echo | awk 'END { exit ( !( '"$1"')); }'
}
I understand that awk 'END' is used to add one line at the end and exit is used to end the script with an error... (4 Replies)
Discussion started by: rahul2662
4 Replies
LEARN ABOUT ULTRIX
mallopt
malloc(3x) malloc(3x)
Name
malloc, free, realloc, calloc, mallopt, mallinfo - fast main memory allocator
Syntax
#include <malloc.h>
char *malloc (size)
unsigned size;
void free (ptr)
char *ptr;
char *realloc (ptr, size)
char *ptr;
unsigned size;
char *calloc (nelem, elsize)
unsigned nelem, elsize;
int mallopt (cmd, value)
int cmd, value;
struct mallinfo mallinfo (max)
int max;
Description
The and subroutines provide a simple general-purpose memory allocation package, which runs considerably faster than the package. It is
found in the library and is loaded if the option is used with or
The subroutine returns a pointer to a block of at least size bytes suitably aligned for any use.
The argument to is a pointer to a block previously allocated by After is performed, this space is made available for further allocation,
and its contents have been destroyed. See below for a way to change this behavior.
Undefined results will occur if the space assigned by is overrun or if some random number is handed to
The subroutine changes the size of the block pointed to by ptr to size bytes and returns a pointer to the (possibly moved) block. The con-
tents will be unchanged up to the lesser of the new and old sizes.
The subroutine allocates space for an array of nelem elements of size elsize. The space is initialized to zeros.
The subroutine provides for control over the allocation algorithm. The available values for cmd are:
M_MXFAST Set maxfast to value . The algorithm allocates all blocks below the size of maxfast in large groups and then doles them out very
quickly. The default value for maxfast is 0.
M_NLBLKS Set numlblks to value . The above mentioned large groups each contain numlblks blocks. The numlblks must be greater than 0. The
default value for numlblks is 100.
M_GRAIN Set grain to value . The sizes of all blocks smaller than maxfast are considered to be rounded up to the nearest multiple of
grain . The grain must be greater than 0. The default value of grain is the smallest number of bytes which will allow alignment
of any data type. Value will be rounded up to a multiple of the default when grain is set.
M_KEEP Preserve data in a freed block until the next or This option is provided only for compatibility with the old version of and is not
recommended.
These values are defined in the malloc.h header file.
The subroutine may be called repeatedly, but may not be called after the first small block is allocated.
The subroutine provides information describing space usage. It returns the following structure:
struct mallinfo {
int arena; /* total space in arena */
int ordblks; /* number of ordinary blocks */
int smblks; /* number of small blocks */
int hblkhd; /* space in holding block headers */
int hblks; /* number of holding blocks */
int usmblks; /* space in small blocks in use */
int fsmblks; /* space in free small blocks */
int uordblks; /* space in ordinary blocks in use */
int fordblks; /* space in free ordinary blocks */
int keepcost; /* space penalty if keep option */
/* is used */
}
This structure is defined in the malloc.h header file.
Each of the allocation routines returns a pointer to space suitably aligned (after possible pointer coercion) for storage of any type of
object.
Restrictions
This package usually uses more data space than
The code size is also bigger than
Note that unlike this package does not preserve the contents of a block when it is freed, unless the M_KEEP option of is used.
Undocumented features of have not been duplicated.
Return Values
The and subroutines return a NULL pointer if there is not enough available memory. When returns NULL, the block pointed to by ptr is left
intact. If is called after any allocation or if cmd or value are invalid, nonzero is returned. Otherwise, it returns zero.
See Also
brk(2), malloc(3)
malloc(3x)