Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Ls -al shows total 948 how do i see the files Post 303042383 by RudiC on Monday 23rd of December 2019 07:29:40 AM
Old 12-23-2019
There are no additional 6 files. The total 8 is the count of allocated 1k blocks. You can prove that by supplying the -s option to ls.


Where do the 948 in the thread title come from?

Last edited by RudiC; 12-23-2019 at 09:04 AM..
This User Gave Thanks to RudiC For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep running total/ final total across multiple files

Ok, another fun hiccup in my UNIX learning curve. I am trying to count the number of occurrences of an IP address across multiple files named example.hits. I can extract the number of occurrences from the files individually but when you use grep -c with multiple files you get the output similar to... (5 Replies)
Discussion started by: MrAd
5 Replies

2. UNIX for Dummies Questions & Answers

total number of files which have "aaa" in files whose names are File*_bbb*

I am getting the list of all the files which have "aaa" from files whose name is File*_bbb*. grep -l "aaa" File*_bbb* But I want to count the number of files. That is I want the total number of files which have "aaa" in files File*_bbb* If I run the following for getting number of... (1 Reply)
Discussion started by: sudheshnaiyer
1 Replies

3. UNIX for Dummies Questions & Answers

Find total size for some files?

Hi, I'm newbie to Unix. I'd like to count the total size of those files in my directory by date. For example, files on this period 05/01/08 - 05/31/08. If possible can we count by byte instead of kb. if I use $ du - ks , it will add up all files in the dir. thanks, Helen (5 Replies)
Discussion started by: helen008
5 Replies

4. Shell Programming and Scripting

Calculate total space, total used space and total free space in filesystem names matching keyword

Good afternoon! Im new at scripting and Im trying to write a script to calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies

5. UNIX for Dummies Questions & Answers

get total size of files

as we use du - sh *.frm In This command It will show the list of files and size But I want the Total size that these files in directory with extension .frm How can we do This (6 Replies)
Discussion started by: kaushik02018
6 Replies

6. Shell Programming and Scripting

total count of a word in the files

Hi Friends, Need help regarding counting the word "friend" in files test1.txt and test2.txt. ( there is no gap/space between word ) cat test1.txt himynameisrajandiamfriendofrajeshfriend wouldyouliketobemyfriend. cat test2.txt himynameisdostandiamfriendofdostfriend... (2 Replies)
Discussion started by: forroughuse
2 Replies

7. HP-UX

Total number of files in a FS

Hello people, On HP-UX B.11.11 U 9000/800 How can I have in aprox. the total number of files in a specific FS? Is the number of used inodes a rough estimation of my total number of files? Server1 /Data:df -i . /Data (/dev/vg_Data/lvol1 ) : 18292960 total i-nodes 15800945 free... (3 Replies)
Discussion started by: drbiloukos
3 Replies

8. UNIX for Dummies Questions & Answers

What does total no. of files in ls -lrt o/p means?

when we fire ls -lrt command we see o/p as total 16 drwx------ 9 root root 8192 May 8 2002 lost+found drwxr-xr-x 2 root root 512 Jun 14 2002 TT_DB drwxrwxr-x 2 root root 512 Jul 31 2002 mail here total no. of files is always greater than... (4 Replies)
Discussion started by: Jcpratap
4 Replies

9. Solaris

Find the total size of multiple files

If I have a number of files in a directory, for example, test.1 test.2 test.3 abc.1 abc.2 abc.3 and I need to find the total file size of all of the test.* files, I can use du -bc test.* in Linux. However, in Solaris, du does not have the -c option. What can I do in Solaris to get... (11 Replies)
Discussion started by: learnix
11 Replies
MALLOC_INFO(3)						     Linux Programmer's Manual						    MALLOC_INFO(3)

