Searching same filenames in different partitions


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Searching same filenames in different partitions
# 1  
Old 02-19-2014
Searching same filenames in different partitions

Hi,

We are doing some migration work. The same files may exist in different partition/mountpoints. We may place it in a single place, hence we don't want any duplicates...we will rename the file names if we know the files which has duplicates(by file name)).

It would be nice if a script searches each partition and list out the names in the following order.

Enter the mountpoints you want to search separated by ","

user input : /mountpoint/di2/subdir/, /part/dir, /part2/dir

test1 does exist in the following partitions/paths (fullpath)
test1 in /part/dir, /part2/dir, /mountpoint/di2/subdir/

Last edited by saravanapandi; 02-19-2014 at 04:50 PM.. Reason: spell check
# 2  
Old 02-19-2014
Use the find command and don't use commas. I suggest not being so wordy with "does exist". If it exists the find command will tell you.
# 3  
Old 02-19-2014
can you send me sample find

Hi,

I don't understand " I suggest not being so wordy with "does exist"

Can you provide a sample find command...

Thank you in advance
# 4  
Old 02-19-2014
Hi.

There are commands that can locate duplicate files. See find same size file for scripts that use 2 such commands, fdupes and rdfind.

Best wishes ... cheers, drl
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Searching range of filenames witn and without numbers on the end

So I'm grepping for the following right now: ls -la /somedirectory/*.log* | awk '{print $9}' The problem with this is that I get the following output: /somedirectory/errors_1_foo.log /somedirectory/errors_1_foo.log.1 /somedirectory/errors_1_foo.log.2... (4 Replies)
Discussion started by: LinuxRacr
4 Replies

2. UNIX for Dummies Questions & Answers

Searching for a pattern from filenames stored in a file

Hi, I have got some 10 filenames stored in a file or displayed in the console as a result of some query i made.. Now I need to open each of these files and search for a pattern in these 10 files.. Can someone help me with this? Thanks, Jean (9 Replies)
Discussion started by: jeanjkj
9 Replies

3. Shell Programming and Scripting

searching a file with a specified text without using conventional file searching commands

without using conventional file searching commands like find etc, is it possible to locate a file if i just know that the file that i'm searching for contains a particular text like "Hello world" or something? (5 Replies)
Discussion started by: arindamlive
5 Replies

4. UNIX for Dummies Questions & Answers

Partitions.

Hi All, My colleague says . On some boxes we have /var/,/opt are inside root and on some they are not on root they are separately. So please any one explain me what actually the difference is. Thanks is Advance. (3 Replies)
Discussion started by: rama krishna
3 Replies

5. UNIX for Advanced & Expert Users

Partitions

Hello masters, Actually, i am user of Ubuntu, but I want to use Debian too. I have a computer with a product key for w7 so i will use too, only for games... The structure I have thought is the next with 1TiB of capacity. Primary: 50 GB NTFS for W7 Extended: Logical: 20 GB FAT32... (3 Replies)
Discussion started by: albertogarcia
3 Replies

6. UNIX for Dummies Questions & Answers

Searching by date range from filenames

Hello all, i have tons of files in folder named like this (yyyymmdd): bookcollection20100729 bookcollection20100730 bookcollection20100731 bookcollection20100801 bookcollection20100802 etc. I need to find files with date range in there names lets say from 2010.07.30 - 2010.08.02 ... (10 Replies)
Discussion started by: Whit3H0rse
10 Replies

7. UNIX for Dummies Questions & Answers

Searching for specific filenames

Hi I would like to know how to search through a directory and pull out files that has a specific pattern in the filename. For example if the filename has "bsc" in it, then that file must be moved to another directory where I will perform some operations on it. I know grep can be used, but I'm... (17 Replies)
Discussion started by: ladyAnne
17 Replies

8. UNIX for Advanced & Expert Users

Searching filenames containing certain text???

Suppose there are multiple files containing certain text "abc". How to print the name of all such files with a single command from unix prompt? Thanks in advance (6 Replies)
Discussion started by: skyineyes
6 Replies

9. Shell Programming and Scripting

searching for filenames with search strings in another file

Hi, I have 5 files in a directory. emp1_usage.txt emp2_usage.txt emp3_usage.txt emp4_usage.txt emp5_usage.txt I am using sqlldr to get the contents of the above 5 files and store it in a temp table and update my original table using temp table. for f in *emp*.txt do sqlldr... (3 Replies)
Discussion started by: pathanjalireddy
3 Replies

10. UNIX for Advanced & Expert Users

partitions

HI. i installed solaris on a x86 machine and i only partition for 4 gig when it suppose to be 8. i only using 4 gig right now how can i start using the other four. please help, thanks in advance Meeh (2 Replies)
Discussion started by: souldier
2 Replies
Login or Register to Ask a Question