Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • OEM-Commnds Oracle
  • metalink all dynamic view reference notes. Oracle
  • executing Function from SQLPLUS prompt Oracle
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • Test Case for Inserting Multiple (2.3 Million rows in 26 Seconds) Oracle
  • Backup and Recovery Scenarios Oracle
  • First Entry in RAC Oracle
  • fkwoindex.sql /* Find FK without Index */ Oracle
  • Roles and Stored Object behaviour Oracle
  • Goog notes on X$ tables Oracle
  • ORA-4031 issue and solution on 09-MAY-2008 Oracle
  • Order by with ROWNUM Oracle
  • Kernel Parameter setting explaination for Processes Parameter Linux/Unix
  • CPU Core related projections AWS
  • move_arch_files.ksh /* Good One */ Linux/Unix

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

  • good linux notes Linux/Unix
  • Guide to Linux System Command Mastery Linux/Unix
  • Nice Article about semaphores and init.ora Processes parameter relations Linux/Unix
  • oracle 10g on linux Linux/Unix
  • Session_info.ksh Linux/Unix
  • Debugging Shell FIles 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 (387)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (336)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024
  • Add new columns in dataframe30-Sep-2023

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • adding new line after specific pattern using sed Linux/Unix
  • OPENING A STANDBY DATABASE IN READ-ONLY MODE Oracle
  • rm_backup_arch_file.ksh Linux/Unix
  • Composite Index creation tip from Vivek Oracle
  • How to find password change date for user Oracle
  • Adding or Dropping Online Redo Log Files When Physical Standby in place Oracle
  • grep multuple patterns Linux/Unix
  • Oracle Identifiers Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme