Need to know the users folder size


 
Thread Tools Search this Thread
Operating Systems Solaris Need to know the users folder size
# 1  
Old 12-08-2010
Need to know the users folder size... "du -sh < userlist" ???

Hi Forum,

I need to know the size of some user home folders.

I've exported an account list from an Active Directory and wrote it into a file like:

user_1
user_2
user...
user_n

and tried "du -sh < filename", which doesn't work. Get no results.

I don't need the size of all home folders, only some, but at least 300.

du -sh {user_1,user_2...} works fine, but I don't want to set hundreds of commas. Well, could do it in Excel, but I'd like to do it in a more elegant way. Smilie

Any suggestion how to do it better?

Last edited by borsti007; 12-08-2010 at 05:49 PM..
# 2  
Old 12-08-2010
Code:
while read line; do du -sh $line; done < filename

# 3  
Old 12-08-2010
Code:
du -sh $(<filename)

# 4  
Old 12-09-2010
It works! Thanks! :-)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Complex Query regarding folder size

Hi, I provide the path to a folder. I would like so drill in each folder inside the folder i gave and show me the size in human readable form du -sh <folder-name> of the top 8 folders with maximum sizes. For example: Path of the folder: "/opt/app/myapp" has these directories. ls... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. Shell Programming and Scripting

Getting folder more than 100K size

Hi , I am trying to get the folder details having size more than sme specified value and also the name of the folder should be like TEST. so 1. In the current directory search for all the folders having name like TEST 2. Print the list of the folder names having size more than 100... (3 Replies)
Discussion started by: Anupam_Halder
3 Replies

3. Shell Programming and Scripting

UNIX script to get folder size

can any one help me with a unix command to find out the size of each directory for files placed between 2 dates i.e., date1 & date 2? (3 Replies)
Discussion started by: Codesearcher
3 Replies

4. Shell Programming and Scripting

Folder level size monitoring

Hi All, I have a requirement to monitor the sub-directories under /home in a way that if the the folder size increases by 30 GB in a span of like an hour then it needs to send email alerts listing what as the actual size was and what's the current size which the subject listing the sub-directory... (25 Replies)
Discussion started by: Shailesh6
25 Replies

5. Red Hat

Sorting folder size not working

I am using du -h --max-depth=2 to get list of folders by size upto 2 levels down. Problem is I am not able to sort them in max folder size. Normally this can be achieved by using du -k | sort -nr * but I can't use it here since it conflicts (the -s argument) with the --max-depth=2 argument. ... (1 Reply)
Discussion started by: rockf1bull
1 Replies

6. UNIX for Dummies Questions & Answers

I am trying to get the total size of a folder?

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

7. UNIX for Dummies Questions & Answers

size of a folder ?

hi, is possible to calculate the size of a folder using ls ? ls -s works only for files.. thanks (2 Replies)
Discussion started by: aneuryzma
2 Replies

8. UNIX for Dummies Questions & Answers

Need help in finding Folder Size

Hi, I would like to find the size of a folder. When I run the command du -k It is going through all the sub-folder and files and taking really much time. Is there any command to get the complete directory size without showing the sub-folder and file size. Appreciate your response. ... (3 Replies)
Discussion started by: TonySolarisAdmi
3 Replies

9. UNIX for Dummies Questions & Answers

Limit Folder Size

Is there a way to limit a certain folder size(e.g. Documents, Desktop)? :) (2 Replies)
Discussion started by: tisdmin
2 Replies

10. Shell Programming and Scripting

Scripting to find the size of the folder

Will any body help me by writing a script in unix to the find out the size of the Main folder which has some 5 to 6 subfolders which in turn has some file in each of these subfolders regards victorvvk (2 Replies)
Discussion started by: victorvvk
2 Replies
Login or Register to Ask a Question