Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to test for a specific file size Post 99648 by Bab00shka on Monday 20th of February 2006 10:50:35 AM
Old 02-20-2006
to get the file size

file_size=`ls -l <path_to_file>| awk '{ print $5 }'`

then do an if

if [ $file_size -lt <size> ]
then
exit
fi
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Test to see if a drive is mounted at a specific point

I have a script that backs up our storage drive daily to one external drive and weekly to another. What I'd like to do is find a way, in the script, to test whether the drives are mounted so that it doesn't accidentally fill up the main drive in the event of a drive failure, etc. Any ideas on how... (1 Reply)
Discussion started by: spectre_240sx
1 Replies

2. Shell Programming and Scripting

how to test for file existence using file size?

ok im doing this in a normal shell. i need to check the file in the script. how should i write the if else statment? if the filesize contains 0kb then it will echo out file contains nothing else if the script contains more than 0kb then it will echo out file exist. any one care to help?... (3 Replies)
Discussion started by: forevercalz
3 Replies

3. Shell Programming and Scripting

Find the size of a single specific file

As I'm a newbie to UNIX, very newbie in fact, could anyone humour me and tell me how I'd find just the file size in bytes for a specific file? Or at least just the specific line from the ls -a for the file - call it file1 I know this sounds bad but I don't seem to be getting very far at this... (3 Replies)
Discussion started by: nortypig
3 Replies

4. AIX

Creat a File with a Specific Size

Hi everybody, Is there a command that can create a new file with a specific size? Thanks in advance. (3 Replies)
Discussion started by: aldowsary
3 Replies

5. Solaris

command to find out total size of a specific file size (spread over the server)

hi all, in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders... please help me, how can i find the total size of these specific files in the server... (3 Replies)
Discussion started by: abhinov
3 Replies

6. UNIX for Dummies Questions & Answers

Print folder size ordered by pattern value of specific file type :-) ! challenge !

Hello dear unix command line friends ! I'm looking for a simple combinaison of ls & awk (maybe grep) to print: list of folders of a directory |_ ordered by size like what I have with $ du -sk ./* | sort -rn printing that result: 8651520 ./New Virtual Machine_1 8389120 ./Redhat ... (1 Reply)
Discussion started by: holister
1 Replies

7. Shell Programming and Scripting

Search a test file for specific words

I have the need to search a text file from my unix script to determine if it contains the strings of: 'ERROR' and/or 'WARNING'. By using Grep I can search the file and return a where one of these strings exists. Like this: cat myfile.txt | grep ERROR Output: PROCESS ERROR HERE ... (3 Replies)
Discussion started by: buechler66
3 Replies

8. UNIX for Dummies Questions & Answers

look for file size greater than "0" of specific pattern and move those to another directory

Hi , i have some files of specific pattern ...i need to look for files which are having size greater than zero and move those files to another directory.. Ex... abc_0702, abc_0709, abc_782 abc_1234 ...etc need to find out which is having the size >0 and move those to target directory..... (7 Replies)
Discussion started by: dssyadav
7 Replies

9. HP-UX

How to view specific file size in HP UX?

Dear, Can anyone inform me the command to view specific file size in megabyte in hp-ux? (2 Replies)
Discussion started by: makauser
2 Replies

10. Shell Programming and Scripting

Files test How to recover a specific variable

Hi everyone !;) I'm Arnaud and I'm new on this forum, I begin in the Shell. Let me explain, I want to test the presence of file, so far so good. Below, my code : if && && ; then Pgsql ; else echo \nLe fichier $fichier n\'existe pas ; I would like to recover in a... (16 Replies)
Discussion started by: Arnaudh78
16 Replies
lnptest2(1)						      General Commands Manual						       lnptest2(1)

NAME
lnptest2 - LNP Client Test Application #2 (shorter test) SYNOPSIS
lnptest2 DESCRIPTION
lnptest2 is an LNP Daemon test client used to test the connection between a client LNP program (in this case lnptest2) and the LNP daemon through the Ir Tower to a corresponding test program running in an RCX. See the FILES section for the location of the RCX test program source code (distributed with this package). OPTIONS
lnptest2 does not support command-line options. USAGE
To run the test: - compile the lnptest2.c RCX program - start the lnpd daemon - download the lnptest2.lx program to the RCX - at the RCX, run the program just downloaded to the RCX - run this lnptest2 program - inspect the output looking for lack of failure messages FILES
/usr/share/doc/lnpd/examples/rcx In this directory is the source to the RCX-side program which is called lnptest2.c but written to be compiled against BrickOS. SEE ALSO
lnptest(1), lnpdll(1), lnpd(8) You can find additional documentation in /usr/share/doc/lnpd (on Debian GNU/Linux systems) AUTHOR
lnptest2 was written by Michael Obenland <mobenland@users.sourceforge.net> This man page was written by Stephen M Moraco <stephen@debian.org> January 23, 2005 lnptest2(1)
All times are GMT -4. The time now is 08:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy