checkingthe size of all the .txt , .ext files in all directories ..


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting checkingthe size of all the .txt , .ext files in all directories ..
# 1  
Old 09-27-2008
checkingthe size of all the .txt , .ext files in all directories ..

hai,

i am new to unix scripting & learning unix scripting and doing some assignments....

i have an assignment as follows,

i want to check the size of the text file and .ext files in all directories,
if any one of them is greater than 100mb , i have to display those files..


example:
1.if input from user is /root directory to check for all .txt,.ext files
size, then the script must check all the text file, .ext file size and display them if it is greater than 100mb
2. if the input is /root/kamal/text_assign.txt, then the script should check the directory /root/kamal directory to check the size of text_assign .txt, if it exceeds the size 100mb it should display the file name..

pls help me in solving this assignment....it would be greatful if any one help me in solving this...

Thanks in advance....
kamal
# 2  
Old 09-27-2008
homewok questions are frowned upon....

but I'll point you in a direction ;-)

have a look at the find command - see what you can come up with...
# 3  
Old 09-27-2008
...and string together some switches like "-iname" and "-size".

Last edited by unSpawn; 09-27-2008 at 08:05 AM.. Reason: Heh, avoid too much pointing :-]
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare two txt files,mismatches will be in new txt files

Hi, Below are the sample data for txt files. txt file 1 Partnumber|catgroup_id 10001082|46016 10001093|4680 10001093|386003 10001093|463004 10003251|683 10003251|63005 10003252|463005 10003252|4683 10003260|463005 10003260|4683 10003264|4683 10003264|463005 13420000|67... (5 Replies)
Discussion started by: Ankita Talukdar
5 Replies

2. UNIX for Advanced & Expert Users

Directories converted into files with the same size

Hi Gurus, I know this sounds weird, We have encountered many incidents where some directories on several Solaris 10 boxes, will be converted to files with the same size. for example the file below : -rw-r--r-- 1 rkadm redknee 5027399 Apr 15 00:02 dump This was a directory created... (5 Replies)
Discussion started by: aladdin
5 Replies

3. Shell Programming and Scripting

Recursively *.ext files using find

HI, Getting the syntax error " find: missing conjunction" for the below code D1_DIR=/x/y/z D1_NAME=file_name FILE_DIR=pset for file in `find ${D1_DIR}/${D1_NAME} -name "*\.${FILE_DIR}" /dev/null {} \;` do echo $file done #Trying to find all the files with *.pset... (5 Replies)
Discussion started by: cvsanthosh
5 Replies

4. Shell Programming and Scripting

Script to monitor for new file with ext .err and size > 0 bytes and perform a action or command

Hi All, I need to create a script to monitor a dir for new files with ext .err and also it should b a non empty files. and perform a action or command . We have a new ETL application that runs on a linux server, every times a etl fails it creates a .err file or updates the existing .err... (4 Replies)
Discussion started by: MAKHAN
4 Replies

5. Shell Programming and Scripting

How to list all the directories, sub directories in a mount along with size in ascending order?

Hi , I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In a particular mount, have to list all the directories and sub directories along with size of the directory and sub directory in ascending order. Please help me in this regard and many... (4 Replies)
Discussion started by: nmakkena
4 Replies

6. Shell Programming and Scripting

Shell script to rename files with .1,.2,.3 ....ext respectively

Hey Guys.... Just need some help as I am not proficient in Unix shell script... Doubt: --------------- Suppose there will be some of the following files inside a directory called OUT ... Path: - /appdb1/product/batch/rms/OUT files inside OUT directory:- POSU_75002_20090127_20090129035442... (4 Replies)
Discussion started by: satyajit007
4 Replies

7. Solaris

list files .txt and .TXT in one command

Dear experts, In a directory i have both *.TXT and *.txt files. I have a script- for file in `ls *.txt`; do mv $file /tmp/$file How to list both *.txt and*.TXT file in one command so that script will move both .txt or .TXT whatever it find. br//purple (4 Replies)
Discussion started by: thepurple
4 Replies

8. UNIX for Dummies Questions & Answers

How to delete files with certain ext?

Hi All, How can I work on following request? Delete all the html files older than 29th November from the path - /dding/ting/tong/unixyang/output (4 Replies)
Discussion started by: tonyvirk
4 Replies

9. UNIX for Dummies Questions & Answers

diff on compressed files with tar.gz ext

how can I find out what is the difference between two tar.gz files without uncompressing them. thank you. (7 Replies)
Discussion started by: rakeshou
7 Replies
Login or Register to Ask a Question