Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • checking connectivity between two servers Linux/Unix
  • Mutating Table Error while using database trigger Oracle
  • Export With Query Another Example. Oracle
  • My FTP Job Scheduling for www.pvmehta.com PHP/MYSQL/Wordpress
  • Proc code Oracle
  • Find sort details from Db find_sort.sql Oracle
  • findx.sql /* Find Indexes on specified USER.TABLE_NAME */ Oracle
  • Index Range Scan Oracle
  • findinfo.sql (SQL for getting CPU and Active session info) Oracle
  • Temporary Tablespsace Temp tablespace behaviour Oracle
  • Library cahe Latches and internal explaination Oracle
  • database trigger failing Oracle
  • To find all disk io ( EMC as well as local) Linux/Unix
  • First Entry in RAC Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry 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

  • Jai Shree Ram Linux/Unix
  • Deleting first line and lastline of a file using sed Linux/Unix
  • How to find Unix server conguraiton including Server Model number and underlying disk sub-system ( On Solaris) Linux/Unix
  • Generate SSH without password authentication. Linux/Unix
  • How to know Number of CPUs on Sun Box Linux/Unix
  • Running some SQL on multiple databases connecting using monitoring userid and password Linux/Unix

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Distributed Transaction Troubleshooting. Oracle
  • JSON/XML Types in Oracle Oracle
  • grep multuple patterns Linux/Unix
  • ORA-8031 issue and solution if it is occuring due to truncate. Oracle
  • Rename Tablespace Oracle
  • How can I tell if ASO is installed ? Oracle
  • avail.sh ( find filesystem spae usage) Linux/Unix
  • usnsql.sql Displays information about UNDO segments with sql statements Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme