please help immediately

Thread Tools Search this Thread
Operating Systems Linux please help immediately
# 1  
Old 11-01-2007
please help immediately

how can i check if the size of my file is greater than 5MB and if it is so then how can I direct my data to another new file.
the data will be in the form of SQL query
# 2  
Old 11-01-2007
Can you explain the scenario and what you want to redirect?
# 3  
Old 11-01-2007
this will help you to get size of the file:
ls -l filename | awk '{print $5}'

# 4  
Old 11-01-2007
From man find :
-size n[cwbkMG]
File uses n units of space. The following suffixes can be used:

‘b’ for 512-byte blocks (this is the default if no suffix is used)

‘c’ for bytes

‘w’ for two-byte words

‘k’ for Kilobytes (units of 1024 bytes)

‘M’ for Megabytes (units of 1048576 bytes)

‘G’ for Gigabytes (units of 1073741824 bytes)
use find, determine if the file is greater than 5MB and then eventaully copy this file to another, with a different name. HTH, if I got it correctly.
# 5  
Old 11-02-2007
I believe you need to use a "+" in front of the 5M...otherwise it will only look for files exactly 5MB.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Nohup immediately stops.

I try and start a short script nohup the nohup immediately stops. Here's the code #!/bin/sh rm backup.out for i in `cat /home/xxxxx/Allservers.txt` do echo "Logging onto $i" ssh -qt $i '/usr/local/bin/sudo "/src/bkupsa"' done >>backup.out Any ideas? (3 Replies)
Discussion started by: ekrause77
3 Replies

2. Shell Programming and Scripting

please tell immediately

what is the script to take files from ftp to unix server and unzipped the files (1 Reply)
Discussion started by: sunilamarnadh
1 Replies

3. Linux

at scheduling executes job immediately

Hi all, I am trying to schedule a one time job using at. First I do a `date` command to capture current date $ date Fri Aug 8 15:53:20 # shows current date $ at -t 16:00 today #schedule command to run at 4pm at> command1 at> <EOT> #after pressing Crtl D job 6 at 2008-08-08 15:53 and... (1 Reply)
Discussion started by: new2ss
1 Replies

4. Shell Programming and Scripting

To find a character immediately following a specified String

Hello, I have a UNIX file in which data is like this -- ISA*00* *00* *01*006415160 *01*137361242 ... (3 Replies)
Discussion started by: The Observer
3 Replies

5. Programming

Experts !!! I Need HELP immediately..!

HI, I am getting the error : ErrCode:-2 Message:Application Initialisation function Err Params:Could not Load SO/DLL Nothing specific is coming, just the above error. Can anyone tell me how to debug this error. Thanks. (3 Replies)
Discussion started by: amol_helwatkar
3 Replies

6. Shell Programming and Scripting

Please respond immediately

Hi ..please tell me how to modinfy an existing file in a directory, i need commands like to open edit and save n execute the file in BASH. please respond immediately (3 Replies)
Discussion started by: deepti.1104
3 Replies

7. UNIX for Dummies Questions & Answers

I need help immediately. Please help me

Hi Everyone, I am writing a script, in that i want to find out whether my disk space usage capacity extends more than 98%. If my disk space capacity extends more than 98% i want to print that the space capacity is running out of space otherwise i want to print only the capacity of the space... (4 Replies)
Discussion started by: Sheethal
4 Replies

8. AIX

UIDs being overwritten immediately

We have a problem where we delete a user and their associated UID gets dumped back in the UID pool. The if we immediately create a another (new) user, AIX reuses the last UID, the one that was just released. This is causing a problem when reports are being generated because the new users name is... (2 Replies)
Discussion started by: xsys2000
2 Replies

9. Shell Programming and Scripting

Need a Shell Program immediately

Hi Friends, I need a simple shell script(Linux..bash shell) for the below description. Can anyone help me please. I need it very urgently. That is why i cannot write it myself. Objective Create shell scripts using: Simple interactive menus Variables, functions Description Create a... (4 Replies)
Discussion started by: praji
4 Replies
Login or Register to Ask a Question