NAME
malloc_info - export malloc state to a stream SYNOPSIS
#include <malloc.h> int malloc_info(int options, FILE *fp); DESCRIPTION
The malloc_info() function exports an XML string that describes the current state of the memory-allocation implementation in the caller. The string is printed on the file stream fp. The exported string includes information about all arenas (see malloc(3)). As currently implemented, options must be zero. RETURN VALUE
On success, malloc_info() returns 0; on error, it returns -1. ERRORS
EINVAL options was nonzero. VERSIONS
malloc_info(3) was added to glibc in version 2.10. CONFORMING TO
This function is a GNU extension. NOTES
The memory-allocation information is provided as an XML string (rather than a C structure) because the information may change over time (according to changes in the underlying implementation). The output XML string includes a version field. The open_memstream(3) function can be used to send the output of malloc_info() directly into a buffer in memory, rather than to a file. The malloc_info() function is designed to address deficiencies in malloc_stats(3) and mallinfo(3). EXAMPLE
The program below takes up to four command-line arguments, of which the first three are mandatory. The first argument specifies the number of threads that the program should create. All of the threads, including the main thread, allocate the number of blocks of memory speci- fied by the second argument. The third argument controls the size of the blocks to be allocated. The main thread creates blocks of this size, the second thread created by the program allocates blocks of twice this size, the third thread allocates blocks of three times this size, and so on. The program calls malloc_info() twice to display the memory-allocation state. The first call takes place before any threads are created or memory allocated. The second call is performed after all threads have allocated memory. In the following example, the command-line arguments specify the creation of one additional thread, and both the main thread and the addi- tional thread allocate 10000 blocks of memory. After the blocks of memory have been allocated, malloc_info() shows the state of two allo- cation arenas. $ getconf GNU_LIBC_VERSION glibc 2.13 $ ./a.out 1 10000 100 ============ Before allocating blocks ============ <malloc version="1"> <heap nr="0"> <sizes> </sizes> <total type="fast" count="0" size="0"/> <total type="rest" count="0" size="0"/> <system type="current" size="135168"/> <system type="max" size="135168"/> <aspace type="total" size="135168"/> <aspace type="mprotect" size="135168"/> </heap> <total type="fast" count="0" size="0"/> <total type="rest" count="0" size="0"/> <system type="current" size="135168"/> <system type="max" size="135168"/> <aspace type="total" size="135168"/> <aspace type="mprotect" size="135168"/> </malloc> ============ After allocating blocks ============ <malloc version="1"> <heap nr="0"> <sizes> </sizes> <total type="fast" count="0" size="0"/> <total type="rest" count="0" size="0"/> <system type="current" size="1081344"/> <system type="max" size="1081344"/> <aspace type="total" size="1081344"/> <aspace type="mprotect" size="1081344"/> </heap> <heap nr="1"> <sizes> </sizes> <total type="fast" count="0" size="0"/> <total type="rest" count="0" size="0"/> <system type="current" size="1032192"/> <system type="max" size="1032192"/> <aspace type="total" size="1032192"/> <aspace type="mprotect" size="1032192"/> </heap> <total type="fast" count="0" size="0"/> <total type="rest" count="0" size="0"/> <system type="current" size="2113536"/> <system type="max" size="2113536"/> <aspace type="total" size="2113536"/> <aspace type="mprotect" size="2113536"/> </malloc> Program source #include <unistd.h> #include <stdlib.h> #include <pthread.h> #include <malloc.h> #include <errno.h> static size_t blockSize; static int numThreads, numBlocks; #define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); } while(0) static void * thread_func(void *arg) { int j; int tn = (int) arg; /* The multiplier '(2 + tn)' ensures that each thread (including the main thread) allocates a different amount of memory */ for (j = 0; j < numBlocks; j++) if (malloc(blockSize * (2 + tn)) == NULL) errExit("malloc-thread"); sleep(100); /* Sleep until main thread terminates */ return NULL; } int main(int argc, char *argv[]) { int j, tn, sleepTime; pthread_t *thr; if (argc < 4) { fprintf(stderr, "%s num-threads num-blocks block-size [sleep-time] ", argv[0]); exit(EXIT_FAILURE); } numThreads = atoi(argv[1]); numBlocks = atoi(argv[2]); blockSize = atoi(argv[3]); sleepTime = (argc > 4) ? atoi(argv[4]) : 0; thr = calloc(numThreads, sizeof(pthread_t)); if (thr == NULL) errExit("calloc"); printf("============ Before allocating blocks ============ "); malloc_info(0, stdout); /* Create threads that allocate different amounts of memory */ for (tn = 0; tn < numThreads; tn++) { errno = pthread_create(&thr[tn], NULL, thread_func, (void *) tn); if (errno != 0) errExit("pthread_create"); /* If we add a sleep interval after the start-up of each thread, the threads likely won't contend for malloc mutexes, and therefore additional arenas won't be allocated (see malloc(3)). */ if (sleepTime > 0) sleep(sleepTime); } /* The main thread also allocates some memory */ for (j = 0; j < numBlocks; j++) if (malloc(blockSize) == NULL) errExit("malloc"); sleep(2); /* Give all threads a chance to complete allocations */ printf(" ============ After allocating blocks ============ "); malloc_info(0, stdout); exit(EXIT_SUCCESS); } SEE ALSO
mallinfo(3), malloc(3), malloc_stats(3), mallopt(3), open_memstream(3) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2012-04-28 MALLOC_INFO(3)
All times are GMT -4. The time now is 01:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy