Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to find total size of all files in a directory.

Status
Not open for further replies.

maxcrook

Programmer
Jan 25, 2001
210
0
0
GB
I have used the df -k . command to find out the size of the file system i am currently in. However I need to know how to find out the size of all the files in my current directory and whether it is in k or blocks etc.

There are 354 files in the directory mentioned
 
ls -la | pg will give you a page by page listing of all the files in the directory you are in, with sizes in bytes. Perhaps I've misunderstood - do you want the size of each individual file, or the total of all the files?
 
Total of all files please - but that is also very handy for the next question i had!
 
max.

cd into the directory in question

du -sk will give you what you require.

Cheers
PSD
IBM Certified Specialist - AIX V4.3 Systems Support
IBM Certified Specialist - AIX V4 HACMP
 
Use the du command. Only problem is that it will recurse through subdirectories.
 
du -sk * will do the job for the files and the directories from the curent path.
:eek:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top