Sponsored Content
Top Forums Shell Programming and Scripting Script to compare partial filenames in two folders and delete duplicates Post 302989383 by looney on Thursday 12th of January 2017 12:21:47 AM
Old 01-12-2017
Hi Shaky, Please try
Code:
orig=Original
orig_ext=*.mpeg
opti=Optimized
opti_ext=*.mp4

for i in $orig/$orig_ext
do
original_file=`basename ${i%.mpeg}`
        for l in $opti/$opti_ext
        do
                optimized_file=`basename ${l%.mp4}`
                if [[ "$original_file" == "$optimized_file" ]]; then
                echo "file $optimized_file match with $original_file."
                rm "$i"
                echo "Original File $i removed."
                fi
done
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script to partial delete

guys i need some help in writing a shell script, what i am trying to write is a shell script that can delete generated trace files my software usually generated everyday, i will give an example to make it easy to understand root@cms-db # pwd /pcard17/trace root@cms-db # ls -l HSM_VERIF.TRC*... (4 Replies)
Discussion started by: q8devilish
4 Replies

2. Shell Programming and Scripting

Compare files in two folders and delete missing ones

I do not know much about shell scripting so I am at a loss here. If someone can help me, that would be great! I have two directories /dir1 /dir2 I need to delete all files from /dir1 and that does not have a correspondent file in /dir2. It should NOT check file suffixes in /dir2 . Why?... (20 Replies)
Discussion started by: kaah
20 Replies

3. Shell Programming and Scripting

Delete duplicates via script?

Hello, i have the following problem: there are two folders with a lot of files. Example: FolderA contains AAA, BBB, CCC FolderB contains DDD, EEE, AAA How can i via script identify AAA as duplicate in Folder B and delete it there? So that only DDD and EEE remain, in Folder B? Thank you... (16 Replies)
Discussion started by: Y-T
16 Replies

4. Shell Programming and Scripting

Remove the partial duplicates by checking the length of a field

Hi Folks - I'm quite new to awk and didn't come across such issues before. The problem statement is that, I've a file with duplicate records in 3rd and 4th fields. The sample is as below: aaaaaa|a12|45|56 abbbbaaa|a12|45|56 bbaabb|b1|51|45 bbbbbabbb|b2|51|45 aaabbbaaaa|a11|45|56 ... (3 Replies)
Discussion started by: asyed
3 Replies

5. Shell Programming and Scripting

HELP! Need to compare 2 folders on 2 different systems, and copy unmatched filenames to other folder

This has been tearing my hair out. I need to: 1: compare server1:/data/archive/ to server2:/data/archive/ (through rsync, ssh, etc) 2: filenames that don't match, get copied (scp) to server2:/data/ server1 and server2 have ssh, scp, rsync access between eachother. Is there any option in... (3 Replies)
Discussion started by: damang111
3 Replies

6. Shell Programming and Scripting

Linux Script to compare two folders and copy missing files

Hi, I need help in shell scripting. If someone can help me, that would be great! Problem. I want Linux Script to compare two folders and copy missing files. Description. I have two directories /dir1 /dir2 I need to copy all distinct/new/unique/missing files from /dir1 and that... (1 Reply)
Discussion started by: S.Praveen Kumar
1 Replies

7. Shell Programming and Scripting

Script to compare substrings of multiple filenames and move to different directory

Hi there, I am having trouble with a script I have written, which is designed to search through a directory for a header and payload file, retrieve a string from both filenames, compare this string and if it matches make a backup of the two files then move them to a different directory for... (1 Reply)
Discussion started by: alcurry
1 Replies

8. Shell Programming and Scripting

Script to delete folders and files from a prompt

Hi Everyone, I work for GE Money IVR as a DB analyst and the environment on which I work is Solaris 5.0 server and Oracle 11g. I got a project in which I have to clean up the folders and files which are not used in DB. I copied an existing script and edited it, dont know this is the... (5 Replies)
Discussion started by: habeeb506
5 Replies

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

10. UNIX for Beginners Questions & Answers

How can I remove partial duplicates and manipulate text?

Hello, How can I remove partial duplicates and manipulate text in bash using either awk, grep or sed? Thanks. Input: ted,"foo,bar,zoo" john-son,"foot,ben,zoo" bob,"bar,foot" Expected Output: foo,ted bar,ted zoo,ted foot,john-son ben,john-son (4 Replies)
Discussion started by: tara123
4 Replies
HDHOMERUN_CONFIG(1)													       HDHOMERUN_CONFIG(1)

NAME
hdhomerun_config - A utility used for maintaining and controlling a Silicon Dust HDHomeRun SYNOPSIS
hdhomerun_config <id> command [options] DESCRIPTION
The HDHomeRun is a networked digital television receiver with two tuners. It can tune QAM64, QAM128, QAM256, or 8VSB television streams. It is most useful in the United States where QAM is very commonly used for cable transmission and 8VSB (ATSC) for Over The Air television transmission. This utility can be used to control the HDHomeRun, update it, and query information about it. The only requirement for the utility is that the HDHomeRun be hooked up on the same subnet as the computer peforming the actions. The HDHomeRun will receive an address via DHCP, so if static addressing is in use on the network instead, the device will not function. FEATURES
1) Multiple tuners. For those nights that several primetime shows are on at the same time, you won't need to worry. 2) QAM & OTA support. Both tuners can be set as either QAM or OTA. This way if only a few channels are available by one variety, but you would still like those channels, each tuner can be used for the different connections. 3) Networked. The HDHomeRun can be accessed by any computer on the local network by using VLC, MythTV, or SageTV. 4) Upgradable. Silicon Dust regularly releases firmware updates for the HDHomeRun. These can be used to add support for upcoming record- ing standards, changing frequencies, or stability. OPTIONS
discover Locates all HDHomeRun(s) on your network and displays their ID <id> get help Displays supported configuration for current firmware revision <id> get <item> Obtains the current value for the given configuration <item> <id> set <item> Sets the new current value for the given configuration <item> <id> scan <tuner> <file> Performs a QAM/8VSB scan using <tuner> and saves results to <file> <id> save <tuner> <file> Saves a copy of the stream that <tuner> is tuning to <file> <id> upgrade <file> Installs <file> as a firmware upgrade on the HDHomeRun WARNING: Don't attempt to upgrade the HDHomeRun with something other than a Silicon Dust firmware update. Using the May 12, 2007 firmware, here are the currently supported configuration items: /tuner<n>/channel <modulation>:<freq|ch> Get/set modulation and frequency /tuner<n>/channelmap <channel map> Get/set channel to frequency map /tuner<n>/filter 0x<nnnn>-0x<nnnn> [...] Get/set PID filter /tuner<n>/program <program number> Get/set MPEG program filter /tuner<n>/target <ip>:<port> Get/set target IP for tuner /tuner<n>/status Display status of tuner /tuner<n>/streaminfo Display stream info /tuner<n>/debug Display debug info for tuner /ir/target <ip>:<port> Get/set target IP for IR /lineup/location <countrycode>:<postcode> Get/Set location for lineup /lineup/location disabled Disable lineup server connection /sys/version Display firmware version /sys/copyright Display firmware copyright /sys/debug Display debug info AUTHOR
The HDHomeRun configuration utility was written by Silicon Dust to support their product. This manual page was written by Mario Limonciello <superm1@ubuntu.com>, for the Ubuntu project (but may be used by others). COPYRIGHT
Copyright 2005-2006 Silicon Dust Engineering Ltd. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. May 26, 2007 HDHOMERUN_CONFIG(1)
All times are GMT -4. The time now is 02:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy