Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • proper cpu stats Linux/Unix
  • get_vmstat.ksh Linux/Unix
  • Histogram information Oracle
  • Processes parameter and its dependencies on OS kernel parameters Linux/Unix
  • My Minimum Tuning Programs Oracle
  • catall.sh Linux/Unix
  • Oracle Data Direct to TAPE Oracle
  • Jai Shree Ram Oracle
  • Sending SQLPLUS output in HTML format Oracle
  • How to Use DBMS_STATS to Move Statistics to a Different Database Oracle
  • Rename Oracle Instance Name Oracle
  • rm_backup_arch_file.ksh Linux/Unix
  • 10g RAC: Troubleshooting CRS Root.sh Problems Oracle
  • Find long Running Transaction Linux/Unix
  • create database syntax Oracle

find_du.ksh to find # of files, their sizes in current folder and its subdolder

Posted on 10-Oct-2006 By Admin No Comments on find_du.ksh to find # of files, their sizes in current folder and its subdolder

#!/usr/bin/ksh

for dirname in `find . -type “d”`

do

#print “dirname is $dirname”;

tot_files=`ls -rlt $dirname| grep -i “^-” | wc -l`

tot_file_size=`ls -rlt $dirname| grep -i “^-” | awk ‘{tot+=$5} END {print tot/1024/1024}’`

echo “Folder : $dirname, Total Files : $tot_files, Total File Sizes : $tot_file_size MB”

done

Linux/Unix, shell

Post navigation

Previous Post: Looping for remote servers and find its database from oratab file.
Next Post: Some OS level threshold for performance.

Related Posts

  • To see mem usage and CPU usage system wide. Linux/Unix
  • How to find Unix server conguraiton including Server Model number and underlying disk sub-system ( On Solaris) Linux/Unix
  • crontab syntax Linux/Unix
  • secure crt settings Linux/Unix
  • Generate SSH without password authentication. Linux/Unix
  • Some OS level threshold for performance. Linux/Unix

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Oracle Metalink useful notes Oracle
  • Error Handling in Proc Oracle
  • cp_filesystem.sql Oracle
  • Temporary tablespace explaination Oracle
  • The most important Tuning Notes Oracle
  • handling filenname with space Linux/Unix
  • Gathering statistics with DBMS_STATS Oracle
  • proper cpu stats Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme