Sponsored Content
Top Forums Shell Programming and Scripting getting rid of duplicate files Post 92362 by moxxx68 on Friday 9th of December 2005 01:57:49 PM
Old 12-09-2005
too many occurances to rm manually!
will this work...

find ./path -iname "basename" | awk 'BEGIN{arr[$0]++}{var=[$0];var > 0; var++}END{i=[var++]}' | xargs mv --target-directory=dup-dir

%rm dup-dir

looks like it would work if i could use an array to parse the
occurances starting with occurance 1 instead of 0... obviously
this could be in any directory but the way the tree is configured
it doesn't really matter as long as i have one occurance left!

could please use some help...
moxxx68
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Renaming multiple files, to get rid of extension

I have a good script to rename multiple files, but what's the best way I can remove some text from multiple filenames? Say I have a directory with 35 files with a .XLS at the end, how can I rename them to remove the .XLS but keep everything the same, without having to mv manually. Thanks. (6 Replies)
Discussion started by: nj78
6 Replies

2. UNIX for Dummies Questions & Answers

Getting rid of files with no ownership

I am in the process of learning how to do system administration (just on my own Linux machine) and have been working with the find command. One of the things I tried was find / -nouser -o -nogroup I redirected the output of my find query into a text file, and when I did a wc -l on it, it... (1 Reply)
Discussion started by: kermit
1 Replies

3. Shell Programming and Scripting

Finding Duplicate files

How do you delete and and find duplicate files? (1 Reply)
Discussion started by: Jicom4
1 Replies

4. Shell Programming and Scripting

Getting Rid of Having to Write to Flat Files

Ok, so i've been having to write to flat files lately and then making my script read information from the flat file and then work off of that. i dont want to keep doing that because i believe it creates a mess. i like to keep my work all to one script instead of having that one script... (7 Replies)
Discussion started by: SkySmart
7 Replies

5. Shell Programming and Scripting

Find duplicate files

What utility do you recommend for simply finding all duplicate files among all files? (4 Replies)
Discussion started by: kiasas
4 Replies

6. UNIX for Dummies Questions & Answers

how to get rid of last _ in the files name?

ex: I have list of files in a folder. abc_def_geh_.txt abc_.txt abc_def_geh_12345_.txt ab134c_d345345ef_444geh_12345_.txt i need to rename all files to get rid of the _ before .txt result should look like this: abc_def_geh.txt abc.txt abc_def_geh_12345.txt... (2 Replies)
Discussion started by: lv99
2 Replies

7. Shell Programming and Scripting

Remove duplicate files

Hi, In a directory, e.g. ~/corpus is a lot of files and subdirectories. Some of the files are named: 12345___PP___0902___AA.txt 12346___PP___0902___AA. txt 12347___PP___0902___AA. txt The amount of files varies. I need to keep the highest (12347___PP___0902___AA. txt) and remove... (5 Replies)
Discussion started by: corfuitl
5 Replies

8. Shell Programming and Scripting

Duplicate files

Hi Gents, I have 1 files as seen below. 44571009 100 42381900 101 23482389 102 44571009 103 28849007 104 28765648 105 25689908 106 28765648 107 42381900 108 44571009 109 17298799 110 44571009 111 I would like to get something like it 44571009 100 103 109 111 (3 Replies)
Discussion started by: jiam912
3 Replies

9. Shell Programming and Scripting

Trying to get rid of a duplicate output line...

Hi folks, I'm trying to work on a script that will grab a router interface report and generate the numbers of "in use" and "un-used" ports per device. Right now, I've got a cut down of the report as follows: sing /usr/apps/siteName/etc/DCAFT-9K.cmds for send text Connecting using... (11 Replies)
Discussion started by: Marc G
11 Replies

10. Shell Programming and Scripting

Finds all duplicate files

Hi, How would you write bash script that given a directory as an argument and finds all duplicate files (with same contents - by using bytewise comparison) there and prints their names? (6 Replies)
Discussion started by: elior
6 Replies
volsave(8)						      System Manager's Manual							volsave(8)

NAME
volsave - Saves a Logical Storage Manager (LSM) configuration SYNOPSIS
/usr/sbin/volsave [-d dir] OPTIONS
Directs the backup information to the directory specified by dir. This directory must not already exist. DESCRIPTION
You can save the LSM configuration records for a disk group by saving the output of the volprint(8) utility in a description file that the volmake(8) utility can use. The volsave command provides an easy way to save this configuration information for all disk groups. In addi- tion, volsave saves a list of the disks that are under LSM control and their attributes. The LSM configuration can be restored using the volrestore command. The volsave command creates an LSM description set that consists of a header file and other files containing information about the LSM con- figuration (allvol.DF, voldisk.list, and volboot). Refer to the FILES section for details on the contents of these files. By default, the description set is saved to a timestamped directory in /usr/var/lsm/db (for example, /usr/var/lsm/db/lsm.19970727131520.skylark). The -d option can be used with volsave to specify a particular directory for the saved configuration. In this case, the -d option must also be used with volrestore when restoring the configuration. ERRORS
You may receive the following error message when using the -d dir option with the volsave command: Directory dir already exists This message indicates that the directory you specified is already in use. The LSM configuration can only be saved to a directory that does not yet exist. You can specify a new directory name, or enter the volsave command without the -d option and let volsave create a new, timestamped directory in /usr/var/lsm/db. FILES
Default directory containing timestamped subdirectories with LSM description sets. A volmake description file for all volumes, plexes, and subdisks in a disk group. The volsave command creates a separate subdirectory and description file for each disk group on the system. A description of the disks. This file is the output of the voldisk list command. The contents of the /etc/vol/volboot file. A header file for the description set, containing a checksum, a magic number, the date of the file's creation, and the version of the volsave command. SEE ALSO
volmake(4), volrestore(8), volprint(8), volmake(8) Logical Storage Manager volsave(8)
All times are GMT -4. The time now is 07:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy