03-21-2008
Total file size of a subset list
Thank you! Yes, that worked very well. But now I'm curious about a couple of things (i.e., please explain a little of how it works):
Instead of bothering you with even more questions than, I looked awk in google and found gnu.org and searched on +=. It gave me this:
ls -l files | awk '{ x += $5 }
END { print "total K-bytes: " (x + 1023)/1024 }'
1. Should I be using the (x + 1023)/1024 stated above (I'm wondering why they have that)?
2. I have GB of files, is there a different number I can use to get GB or do I just add 2 zero's?
3. Why %4.2f\n (what does that mean)?
Thanks!
10 More Discussions You Might Find Interesting
1. HP-UX
HI ALL,
i am a beginner in unix world.
can anyone please tell me the way to find total size taken by each directory (including size of all subdirectories and files) present under /var.
e.g what is space occupied by /var/adm , /var/admin etc.
its a simple question but still i dont know the... (2 Replies)
Discussion started by: jyoti
2 Replies
2. Solaris
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)
Discussion started by: abhinov
3 Replies
3. Shell Programming and Scripting
Hi,
I am trying to get the total file size for certain files per directory.
I am using
find /DirectoryPath -name '*.dta' -exec ls -l {} \; | awk '{ print $NF ": " $5 }' > /users/cergun/My\ Documents/dtafiles.txt
but this lists all the files in the directories.
I need the total... (9 Replies)
Discussion started by: cergun
9 Replies
4. Shell Programming and Scripting
I have a directory that contains files like
aaa-2010-05-30.txt
ddd-2010-05-30.txt
www-2010-05-30.txt
i have total 2000 files, i need to calculate total size of files for *2010-05-30.txt like
aaa-2010-05-30.txt 200MB
ddd-2010-05-30.txt 10GB
www-2010-05-30.txt 4GB
Total 14.2 GB... (5 Replies)
Discussion started by: learnbash
5 Replies
5. UNIX for Dummies Questions & Answers
I am trying to get the total size of the folder using the below command
but its not working. any ideas?
du -bc <foldername>/|grep total|tr -s " "|cut -d" " -f1
the output i am getting is
78996 total
but i just want it to be as
78996
please help (3 Replies)
Discussion started by: classic
3 Replies
6. Linux
Hi All,
I am writing a block driver for a 2GB SD card where i get the total amount of data per request as follows:
struct request *req;
uint card_addr,total_bytes;
struct request_queue *rq = BlkDev->queue;
req = elv_next_request(rq);
..
..
card_addr = req->sector*512;... (1 Reply)
Discussion started by: amio
1 Replies
7. Shell Programming and Scripting
Hello :
I need some help in writing a ksh script which will find a particular directory in all the file systems in a server and finally report the total size of the direcotry in all the file systems.
Some thing like this..
find /u*/app/oracle -type d -name "product" -prune
and then... (1 Reply)
Discussion started by: Sam1974
1 Replies
8. Solaris
:mad:i need command to know the total size of project in my system by Giga bit
i try
#du -s /*/projectname
but i need total size for this project by G.B
can you help me (6 Replies)
Discussion started by: ayman
6 Replies
9. Shell Programming and Scripting
I have list of file names in filename.txt
below is file format
>>File1
_________________________
01~12345~Y~YES~aaaaa~can
02~23456~N~NO~bbbbb~can
.
.
.
99~23__________________________
Need to find total count from each file depending on specific string and add them to have total count... (17 Replies)
Discussion started by: santoshdrkr
17 Replies
10. Shell Programming and Scripting
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)
Discussion started by: krish2014
5 Replies
kits(1) General Commands Manual kits(1)
Name
kits - generate setld format distribution kits
Syntax
/usr/sys/dist/kits key-file input-path output-path [ subset... ]
Description
The command produces subset images, inventories, and control files for an installation using the command. You need to know the key file
which describes the product to be built, a hierarchy from which the component files to be kitted are to be taken, and a destination direc-
tory into which the kit information is to be placed.
The command produces a subset image and a .image file in the output-path directory for each subset. In the instctrl subdirectory of output-
path, produces an inventory file and a control file. Any subset control program for the subset is transferred to output-path/instctrl. An
instctrl directory is created if none existed.
Arguments
key-file The path name of the manufacturing key file which describes the product to be kitted. Unless optional subset arguments are
specified, all subsets listed in the descriptor section of the key-file are kitted.
input-path The path name which specifies the top of a hierarchy of files. This hierarchy contains the files which are to be kitted into
subsets.
output-path The name of the directory to be used to store the subset image and data files produced by the command.
subset... The names of individual subsets can be specified by optionally listing them on the command line. If they are specified, only
those subsets will be kitted. The program assumes that all other subsets for the product have been kitted and that their
images are in the directory specified by output-path. The key file specified must contain descriptors for each of the
optional named subsets.
Restrictions
Any subset control programs to be provided with the kit must be located in a directory scps in the working directory where the program is
invoked. If no subset control program is found for a subset, an empty one is created.
Examples
The following example shows the command used to produce a kit using key file ULT400.k in the current directory to package files from the
hierarchy /var/kits/input and place the results in /var/kits/output.
kits ULT400.k /var/kits/input /var/kits/output
The next example shows the same usage, but specifies that only the ULTACCT400 subset is to be created.
kits ULT400.k /var/kits/input /var/kits/output ULTACCT400
Diagnostics
kits: key-file not found
The program was unable to find the key-file specified on the command line.
kits: input-path not found
The program was unable to find the specified input-path.
kits: output-path not found
The program was unable to find the specified output-path.
kits: cannot create instctrl directory.
The program cannot create an instctrl directory under output-path. Check that the user has write permission to output-path.
kits: key-file format error
One of the NAME, CODE, VERS, MI or ROOT values in the specified key-file is either missing or has a null value.
Inventory file pathname not found
The master inventory file pathname specified in the MI entry of the key-file cannot be found. Verify that the pathname is accessible from
the current directory.
Generating media creation information...failed.
There are no records in the master inventory file for a subset which is being kitted. Check the master inventory file for correctness of
content and format.
No such subset in key-file subset subset
A subset name specified on the command line does not have a descriptor line in the key-file. Check the spelling of the subset name on the
command line. Check the contents of the key-file.
compression failed. status = status
The compression option was specified in the key-file and an attempt to compress a subset failed. This should not happen. Run the program
once more.
Files
temporary files.
log of subset packaging activity
See Also
invcutter(1), tarsets(1), stl_comp(5), stl_ctrl(5), stl_image(5), stl_key(5), stl_mi(5), stl_scp(5), setld(8)
Guide to Preparing Software for Distribution on ULTRIX Systems
kits(1)