disk usage and home directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting disk usage and home directory
# 1  
Old 04-19-2009
disk usage and home directory

Hi guys just a quick question how could i come up with a way so i wont have to hard code my home directory into the base_cmd directory?

I only want to list files and directories but no sub directories that take up the most disk usage

Code:
base_cmd=`basename /home/m/mmatrik/*/`
du -h -k base_cmd | sort -nr | head -10

thanks

Last edited by Yogesh Sawant; 04-20-2009 at 05:23 AM.. Reason: added code tags
# 2  
Old 04-19-2009
base_cmd=`basename /home/m/mmatrik/*/`

i tried using $HOME/*/ It seems to work ok however it does not look for hidden files as well how would i get it to look at hidden files also?
# 3  
Old 04-19-2009
Hint: To show size of hidden files:
Code:
du -k .??*

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Disk usage monitoring and record the disk used in last 24 hour

HI I am Trying to edit the below code to send email every day with difference of disk utilized in for last 24 hours but instead getting same usage everyday. can you please help me to point out where my calculation is going wrong. Thank you. ================= #!/bin/bash TODAY="at $(date... (0 Replies)
Discussion started by: Mi4304
0 Replies

2. Solaris

SunOS confusing root directory and user home directory

Hello, I've just started using a Solaris machine with SunOS 5.10. After the machine is turned on, I open a Console window and at the prompt, if I execute a pwd command, it tells me I'm at my home directory (someone configured "myuser" as default user after init). ... (2 Replies)
Discussion started by: egyassun
2 Replies

3. What is on Your Mind?

Bit usage: folding at home

This is a charitable cause for spending bits. You may have heard of the folding at home initiative: Folding@home - Main. Many individuals and companies are folding at home and perhaps it is an idea to pay forum members to fold for them and pay them in bits. The way it would work is that someone... (14 Replies)
Discussion started by: figaro
14 Replies

4. UNIX for Dummies Questions & Answers

Command to display the space usage (memory usage) of a specific directory.

Hi all, Can you please tell me the command, with which one can know the amount of space a specific directory has used. df -k . ---> Displays, the amount of space allocated, and used for a directory. du -k <dir name> - gives me the memory used of all the files inside <dir> But i... (2 Replies)
Discussion started by: abhisheksunkari
2 Replies

5. Solaris

Restricting SFTP user to a defined directory and home directory

Hi, I've created solaris user which has both FTP and SFTP Access. Using the "ftpaccess" configuration file options "guest-root" and "restricted-uid", i can restrict the user to a specific directory. But I'm unable to restrict the user when the user is logged in using SFTP. The aim is to... (1 Reply)
Discussion started by: sftpuser
1 Replies

6. Solaris

current CPU usage, memory usage, disk I/O oid(snmp)

Hi, I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP. I want the oids for above tasks. can you please tell me that Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies

7. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

8. Shell Programming and Scripting

disk usage

fdisk -l shows me the total disk size. How can I see, how much disk space is free or available? (5 Replies)
Discussion started by: tjay83
5 Replies

9. UNIX for Advanced & Expert Users

disk usage (df vs du)

displaying the disk usage using df and displaying the disk usage using du -sk gives me different results: 1st case: df -k |grep users 2nd case: cd /users; du -sk sometimes this difference is 50 gigabyte!!! do you have any idea about this situation? (8 Replies)
Discussion started by: gfhgfnhhn
8 Replies
Login or Register to Ask a Question