What amount of store occupy only files in a directory?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting What amount of store occupy only files in a directory?
# 1  
Old 10-09-2010
What amount of store occupy only files in a directory?

Hello I'm trying to do an exercise programming in bash where I have to get only the store of files in a directory but NOT all capacity of the directory.

I probe with: du -sh "$directory"*` but I get all the capacity and I probe with ls command but I couldnt.
Are there any way to get only files capacity of a directory?

Thank you so much!
# 2  
Old 10-09-2010
Do you mean the exact size of the files as shown with ls -l?
# 3  
Old 10-09-2010
Quote:
Originally Posted by Franklin52
Do you mean the exact size of the files as shown with ls -l?
um no, I'm not sure, I think that I have to get the size only the files and not the size of a directory and subdirectorys.

could you understand me?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to manipulate a text file and store each version for every changes in a directory?

I attached both picturehttps://1drv.ms/t/s!Aoomvi55MLAQh1jODfUxa-xurns_ and *.txt file of a sample work file. In this file Reactions which only start with "r1f", "r2f", "r3f"......and so on. And for each reaction the reaction rates is situated couple of lines later with a "+" sign. For each... (1 Reply)
Discussion started by: Atta
1 Replies

2. Solaris

Will softlinks occupy space in Solaris10

I have a pen drive1 with UFS file system and it has 43G used. It has a hell lot of soft links to other files which are located in a second pen drive2. We partitioned the file system on sun sparc machine, such that / has around 150G space.Now when we are copying the files from pen drive 1 to / on... (3 Replies)
Discussion started by: crackperl
3 Replies

3. Shell Programming and Scripting

How to take the filenames from a directory and store into a file??

hi, how can i take the file names from a directory and store only the filenames in the file. suppose i have a directory which contains the following files and subdirectories. $ ls -ltr total 16 -rw-rw-r-- 1 adm etc 4 Aug 6 20:37 s1.txt -rw-rw-r-- 1 adm etc 4 Aug 6 20:37 s2.txt... (11 Replies)
Discussion started by: Little
11 Replies

4. UNIX for Dummies Questions & Answers

Delete X amount of similar files in a directory

Need a Unix command to save the last 20 versions of a file in a specific directory and delete everything else. Date is irrelevant. Anyone aware of such an animal? In my test, I came up with: ls -t1 /tmp/testfile* | tail -n +20 | xargs rm I don’t quite trust the author though! (1 Reply)
Discussion started by: rwsherman
1 Replies

5. Shell Programming and Scripting

How to store files names from a directory to an array

Hi I want to store the file names into an array. I have written like this but I am getting error. declare -A arr_Filenames ls -l *.log | set -A arr_Filenames $(awk '{print $9}') index=0 while (( $index < ${#arr_Filenames })); do Current_Filename=${arr_Filenames} ... (5 Replies)
Discussion started by: dgmm
5 Replies

6. Shell Programming and Scripting

How to tar large amount of files?

Hello I have the following files VOICE_hhhh SUBSCR_llll DEL_kkkk Consider that there are 1000 VOICE files+1000 SUBSCR files+1000DEL files When i try to tar these files using tar -cvf backup.tar VOICE* SUBSCR* DEL* i get the error: ksh: /usr/bin/tar: arg list too long How can i... (9 Replies)
Discussion started by: chriss_58
9 Replies

7. AIX

Fastest way to count big amount of files in sub directory

Hi, what happened is we want to count all the files in a directory and inside this directory got many folders and so take long time to count it. Already run for about few minutes but still not done. The command we use to count is find . -type f | wc -l Just wondering if there is any other... (9 Replies)
Discussion started by: ngaisteve1
9 Replies

8. Shell Programming and Scripting

Store number in a directory

hi all, this is some code in c...i want to write script for this... for(i=0;i<10;i++) { store i in backup directory; } (1 Reply)
Discussion started by: AbhijitIT
1 Replies

9. Shell Programming and Scripting

deleting a varying amount of lines from a list of files

I did search the posts for info on this and while there were some in the ballpark, none addressed this specifically. (also I tried to post this once it said I was logged out, so hopefully I'm not sending a duplicate here). I have a set of files (250 +/-) where I need to delete the first "$x"... (4 Replies)
Discussion started by: benair
4 Replies

10. UNIX for Advanced & Expert Users

Amount of files Backuped on to tape

My question is how much can you actually backup to a 160m tape and a 112m tape? i am trying to split all files and directories to it own section and what i am trying to do is find out much megabytes can each tape store so i know which tape to use. (4 Replies)
Discussion started by: GTI
4 Replies
Login or Register to Ask a Question