Sponsored Content
Top Forums Shell Programming and Scripting Looking to find files that are similar. Post 302708569 by jim mcnamara on Monday 1st of October 2012 06:23:50 PM
Old 10-01-2012
define compare. How similar are we talking here? Exactly the same means they are similar? If so use checksums.
Code:
for file in /app/transformation/project1/*.pdf /app/transformation/project2/*.pdf
do
  cksum $file
done  | sort -n   > my pdfs.txt

matching files will all have the same checksum. AIX cksum example output:
Code:
3995432187       1390    file.pdf

where 3995432187 is the checksum, 1390 is the file size in bytes, file1.pdf is the filename. This is why sorting by checksum finds multiple duplicates.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

compare the similar files

I got many pair files, which only have small difference, such as more space, or more empty line, and some unreadable characters. If list by commend "diff", I can see many many difference. So I'd like to write a script to compare the pair files, if 95% contents are same, I will think they are... (2 Replies)
Discussion started by: rdcwayx
2 Replies

2. Shell Programming and Scripting

Find similar entry in a .txt file acting as a database.

May i know how do i go along finding similar entry in a .txt file, which is used a as a "database" and post and error saying the entry existed when we key in the entry. ---------- Post updated at 05:18 PM ---------- Previous update was at 05:16 PM ---------- i mean post an error saying the... (5 Replies)
Discussion started by: santonio
5 Replies

3. UNIX for Dummies Questions & Answers

Find EXACT word in files, just the word: no prefix, no suffix, no 'similar', just the word

I have a file that has the words I want to find in other files (but lets say I just want to find my words in a single file). Those words are IDs, so if my word is ZZZ4, outputs like aaZZZ4, ZZZ4bb, aaZZZ4bb, ZZ4, ZZZ, ZyZ4, ZZZ4.8 (or anything like that) WON'T BE USEFUL. I need the whole word... (6 Replies)
Discussion started by: chicchan
6 Replies

4. Shell Programming and Scripting

Find the similar directory

Hi I have one directory whose name i don't remember exactly only starting letter i know which is Resp. Can you please let me know the command to find the similar directory in the root. Rajesh (3 Replies)
Discussion started by: guddu_12
3 Replies

5. Shell Programming and Scripting

How to find similar values in different files

Hello, I have 4 files like this: file1: cg24163616 15 297 cg09335911 123 297 cg13515808 565 776 cg12242345 499 705 cg22905282 225 427 cg16674860 286 779 cg14251734 303 724 cg19316579 211 717 cg00612625 422 643 file2:... (2 Replies)
Discussion started by: linseyr
2 Replies

6. UNIX for Dummies Questions & Answers

Find the average based on similar names in the first column

I have a table, say this: name1 num1 num2 num3 num4 name2 num5 num6 num7 num8 name3 num1 num3 num4 num9 name2 num8 num9 num1 num2 name2 num4 num5 num6 num4 name4 num4 num5 num7 num8 name5 num1 num3 num9 num7 name5 num6 num8 num3 num4 I want a code that will sort my data according... (4 Replies)
Discussion started by: FelipeAd
4 Replies

7. UNIX for Dummies Questions & Answers

To find similar items in a column

HI, I have a long file which looks like "1xxx_0_1" "1xxx" 500 5 "ABC*3-DEF*3-LL" "2yyy_0_1" "2yyy" 600 10 "ABC*2-DEF*2-LL" "3ddd_0_1" "3ddd" 150 52 "ABC*3-DEF*3-LL" "1xxx_0_1" "1xxx" 500 5 "ABC*3-DEF*3-LL" "2yyy_0_1" "2yyy" 600 10 "ABC*2-DEF*2-LL" ... (3 Replies)
Discussion started by: XXLMMN
3 Replies

8. Shell Programming and Scripting

To find ls of similar pattern files in a directory by passing the variable.

Hi, I have file in my $datadir as below :- SAT_1.txt SAT_2.txt BAT_UD.lst BAT_DD1.lst DUTT_1.txt DUTT_la.txt Expected result :- should get all the above file in $<Filename>_file.lst Below is my code :- for i in SAT BAT DUTT do touch a.lst cd $datadir (1 Reply)
Discussion started by: satishmallidi
1 Replies

9. Solaris

Getting similar lines in two files

Hi, I need to compare the /etc/passwd files from 2 servers, and extract the users that are similar in these two files. I sorted the 2 files based on the user IDs (UID) (3rd column). I first sorted the files using the username (1st column), however when I use comm to compare the files there is no... (1 Reply)
Discussion started by: anaigini45
1 Replies

10. What is on Your Mind?

Similar Threads: More UNIX and Linux Forum Topics You Might Find Helpful Update

Today I change the DB and the PHP code and rebuilt the database for similar threads at the end of each post, increasing from a max of 5 to a max of 10 similar threads per post: More UNIX and Linux Forum Topics You Might Find Helpful It was quite easy to do: 1. Increased the max size of... (17 Replies)
Discussion started by: Neo
17 Replies
vblade-persist(8)					      System Manager's Manual						 vblade-persist(8)

NAME
vblade-persist - manage persistent exported ATA-over-Ethernet devices SYNOPSIS
vblade-persist ls [--no-header] vblade-persist setup shelf slot netif blockdev vblade-persist destroy shelf slot vblade-persist { start | stop | restart | auto | noauto } shelf slot vblade-persist { start | stop | restart | auto | noauto } all vblade-persist mac shelf slot { ls | clear } vblade-persist mac shelf slot { add | del } [ addr ... ] DESCRIPTION
The vblade-persist script is used to show and manipulate persistently-exported ATA-over-Ethernet devices. It has a simple subcommand syn- tax. Persistent AoE device exports can be configured to come up at boot time. For each running persistent AoE export, a symlink pointing to the backing device is created in /dev/etherd/, mirroring the devices seen by clients of the AoE device. MANAGEMENT SUBCOMMANDS
ls [--noheader] vblade-persist ls shows all existing persistent AoE exports. The columns of the output are, in order: AoE Shelf, AoE Slot, Network Inter- face, Backing Device, AutoStart, Status. AutoStart is either "auto" (start automatically at boot), or "noauto" (don't start automatically at boot). Status should be either "run" (running) or "down" (not running). The optional --no-header argument suppresses the header line. This may be convenient for machine-parseable output. setup shelf slot netif source vblade-persist setup creates a new persistent exported AoE block device. You must supply all four additional arguments. These are the same arguments supplied to vblade(8). You should specify source using an absolute path. New devices set up this way are noauto (not brought up automatically at boot) and down (not exported immediately). destroy shelf slot vblade-persist destroy halts any running exported AoE block device managed by vblade-persist and removes the service directory used to man- age it. start shelf slot stop shelf slot restart shelf slot These commands control a specific exported AoE device. Instead of specifying shelf and slot , you can also provide the special keyword all which will act on every exported AoE device. auto shelf slot noauto shelf slot These commands control whether a specific exported AoE device should be started automatically ( auto ) or not ( noauto ) at system boot time. Instead of specifying shelf and slot , you can also provide the special keyword all which will act on every exported AoE device. MAC-ADDRESS FILTERING You can use vblade-persist to restrict access to specific exports by MAC address, using the mac subcommand. mac shelf slot ls List all MAC addresses allowed to access the specified device, one per line. If the list is empty, no MAC address limits are imposed on this device. mac shelf slot clear Remove all MAC address filtering from the specified device. No MAC address limits will be imposed on this device. mac shelf slot add [ addr ... ] Add a MAC address (or more than one) to the list of allowed addresses for the specified device. Note that if there were no MAC addresses listed previously, this will enable MAC address filtering for the device. mac shelf slot del [ addr ... ] Remove a MAC address (or more than one) from the list of allowed addresses for the specific device. Note that if you remove all the MAC addresses from the list, this will disable MAC address filtering for the device. EXAMPLES
Set up /dev/sda2 as shelf 2, slot 3 on the network served by interface eth0. Make sure it starts automatically at boot, and start it up now: vblade-persist setup 2 3 eth0 /dev/sda2 vblade-persist auto 2 3 vblade-persist start 2 3 Limit that same export to MAC addresses aa:bb:cc:dd:ee:ff and 11:22:33:44:55:66: vblade-persist mac 2 3 add aa:bb:cc:dd:ee:ff 11:22:33:44:55:66 Remove all MAC address restrictions on the same export: vblade-persist mac 2 3 clear BUGS
You can't currently use the vblade-persist framework to export a device (or two) with the same shelf/slot identifier on two different net- work interfaces. DEPENDENCIES
The exports themselves are handled by vblade(8). Supervision of the exports and convenient management is enabled by runsv(8), from the runit suite. SEE ALSO
vblade(8), runsv(8) AUTHOR
Daniel Kahn Gillmor <dkg@fifthhorseman.net> vblade-persist 2007-11-11 vblade-persist(8)
All times are GMT -4. The time now is 12:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy