Sponsored Content
Top Forums Shell Programming and Scripting Script to Compare file size and delete the smaller Post 302681641 by JC_1 on Friday 3rd of August 2012 05:51:31 PM
Old 08-03-2012
The file names are random. The extension is the same (that is probably windows talk - sorry). I want the script to look in each directory and delete the smaller of the two files.
e.g.,

directory 1

asdfsdfo72392874983.nii.gz
asdfju07r-3828poafljkao.nii.gz

directory n

asdfopiw4-8rtlkjkkfa.nii.gz
ukjfsaoi04t0ifaf';lk'lk.nii.gz
 

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

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... (1 Reply)
Discussion started by: Aditya.Gurgaon
1 Replies

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

5. Shell Programming and Scripting

zsh compare size pdf and delete bigger?

I have used an script to reduce the size of multiples pdf. This script creates files with the same name but with different extension. The extension of the compressed files is xpdf. Sometimes the "compressed" xpdf are bigger than the "uncompressed"pdf. I want to create a zsh script to compare each... (1 Reply)
Discussion started by: AMDx64BT
1 Replies

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

7. UNIX for Advanced & Expert Users

Physical disk IO size smaller than fragment block filesystem size ?

Hello, in one default UFS filesystem we have 8K block size (bsize) and 1K fragmentsize (fsize). At this scenary I thought all "FileSytem IO" will be 8K (or greater) but never smaller than the fragment size (1K). If a UFS fragment/blocksize is allwasy several ADJACENTS sectors on disk (in a ... (4 Replies)
Discussion started by: rarino2
4 Replies

8. Shell Programming and Scripting

Compress a tar file to smaller size

I have a tar file with name DTT012_GP_20140207.tar and many more with different names of different sizes ranging from 1GB to 4GB. Now my requirement is to extract/not extract these files and then divide it into various parts of size 500MB and save it with different names and then compress... (5 Replies)
Discussion started by: Shaibal_bp
5 Replies

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

10. Shell Programming and Scripting

Script to compare files in 2 folders and delete the large file

Hello, my first thread here. I've been searching and fiddling around for about a week and I cannot find a solution.:confused: I have been converting all of my home videos to HEVC and sometimes the files end up smaller and sometimes they don't. I am currently comparing all the video files... (5 Replies)
Discussion started by: Josh52180
5 Replies
IMAGEMATH(1)							   User Commands						      IMAGEMATH(1)

NAME
ImageMath - part of ANTS registration suite DESCRIPTION
Usage: ./ImageMath ImageDimension OutputImage.ext Operator Image1.ext Image2.extOrFloat some options output text files The last two arguments can be an image or float value Valid Operators : m (multiply) , + (add) , - (subtract) , / (divide) , ^ (power) , exp -- take exponent exp(imagevalue*value) addtozero overadd abs total -- sums up values in an image or in image1*image2 (img2 is the probability mask) Decision -- computes result=1./(1.+exp(-1.0*( pix1-0.25)/pix2)) Neg (Produce Image Negative ) , G Image1.ext s (Smooth with Gaussian of sigma = s ) MD Image1.ext s ( Morphological Dilation with radius s ) , ME Image1.ext s ( Morphological Erosion with radius s ) , MO Image1.ext s ( Morphological Opening with radius s ) MC Image1.ext ( Morphological Closing with radius s ) GD Image1.ext s ( Grayscale Dilation with radius s ) , GE Image1.ext s ( Grayscale Erosion with radius s ) , GO Image1.ext s ( Grayscale Opening with radius s ) GC Image1.ext ( Grayscale Closing with radius s ) D (DistanceTransform) , Segment Image1.ext N-Classes LocalityVsGlobalityWeight-In-ZeroToOneRange OptionalPriorImages ( Segment an Image with option of Priors , weight 1 => maximally local/prior-based ) Grad Image.ext S ( Gradient magnitude with sigma s -- if normalize, then output in range [0, 1] ) , Laplacian Image.ext S normalize? ( laplacian computed with sigma s -- if normalize, then output in range [0, 1] ) , Normalize image.ext opt ( Normalize to [0,1] option instead divides by average value ) PH (Print Header) , Byte ( Convert to Byte image in [0,255] ) LabelStats labelimage.ext valueimage.nii ( compute volumes / masses of objects in a label image -- write to text file ) ROIStatistics LabelNames.txt labelimage.ext valueimage.nii ( see the code ) DiceAndMinDistSum LabelImage1.ext LabelImage2.ext OptionalDistImage -- outputs DiceAndMinDistSum and Dice Overlap to text log file + optional dis- tance image Lipschitz VectorFieldName -- prints to cout & writes to image InvId VectorFieldName VectorFieldName -- prints to cout & writes to image GetLargestComponent InputImage {MinObjectSize} -- get largest object in image ThresholdAtMean Image %ofMean FlattenImage Image %ofMax -- replaces values greater than %ofMax*Max to the value %ofMax*Max stack Image1.nii.gz Image2.nii.gz --- will put these 2 images in the same volume CorruptImage Image NoiseLevel Smoothing TileImages NumColumns ImageList* RemoveLabelInterfaces ImageIn EnumerateLabelInterfaces ImageIn ColoredImageOutname NeighborFractionToIgnore FitSphere GM-ImageIn {WM-Image} {MaxRad-Default=5} HistogramMatch SourceImage ReferenceImage {NumberBins-Default=255} {Number- Points-Default=64} PadImage ImageIn Pad-Number ( if Pad-Number is negative, de-Padding occurs ) Where Image ValueToLookFor maskIm- age-option tolerance --- the where function from IDL TensorFA DTImage TensorColor DTImage --- produces RGB values identifying prin- cipal directions TensorToVector DTImage WhichVec --- produces vector field identifying one of the principal directions, 2 = largest eigenvalue TensorToVectorComponent DTImage WhichVec --- 0 => 2 produces component of the principal vector field , i.e. largest ei- genvalue. 3 = 8 => gets values from the tensor TensorIOTest DTImage --- will write the DT image back out ... tests I/O processes for consistency. MakeImage SizeX SizeY {SizeZ} SetOrGetPixel ImageIn Get/Set-Value IndexX IndexY {IndexZ} -- for example ImageMath 2 outimage.nii SetOrGetPixel Image Get 24 34 -- gets the value at 24, 34 ImageMath 2 outimage.nii SetOrGetPixel Image 1.e9 24 34 -- this sets 1.e9 as the value at 23 34 you can also pass a boolean at the end to force the physical space to be used TensorMeanDiffusion DTImage CompareHeadersAndImages Image1 Image2 --- tries to find and fix header error! output is the repaired image with new header. never use this if you trust your header information. CountVoxelDifference Image1 Image2 Mask --- the where function from IDL stack image1 image2 --- stack image2 onto image1 CorrelationUpdate Image1 Image2 RegionRadius --- in voxels , Compute update that makes Image2 more like Image1 ConvertImageToFile imagevalues.nii {Optional-ImageMask.nii} -- will write voxel values to a file PValueImage TValueImage dof ConvertToGaussian TValueImage sigma-float ConvertImageSetToMatrix rowcoloption Mask.nii *images.nii -- each row/column contains image content extracted from mask applied to images in *img.nii ConvertVector- ToImage Mask.nii vector.nii -- the vector contains image content extracted from a mask - here we return the vector to its spatial origins as image content TriPlanarView ImageIn.nii.gz PercentageToClampLowIntensity PercentageToClampHiIntensity x-slice y-slice z-slice TruncateImageIntensity inputImage {lowerQuantile=0.05} {upperQuantile=0.95} {numberOfBins=65} {binary-maskImage} Fill- Holes Image parameter : parameter = ratio of edge at object to edge at background = 1 is a definite hole bounded by object only, 0.99 is close -- default of parameter > 1 will fill all holes PropagateLabelsThroughMask speed/binaryimagemask.nii.gz initiallabelimage.nii.gz Optional-Stopping-Value -- final output is the propagated label image optional stopping value -- higher values allow more distant propagation FastMarchingSegmentation speed/binaryimagemask.nii.gz initiallabelimage.nii.gz Optional-Stopping-Value -- final output is the propagated label image optional stopping value -- higher values allow more distant propagation ExtractSlice volume.nii.gz slicetoextract --- will extract slice number from last dimension of volume (2,3,4) dimensions ConvertLandmarkFile InFile.txt ---- will convert landmark file between formats. see ants.pdf for description of formats. e.g. ImageMath 3 outfile.vtk ConvertLandmarkFile infile.txt ImageMath 1.9 May 2012 IMAGEMATH(1)
All times are GMT -4. The time now is 07:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy