3
votes
2answers
2k views

find files not matching list of filename patterns

I find myself needing to find and identify extraneous files (out of about 900K files on a 2T drive). There are lots of files that I want to keep, and I have filename patterns for these known good ...
0
votes
1answer
626 views

Rename files and directories with a special characters on solaris machines

The target of the following code ( commands ) is to rename files/directories and also support files/directories with a special characters as "@" or "." etc those commands are run fine on Linux ...
0
votes
2answers
3k views

How to use the find command in Perl script?

Could someone tell me why the find command always go to the root directory but not the directory that is specified in $srceDir? my $srceDir = "/mnt/SDrive/SV/Capture Data/"; my $find_cmd = 'find ...
0
votes
1answer
106 views

Error trying to call find from perl

use warnings; use File::Find; my $srceDir = "//mnt/Share_Drive/Verizon PM&T/Capture Files/"; opendir(DIR, $srceDir) or die "Can't open $srceDir: $!"; my @files = (find -type f -newermt "12 Feb ...
2
votes
2answers
313 views

find command for the newest 500 files in a directory tree and also be POSIX compliant

I am looking for a single line shell script or unix command to find the newest 500 files in a directory. Major constraints are it should be POSIX complaint and the directory can have tons of files.
7
votes
4answers
2k views

Find files with same name but different content?

I want to generate a list of files that have: Same name Different content in a directory (including all children directories and content). How to do? Bash, perl, anything is fine. So, two ...
1
vote
3answers
459 views

How to move files into newly created directory on condition in shell/perl

It was a mess of music files and directory. It is needed to perform the below operation over multiple directories at once: If the directory contains ".jpg" files, then create a new directory ...
1
vote
2answers
261 views

Perl find and replace is writing every file

Here's the test script I'm running matt@server:~ $ cat test.sh #!/bin/bash mkdir test cd test echo "has the string foo" > yes.txt echo "hasn't the string" > no.txt ls -l --time-style=full-iso ...