find is a command line utility to search for files in a directory hierarchy

learn more… | top users | synonyms

1
vote
2answers
928 views

Using exec in find over ssh from shell script

So, I am attempting to execute the following from within a shell script; ssh -q $CUR_HOST "cd $LOGS_DIR; echo cd $LOGS_DIR; find . -name *.log -mmin +1440 -exec gzip {} \; exit" When this runs, it ...
1
vote
2answers
2k views

Find and move directories based on file type and date

I have a directory "New Movies" containing 200+ subdirectories "Movie Name (year)". The subdirectories "Movie Name (year)" contains a single video file (avi/mkv) and several related jpg/xml files. I ...
1
vote
1answer
579 views

Speeding a find rm command with test through parallelization

I want to recursively delete all files in directories and subdirectories with number of lines less than 10, and am currently using the following command find . -type f -name "*.txt" | while read; do ...
1
vote
5answers
2k views

Checking if a file exists in several directories

I've been working on this far too long and need some help. I need a script that will look at files in a directory and see if it exists in one of several directories. I need something like this: for ...
1
vote
4answers
237 views

Syntax error in a bash script that calls find

Where is the error in this script please: #!/bin/bash rep="git" files=`find' ${rep} '-type f` for f in ${files} do echo $f done When i run find git -type f alone in the shell, it works!
1
vote
1answer
434 views

Error creating an alias for the find command [duplicate]

Possible Duplicate: How to pass parameter to alias? I am trying to shorten the find command, but getting an error: $ alias f='find . -name $1 -print' $ f JobConf.java find: paths must ...
0
votes
3answers
31 views

Excluding a folder from deleting empty files with find

I usually delete empty files and folders in my home directory with find using the following command: find /home/tjuh -empty -delete However I would like to exlcude one folder, namely ...
0
votes
2answers
71 views

Further questions about -path for find

From http://unix.stackexchange.com/a/81379/674 -path does not (re)define the start path. It refers to the combination of the start path and the relative path of the currently examined object. ...
0
votes
2answers
997 views

`find -path` explained

The find command provides the option -path. I understand that one has to define where to start looking [commonly known as "path"]. Trying to figure out what it is used for, I found many examples using ...
0
votes
1answer
149 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 ...