Sponsored Content
Full Discussion: filtering by file size
Top Forums UNIX for Dummies Questions & Answers filtering by file size Post 13481 by nir on Thursday 17th of January 2002 06:22:05 PM
Old 01-17-2002
filtering by file size

Hi !

I wanted to know how can i filter files by "size range".
like : getting all the files that are bigger than 100 byte and smaller than 200 byte ?

I want to make it as a script...

I noticed the unix command : find . -size +100c
but i also want limit it's upper bounds.
so something like :
find . -size +100c -200c
or
find . -size +100c && -200c

doesn't work...
What can i do ?

i also tried to use the "size" command on a file , but it doesn't return one value (the size in bytes).

w8ing 4 your answers...
 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

find with file size and show the size

Hi All... is the below command be modified in sucha way that i can get the file size along with the name and path of the file the below command only gives me the file location which are more than 100000k...but I want the exact size of the file also.. find / -name "*.*" -size +100000k ... (3 Replies)
Discussion started by: rpraharaj84
3 Replies

3. Solaris

Directory size larger than file system size?

Hi, We currently have an Oracle database running and it is creating lots of processes in the /proc directory that are 1000M in size. The size of the /proc directory is now reading 26T. How can this be if the root file system is only 13GB? I have seen this before we an Oracle temp file... (6 Replies)
Discussion started by: sparcman
6 Replies

4. UNIX for Dummies Questions & Answers

Filtering a file

I have a list of directories looking something like; /usr/local/1/in /usr/local/1/out /usr/local/1/archive /usr/local/2/in /usr/local/2/out /usr/local/2/archive /usr/local/3/in /usr/local/3/out /usr/local/3/archive Is there a way I can filter the out and archive directories so I... (5 Replies)
Discussion started by: JayC89
5 Replies

5. Shell Programming and Scripting

The scripts not able to make the file to size 0, every times it go back to its original size

#!/bin/sh ########################################################################################################## #This script is being used for AOK application for cleaning up the .out files and zip it under logs directory. # IBM # Created #For pdocap201/pdoca202 .out files for AOK #1.... (0 Replies)
Discussion started by: mridul10_crj
0 Replies

6. Shell Programming and Scripting

Script to read file size and send email only if size > 0.

Hi Experts, I have a script like $ORACLE_HOME/bin/sqlplus username/password # << ENDSQL set pagesize 0 trim on feedback off verify off echo off newp none timing off set serveroutput on set heading off spool Schemaerrtmp.txt select ' TIMESTAMP COMPUTER NAME ... (5 Replies)
Discussion started by: welldone
5 Replies

7. UNIX for Dummies Questions & Answers

Filtering records from 1 file based on some manipulation doen on second file

Hi, I am looking for an awk script which should help me to meet the following requirement: File1 has records in following format INF: FAILEd RECORD AB1234 INF: FAILEd RECORD PQ1145 INF: FAILEd RECORD AB3215 INF: FAILEd RECORD AB6114 ............................ (2 Replies)
Discussion started by: mintu41
2 Replies

8. Programming

[c] How to calculate size of the file from size of the buffer?

Hi, Can I find size of the file from size of the buffer written? nbECRITS = fwrite(strstr(data->buffer, ";") + 1, sizeof(char), (data->buffsize) - LEN_NOM_FIC, fic_sortie); Thank You :) (1 Reply)
Discussion started by: ezee
1 Replies

9. Shell Programming and Scripting

Filtering first file columns based on second file column

Hi friends, I have one file like below. (.csv type) SNo,data1,data2 1,1,2 2,2,3 3,3,2 and another file like below. Exclude data1 where Exclude should be treated as column name in file2. I want the output shown below. SNo,data2 1,2 2,3 3,2 Where my data1 column got removed from... (2 Replies)
Discussion started by: ks_reddy
2 Replies

10. UNIX for Dummies Questions & Answers

Ls directory size reporting byte size instead of file count

I have been searching both on Unix.com and Google and have not been able to find the answer to my question. I think it is partly because I can't come up with the right search terms. Recently, my virtual server switched storage devices and I think the problem may be related to that change.... (2 Replies)
Discussion started by: jmgibby
2 Replies
pack(1) 						      General Commands Manual							   pack(1)

Name
       pack, pcat, unpack - compress and expand files

Syntax
       pack [ - ] [ -f ] name...

       pcat name...

       unpack name...

Description
       The  command stores the specified files in a compressed form.  Wherever possible (and useful), each input file name is replaced by a packed
       file name.z with the same access modes, access and modified dates, and owner as those of name.  The  -f	option	forces	packing  of  name.
       Using  this option you can cause an entire directory to be packed even if some of the files cannot benefit from it.  If is successful, name
       is removed.  Packed files can be restored to their original form using or

       The command uses Huffman (minimum redundancy) codes on a byte-by-byte basis.  If a hyphen (-) is used as an argument, an internal  flag	is
       set that causes the number of times each byte is used, its relative frequency, and the code for the byte to be printed on the standard out-
       put.  Additional occurrences of a hyphen (-) in place of name causes the internal flag to be set and reset.

       The amount of compression obtained depends on the size of the input file and the character frequency distribution.  Because a decoding tree
       forms  the first part of each .z file, it is usually not worthwhile to pack files smaller than three blocks, unless the character frequency
       distribution is skewed, which may occur with printer plots or pictures.

       Typically, text files are reduced to 60-75% of their original size.  Load modules, which use a larger character set and have a more uniform
       distribution of characters, show little compression.  The packed versions are about 90% of the original size.

       The command returns a value that is the number of files that it failed to compress.

       No packing occurs if one of the following is true:

       o    The file appears packed.

       o    The file name exceeds 12 characters.

       o    The file has links.

       o    The file is a directory.

       o    The file cannot be opened.

       o    No disk storage blocks can be saved by packing.

       o    A file called already exists.

       o    The .z file cannot be created.

       o    An I/O error occurred during processing.

       The  last  segment of the file name must not exceed 12 characters to allow space for the appended .z extension.	Directories cannot be com-
       pressed.

       The command does for packed files what does for ordinary files, except that can not be used as a filter.  The specified files are  unpacked
       and written to the standard output.  Thus, to view a packed file named name.z use:
       pcat name.z
       or just:
       pcat name
       To make an unpacked copy, say nnn, of a packed file named (without destroying name.z) use the command:
       pcat name >nnn
       The command returns the number of files it was unable to unpack.  Failure may occur if:

	      the file name (exclusive of the .z) has more than 12 characters;
	      the file cannot be opened;
	      the file does not appear to be the output of pack.

       The  command expands files created by For each file name specified in the command, a search is made for a file called name.z (or just name,
       if name ends in .z).  If this file appears to be a packed file, it is replaced by its expanded version.	The new file  has  the	.z  suffix
       stripped from its name, and has the same access modes, access and modification dates, and owner as those of the packed file.

       The  command returns a value that is the number of files it was unable to unpack.  Failure occurs for the same reasons that it occurs in as
       well as for the following:

	      a file with the unpacked name already exists;
	      if the unpacked file cannot be created.

       This command is present only for compatibility.	In general, the command runs faster and gives better compression.

See Also
       cat(1), compress(1)

																	   pack(1)

Featured Tech Videos

All times are GMT -4. The time now is 06:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy