Sponsored Content
Top Forums UNIX for Dummies Questions & Answers du - Disk Usage for only files and NOT directories. Post 302330378 by RRVARMA on Wednesday 1st of July 2009 04:49:39 AM
Old 07-01-2009
MySQL du - Disk Usage for only files and NOT directories.

Hello,

Could any one help me how to find the Disk Usage for all the files in the running directory and the sub directories without the disk usage of the directory. I mean to say, i need only the file names without the size of the directories.

See, i used this command

du -a .|sort -nr|more

here i'm getting even the size of directories. I need only the files in each directory. Could you help me please. Thanks in advance.

Note: I'm using MP-RAS and i find du -l doesn't work out.

------------------------------------
Like to add some more..

I found that ls -lu gives the files in the order that they were accessed (even if it is read and not modified). I'm trying to find some command or simple logic where i can filter the filenames that are large in size and NOT accessed for a longer duration of time.

Even a discussion or clue will also be appreciated. (but it should be genuine please).
Thanks a lot.

Last edited by RRVARMA; 07-01-2009 at 06:13 AM.. Reason: Adding some more information.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Disk Usage

Im using solaris 8 on a Sunfire 280r. Is there a command to show you how much disk space is being used in gigabytes or megabytes. I dont think theres an option for this using the df command. not for solaris anyway. thanks (3 Replies)
Discussion started by: lewisoco
3 Replies

2. 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

3. 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

4. UNIX for Dummies Questions & Answers

How to trace the big files causing high disk usage

Hi All, One very urgent issue and I need your help. I have two V490 servers installed with Sun Solaris 10. I have traced out that the disk usage is running out of space for both the servers. Currently the /dev/md/dsk/d10 device is 91% in one server and another is 56% and it is increasing... (1 Reply)
Discussion started by: ailnilanjan
1 Replies

5. Red Hat

Disk usage showing 100% after deleting files also | Red Hat Linux 3.2.2-5

My Redhat Linux system is always showing 100& disk usage. I have removed almost all the files, but no use and I am always getting 100% disk usage.!! Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda2 36337384 36066352 0 100% / I can... (7 Replies)
Discussion started by: sanoop
7 Replies

6. Shell Programming and Scripting

Perl Script to find the disk usage and to delete the files which is consuming more space

Hi All, I have written a script to check the file system usage and to delete the files which is consuming more space.Please check whether the script is corrcet #Script Starts here #!/usr/local/bin/perl #Program to find the disk space and to delete the older files #Checks the type of OS... (8 Replies)
Discussion started by: arunkarthick
8 Replies

7. HP-UX

Disk Usage

Hi Experts, glance is showing disk util 100% on of production domain and while collecting sar data using sar -d 5 5, avserv for some of the disks are more than 10 miliseconds. Need your advise on steps that needs to be taken to reduce the disk utilitzation. device %busy avque r+w/s ... (2 Replies)
Discussion started by: sai_2507
2 Replies

8. Shell Programming and Scripting

Disk usage with links pointing to files on same FS

I want count size of all directories on my current File System including size of links only if the target of these links is on same filesystem. I tried below but it gives size of link target even if its on a different FS: du -skL * also the -x option did not help. Any help. (2 Replies)
Discussion started by: pratikgupta123
2 Replies

9. Programming

Pipe usage error while visiting directories

To begin with FYI, I really struggled with the question before asking to simplify as much as I can around 1 hour and to increase the code's readability I neglect error checks. I intend to communicate parent and child using PIPE. In the following program I do traverse given path and its... (2 Replies)
Discussion started by: beginnerboy
2 Replies

10. 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
DUREP(1)						    Disk Usage Report Generator 						  DUREP(1)

NAME
durep - disk usage report generator SYNOPSIS
durep [OPTIONS]... [DIRECTORY] DESCRIPTION
durep creates disk usage reports with bar graphs, allowing one to easily deduce which directories are using the most space. Although durep can produce text output similar to du, its real power lies in the ability to store reports in a file, which can then be viewed as a web page with the supplied cgi script. OPTIONS
Options are grouped into three distinct sections. Text Output Options These options are for controlling the text report output. -td, --text-depth=N Limit text report on directories to depth N. No directories below this level will be shown in the report. -hs, --hide-size=N[bkmg] Do not display entries using N Bytes/KB/MB/GB or less (default Bytes). This is to reduce clutter in the reports. It allows you to remove small files from the text report. -sd, --show-date Display the modification date of the file or directory in the report. -ns, --nosort Do not sort results by size. Leaves results in the order in which they were scanned, which is highly dependent on the file system. -q, --quiet Do not produce text output. This stops the creation of a text report, and is useful when you are only interested in generating a save-file for use with the web report. File Options These options control load and save files. -sf, --save-file=FILE Save the results of the scan into this file. This can be loaded for a text report, but is generally used by the cgi script to display web reports. The filename should end in .ds (it is appended if it does not). -lf, --load-file=FILE Load the results of a scan from this file. This takes the place of scanning a directory. Inclusion options (described below) will not take effect if this option is used. -d, --desc=DESCRIPTION Give a description to be stored in the save-file. This is displayed on the web report summary page. -c, --collate==DIR Collate the save-files in the given directory. This creates a durep.cds file, which is used by the cgi script to manage and display save-files. See Web Reports section below for more detail. Inclusion Options These options control which directories and files should be included in the report. -f, --files Do not descend into sub-directories, only report files. -x, --one-file-system Do not traverse file systems. This is similar to the -x option for du, allowing easy checking of an entire file system such as /. -cp, --collapse-path=PATTERN Hide entries below paths that match PATTERN. This allows you to conceal the contents of certain directories in the report. You may wish perhaps to show home directories in a report but not show their content in which case you could use the option "-cp '/home'". -ep, --exclude-path=PATTERN Ignore paths that match PATTERN. This works in a similar manner to "-cp" above, except it excludes the directory from the scan itself. -cf, --coalesce-files==N[bkmg] Coalesces entries for files below the given size into one entry. This is useful for reducing clutter in reports. WEB REPORTS
Since version 0.9, durep no longer directly generates html files for its web reports. It now uses a cgi script that reads data from save- files. The script will handle multiple save-files, potentially from multiple hosts, so you can consolidate your reports into one place. Copying save-files from other hosts is left as an exercise for the reader. It is necessary to collate the save-files before viewing them via the cgi script. This process creates the file "durep.cds" which contains meta-data about all of the save-files. From this a summary page is shown where you can choose which report you wish to view. The collation must be done any time a save-file is added or overwritten. The cgi-script has some configurable variables at the top. These tell the script where to look for the css file and the graphic used for the bar graphs. There are also options to set whether the modification date, and/or the options used to create the save-file should be shown. These are both set to 1 by default. As always, you should take care when installing the cgi script. I've done my best, but I make no guarantees about its security. It would probably be unwise to allow this script to be accessed from the Internet at large. EXAMPLES
1. durep -td 2 This would print the directory tree starting from the current directory to depth 2. 2. durep -f /var/spool/mail This might be useful for keeping a check on the mail directory. The "-f" switch tells durep to just scan files and not descend into directories. 3. durep -x -cp "/(etc|usr/share)" -ep "/var" -sf /var/lib/durep/root.ds / This more complicated version does the following. It scans the root file system only, collapses the contents of any paths beginning /etc or /usr/share and skips the contents of the /var directory. It saves the output of this report into the file /var/lib/durep/root.ds. No text report is produced. 4. durep -lf /var/lib/durep/root.ds -hs 1m This reads the save-file /var/lib/durep/root.ds and produces a text report from it, hiding any files below 1 megabyte. 5. durep -c /var/lib/durep This collates any save-files in /var/lib/durep. SEE ALSO
du(1), perl(1) AUTHOR
Damian Kramer <psiren@hibernaculum.net> durep version 0.9 2012-05-12 DUREP(1)
All times are GMT -4. The time now is 11:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy