Sponsored Content
Top Forums Shell Programming and Scripting How to compare size of two file which is in one directory Post 302274666 by Aditya.Gurgaon on Thursday 8th of January 2009 05:15:48 AM
Old 01-08-2009
How to compare size of two file which is in one directory

I have two file in a Directory.I want a script which will compare the Size of Two file.
Can Anyone Help me on this:


linasplg11:/opt/dataout/kk/linasplg11 # cat size

-rwxrwxrwx 1 root root 16658 Jan 8 13:58 lina_IP_SIP_1231325621210.xml

-rwxr-xr-x 1 root root 16672 Jan 8 14:30 lina_IP_SIP_1231326111273.xml
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to compare file size after ftp?

Is possible if I want to campare file size on source and destination after ftp transfer? If anybody know, please explain to me. (1 Reply)
Discussion started by: icemania
1 Replies

2. Shell Programming and Scripting

compare file size from a output file from a script

Hi guys, firstly I'm working on SunOS 5.10 Generic_125100-10 sun4u sparc SUNW,Sun-Fire-V240 I've made a script to compress two directory and then send them to an other server via ftp. This is working very well. Inside theis script I decide to log usefull data for troubleshooting in case of... (7 Replies)
Discussion started by: moustik
7 Replies

3. Shell Programming and Scripting

to write a script to compare the file size in the current directory and previous dir

hi, i am new to this site. i want to write a script to compare the file size of the files in the current dir with the files in the previous directory. the files name will be same, but the filename format will be as xyzddddyymm.txt. the files will arrive with the month end date(i want to... (5 Replies)
Discussion started by: tweety
5 Replies

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

5. UNIX for Dummies Questions & Answers

PSFTP- Compare file size

Hi, I'm using PSFTP to transfer files from one machine to a virtual machine with UBUNTU OS installed on it. I'm trying to find a way to make sure the files that I'm uploading / downloading are being uploaded/ downloaded properly. I want to compare the size of the local file and the remote... (0 Replies)
Discussion started by: sessie
0 Replies

6. Shell Programming and Scripting

How to delete some of the files in the directory, if the directory size limits the specified size

To find the whole size of a particular directory i use "du -sk /dirname".. but after finding the direcory's size how do i make conditions like if the size of the dir is more than 1 GB i hav to delete some of the files inside the dir (0 Replies)
Discussion started by: shaal89
0 Replies

7. Shell Programming and Scripting

How to compare if the size of the directory is more than 500MB in unix

I use du -sk command to find the size of the directory but when i use the result of 'du -sk' into if statement its throwing error.. Could u solve with this..? (14 Replies)
Discussion started by: shaal89
14 Replies

8. Shell Programming and Scripting

Script to Compare file size and delete the smaller

I am pretty new to scripting, so I appreciate your advice in advance. The problem: 100 directories each containing 2 files that have the same extension with random names. The only attribute that discriminates the files is size. I would like to write a script that compares the files for size... (6 Replies)
Discussion started by: JC_1
6 Replies

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

10. Shell Programming and Scripting

Compare file size and then copy/overwrite

// Redhat I have this code working, but need to add one more qualification so that I don't overwrite the files. #!/bin/sh cd /P2/log/cerner_prod/millennium/archive/ for f in * do || continue #If this isn't a regular file, skip it. && continue #If a backup already... (2 Replies)
Discussion started by: Daniel Gate
2 Replies
mlocate.db(5)							File Formats Manual						     mlocate.db(5)

NAME
mlocate.db - a mlocate database DESCRIPTION
A mlocate database starts with a file header: 8 bytes for a magic number ("mlocate" like a C literal), 4 bytes for the configuration block size in big endian, 1 byte for file format version (0), 1 byte for the "require visibility" flag (0 or 1), 2 bytes padding, and a NUL-terminated path name of the root of the database. The header is followed by a configuration block, included to ensure databases are not reused if some configuration changes could affect their contents. The size of the configuration block in bytes is stored in the file header. The configuration block is a sequence of vari- able assignments, ordered by variable name. Each variable assignment consists of a NUL-terminated variable name and an ordered list of NUL-terminated values. The value list is terminated by one more NUL character. The ordering used is defined by the strcmp () function. Currently defined variables are: prune_bind_mounts A single entry, the value of PRUNE_BIND_MOUNTS; one of the strings 0 or 1. prunefs The value of PRUNEFS, each entry is converted to uppercase. prunepaths The value of PRUNEPATHS. The rest of the file until EOF describes directories and their contents. Each directory starts with a header: 8 bytes for directory time (seconds) in big endian, 4 bytes for directory time (nanoseconds) in big endian (0 if unknown, less than 1,000,000,000), 4 bytes padding, and a NUL-terminated path name of the the directory. Directory contents, a sequence of file entries sorted by name, follow. Directory time is the maximum of st_ctime and st_mtime of the directory. updatedb(8) uses the original data if the directory time in the database and in the file system match exactly. Directory time equal to 0 always causes rescanning of the directory: this is necessary to handle directories which were being updated while building the database. Each file entry starts with a single byte, marking its type: 0 A non-directory file. Followed by a NUL-terminated file (not path) name. 1 A subdirectory. Followed by a NUL-terminated file (not path) name. 2 Marks the end of the current directory. locate(1) only reports file entries, directory names are not reported because they are reported as an entry in their parent directory. The only exception is the root directory of the database, which is stored in the file header. AUTHOR
Miloslav Trmac <mitr@redhat.com> SEE ALSO
locate(1), updatedb.conf(5), updatedb(8) mlocate Jan 2007 mlocate.db(5)
All times are GMT -4. The time now is 06:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy