Sponsored Content
Top Forums Shell Programming and Scripting Shell script to find size of subdirectories Post 302748899 by rangarasan on Thursday 27th of December 2012 05:00:50 AM
Old 12-27-2012
du

Hi,

Try this one,


Code:
cd dir;
ls -ltr|awk -v l=2 '/^d/{c++;a[c]=$9;}END{for(i=c-l+1;i<=c;i++){print a[i];}}'|xargs -I '{}' du -sh {}

You can specify the n number of latest files which you want in variable l.

Cheers,
RangaSmilie
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to Find file size

Hi, I am writing a script which takes the input file name and concat as a new file by appending a "1" to the file name. However i am not able to get the size of this new file. I am not sure where i am going wrong. Please check the script and help me get this working. #!/bin/sh ... (1 Reply)
Discussion started by: ragsnovel
1 Replies

2. UNIX for Dummies Questions & Answers

shell script to find files by date and size

Hi, I have a directory PRIVATE in which I have several directories and each of these have several files. Therefore, I need to find those files by size and date to back up those files in another directory. I don't know how to implement this shell script using ''find''. appreciate any... (1 Reply)
Discussion started by: dadadc
1 Replies

3. Shell Programming and Scripting

unix script to check whether particular file exists and to find its size

I want to find the size of particular file exists in a particular directory and i wnt to zip it. In the below mentioned code it should check the MQ.log in the particular directory.Please correct my code so that it will check for particular MQ.log but i could not able to check whether the... (9 Replies)
Discussion started by: Balachandar
9 Replies

4. Shell Programming and Scripting

Command/script to find size of Unix Box ?

Please could anyone provide me the Command/script to find the size and usage of Unix box ASAP ? (6 Replies)
Discussion started by: sakthifire
6 Replies

5. Shell Programming and Scripting

Shell Script to find the tablespace size in oracle.

Hi, I need to execute a script to find the tablespace size in oracle.But i get an error.:confused: Script Executed:- #!/bin/ksh ORACLE_SID= oracelinstance ORACLE_HOME= oracle path PATH=$ORACLE_HOME/bin export ORACLE_SID ORACLE_HOME PATH sqlplus... (4 Replies)
Discussion started by: vighna
4 Replies

6. Shell Programming and Scripting

find process size script

Hello i am working on a project here is part of script that i need a help in get process SpectroSERVER current size if it exceed 3850 MB then #pkill -TERM ArchMgr and wait to succfull shutdown message from the log file to proceed to the next step #tail -f $SPECROOT/SS/DDM/ARCHMGR.OUT... (7 Replies)
Discussion started by: mogabr
7 Replies

7. Shell Programming and Scripting

Shell:Find a word in files in a directory and subdirectories

I'm looking to write a ksh code with will be alble to find a word like 'toto' in all files going from my current directory. eg. /doc ----------->have: text.c which "toto" /doc/usr-------->have: build.pc, help.java which "toto" /doc/usr/cach -->have: test.sh which "toto" /doc/build... (4 Replies)
Discussion started by: yeclota
4 Replies

8. UNIX for Dummies Questions & Answers

Command for total number of files (and size) across subdirectories?

Hi all... I have a directory called dbrn. This directory contains an unknown number of subdirectories which in turn contain an unknown number of files. What I want to know is: How many files with extention .ABC can be found in /dbrn across all subdirecties, and what is the total size for... (9 Replies)
Discussion started by: Beun
9 Replies

9. Shell Programming and Scripting

Script to find & replace a multiple lines string across multiple php files and subdirectories

Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ? The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories. So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Discussion started by: spfc_dmt
12 Replies
Pango::Context(3)					User Contributed Perl Documentation					 Pango::Context(3)

NAME
Pango::Context HIERARCHY
Glib::Object +----Pango::Context METHODS
direction = $context->get_base_dir $context->set_base_dir ($direction) o $direction (Pango::Direction) gravity = $context->get_base_gravity Since: pango 1.16 $context->set_base_gravity ($gravity) o $gravity (Pango::Gravity) Since: pango 1.16 fontdescription = $context->get_font_description $context->set_font_description ($desc) o $desc (Pango::FontDescription) fontmap = $context->get_font_map Since: pango 1.6 gravity = $context->get_gravity Since: pango 1.16 gravityhint = $context->get_gravity_hint Since: pango 1.16 $context->set_gravity_hint ($hint) o $hint (Pango::GravityHint) Since: pango 1.16 language = $context->get_language $context->set_language ($language) o $language (Pango::Language) @families = $context->list_families font = $context->load_font ($desc) o $desc (Pango::FontDescription or undef) fontset = $context->load_fontset ($desc, $language) o $desc (Pango::FontDescription) o $language (Pango::Language or undef) matrix or undef = $context->get_matrix Since: pango 1.6 $context->set_matrix ($matrix) o $matrix (Pango::Matrix or undef) Since: pango 1.6 fontmetrics = $context->get_metrics ($desc, $language) o $desc (Pango::FontDescription) o $language (Pango::Language or undef) ENUMS AND FLAGS
enum Pango::Direction o 'ltr' / 'PANGO_DIRECTION_LTR' o 'rtl' / 'PANGO_DIRECTION_RTL' o 'ttb-ltr' / 'PANGO_DIRECTION_TTB_LTR' o 'ttb-rtl' / 'PANGO_DIRECTION_TTB_RTL' o 'weak-ltr' / 'PANGO_DIRECTION_WEAK_LTR' o 'weak-rtl' / 'PANGO_DIRECTION_WEAK_RTL' o 'neutral' / 'PANGO_DIRECTION_NEUTRAL' enum Pango::Gravity o 'south' / 'PANGO_GRAVITY_SOUTH' o 'east' / 'PANGO_GRAVITY_EAST' o 'north' / 'PANGO_GRAVITY_NORTH' o 'west' / 'PANGO_GRAVITY_WEST' o 'auto' / 'PANGO_GRAVITY_AUTO' enum Pango::GravityHint o 'natural' / 'PANGO_GRAVITY_HINT_NATURAL' o 'strong' / 'PANGO_GRAVITY_HINT_STRONG' o 'line' / 'PANGO_GRAVITY_HINT_LINE' SEE ALSO
Pango, Glib::Object COPYRIGHT
Copyright (C) 2003-2009 by the gtk2-perl team. This software is licensed under the LGPL. See Pango for a full notice. perl v5.12.1 2010-07-05 Pango::Context(3)
All times are GMT -4. The time now is 01:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy