Sponsored Content
Full Discussion: Files have same size
Top Forums Shell Programming and Scripting Files have same size Post 302717327 by RudiC on Thursday 18th of October 2012 03:25:41 AM
Old 10-18-2012
This may be a random approach as it depends on how your files are listed by ls. Proposal on hand reverses the order of files and prints the last name of files of identical size, then. BTW, file name is $9 on my ls -l version.To remove files, use command substitution like $(...):
Code:
ls -lr | awk '
                $1!~/^d/ {++size[$5]; name[$5]=$9}
                END {for (i in size) if (size[i] > 1) print name[i]}
                '

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sort files by size

Is there a way to sort files by size using the ls command? thanks in advance (1 Reply)
Discussion started by: AMD
1 Replies

2. Shell Programming and Scripting

bash script working for small size files but not for big size files.

Hi, I have one file stat. Stat file contents are as follows: for example. H50768020040913,00260100,507680,13,0000000643,0000000643,00000,0000 H50769520040808,00260100,507695,13,0000000000,0000000000,00000,0000 H50770620040611,00260100,507706,13,0000000000,0000000000,00000,0000 Now i... (1 Reply)
Discussion started by: davidpreml
1 Replies

3. Shell Programming and Scripting

size of files

hello Experts,can any one tell me that i have a folder data in linux. and there are three files A,B,C in the directory. cany any one tell me the command that which can tell me how much space is occupied by each file and its free space also for example FILES USED SPACE FREE SPACE A ... (1 Reply)
Discussion started by: shary
1 Replies

4. Shell Programming and Scripting

This script cut size of files "Lol" change string in files

Basic: find . -type f -name “*.txt” -print | awk '{gsub("Ontem", "AntesdeOntem", $0); print > FILENAME}' *.txt The idea is in folder /home/myapontamentos I have some files and i need to change in all them the word "ontem" to "antesdeontem". But bigger files are cut (size i mean)... (4 Replies)
Discussion started by: single
4 Replies

5. Shell Programming and Scripting

Merge files of differrent size with one field common in both files using awk

hi, i am facing a problem in merging two files using awk, the problem is as stated below, file1: A|B|C|D|E|F|G|H|I|1 M|N|O|P|Q|R|S|T|U|2 AA|BB|CC|DD|EE|FF|GG|HH|II|1 .... .... .... file2 : 1|Mn|op|qr (2 Replies)
Discussion started by: shashi1982
2 Replies

6. UNIX for Dummies Questions & Answers

copy only new files or files of a different size

hello i would like to copy files from 1 location to a nother, but it has only to copy files which are newer or have a different filesize. all has to be logged to a copy.log file (als skipped files should be in the log) is this possible with the cp command (1 Reply)
Discussion started by: arnoldg
1 Replies

7. UNIX for Dummies Questions & Answers

How to list files which have same size?

Hi guys, I need to do 100 files comparison after I sorted the files. There are no specific key for sorting so i plan to arrange the files based on the file size. The command that i used to sort the files by size is as per below:- ls -l | sort +4rn | awk '{print $5, $9}' The problem that i... (3 Replies)
Discussion started by: shahril
3 Replies

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

9. UNIX for Advanced & Expert Users

Files by size

I am new to Unix and need help. I have several files of different sizes Example: 1 GB , 2GB , 500 mb ,200mb and even small sizes. What I want is I want to pick files and sum of the combined file size should be less than 3 Gb and move them to a different directory. when I do ls -ltr I want to pcik... (1 Reply)
Discussion started by: pyarigreat
1 Replies

10. UNIX for Beginners Questions & Answers

Files by size

I am new to Unix and need help. I have several files of different sizes Example: 1 GB , 2GB , 500 mb ,200mb and even small sizes. What I want is I want to pick files and sum of the combined file size should be less than 3 Gb and move them to a different directory. when I do ls -ltr I want... (5 Replies)
Discussion started by: pyarigreat
5 Replies
quot_vxfs(1M)															     quot_vxfs(1M)

NAME
quot_vxfs: quot - summarize ownership on a VxFS file system SYNOPSIS
filesystem ... DESCRIPTION
displays the number of 1024-byte blocks in the specified VxFS filesystem that are currently owned by each user. filesystem is either the name of the directory on which the file system is mounted or the name of the device containing the file system. Options recognizes the following options: Specifies file system type. Generate a report for all mounted file systems. Report file system size instead of user statistics. The option generates histogram statistics in 3-column format: Column 1: File size in blocks. Sizes are listed in ascending order up to 499 blocks per file. Files occupying 499 or more blocks are counted together on a single line as 499-block files, but column 3 is based on actual number of blocks occupied. Column 2: Number of files of size indicated in column 1. Column 3: Cumulative total blocks occupied by files counted in current plus all preceding lines. The option overrides the and options. Display the number of files and space occupied by each user. Calculate the number of blocks in the file based on file size rather than actual blocks allocated. The option does not account for sparse files (files with holes in them). Accept ncheck(1M) data as input. The following pipeline will produce a list of all files and their owners: Display three columns containing the number of blocks not accessed in the last 30, 60, and 90 days. Validate the command line options, but do not execute the command. If the options specified are valid, echoes the complete command line. If the options specified are not valid, it prints an error message. Operands recognizes the following operand: filesystem Name of the directory on which the VxFS file system is mounted or the name of the device containing the file system.. EXAMPLES
The following examples show the output of using various options. AUTHOR
Disk Quotas were developed by the University of California, Berkeley, Sun Microsystems, Inc., and HP. FILES
Mounted file system table Password file (contains user names). SEE ALSO
du(1), find(1), ls(1), fstyp(1M), mount(1M), ncheck(1M), quot(1M), repquota(1M), quota(5). quot_vxfs(1M)
All times are GMT -4. The time now is 11:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy