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
RADIOCTL(1)						    BSD General Commands Manual 					       RADIOCTL(1)

NAME
radioctl -- control radio tuners SYNOPSIS
radioctl [-f file] [-n] -a radioctl [-f file] [-n] name radioctl [-f file] [-n] -w name=value DESCRIPTION
The radioctl command displays or sets various variables that affect the radio tuner behavior. If a variable is present on the command line, radioctl prints the current value of this variable for the specified device. By default, radioctl operates on the /dev/radio device. The options are as follows: -a Print all device variables and their current values. -w name=value Attempt to set the specified variable name to value. -f file Specify an alternative radio tuner device. -n Suppress printing of the variable name. Values may be specified in either absolute or relative forms. The relative form is indicated by a prefix of '+' or '-' to denote an increase or decrease, respectively. The exact set of controls that can be manipulated depends on the tuner. The general format (in both getting and setting a value) is name = value The name indicates what part of the tuner the control affects. Write only controls: search Only for cards that allow hardware search. Can be 'up' or 'down'. Read-write controls: frequency Float value from 87.5 to 108.0. volume Integer value from 0 to 255. mute Mutes the card (volume is not affected), 'on' or 'off'. mono Forces card output to mono, 'on' or 'off'. Only for cards that allow forced mono. reference Reference frequency. Can be 25 kHz, 50 kHz and 100 kHz. Not all cards allow to change the reference frequency. sensitivity Station locking sensitivity. Can be 5 mkV, 10 mkV, 30 mkV and 150 mkV. Not all cards allow to change the station locking sensitivity. All the remaining controls (signal, stereo and card capabilities) are read-only and can be viewed using option -a. ENVIRONMENT
The following environment variable affects the execution of radioctl: RADIODEVICE The radio tuner device to use. FILES
/dev/radio radio tuner device EXAMPLES
The command radioctl -a can produce volume=255 frequency=106.30MHz mute=off reference=50kHz signal=on stereo=on card capabilities: manageable mono/stereo SEE ALSO
radio(4) HISTORY
radioctl command first appeared in OpenBSD 3.0 and NetBSD 1.6. BSD
September 16, 2001 BSD
All times are GMT -4. The time now is 12:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy