The find command in Windows systems is used to filter lines of input text, and return those matching the filter. The find command in *nix system is used to locate files or folders that match a certain criteria.

learn more… | top users | synonyms

1
vote
1answer
33 views

Why the blackslash dot (\.) in the prefix of the path?

I was running the find command looking for some config files and this is exactly what it outputted: ./log4j.xml ./log4j2-test.xml ./proxyserver/src/main/resources/log4j.xml ...
0
votes
1answer
51 views

searching large number of possible file names in large directory tree

I need to search a large directory tree for a large number of possible file names, i.e. I have an input file with a long list of strings that I need to find in the tree (or as below: print all those ...
0
votes
0answers
22 views

Finding all files modified more than 60 minutes ago [duplicate]

I am struggling a little with find . I need all the files that where modified more than 60 minutes ago. As far is understood from all the sources find . -mmin +60 should give me the desired result. ...
1
vote
4answers
59 views

How to get first line of output from command line?

I'm running a find command that's returning multiple results, but I only need the first result. A bit of googling led me to the "read" command, but I couldn't figure it out, and the man page didn't ...
1
vote
2answers
75 views

What does \; mean in a script?

What does \; mean in the following command? I’m also not sure what {} means. Is \; really necessary? find ./ -name file_1 -exec cp {} ./ \;
0
votes
1answer
32 views

how to find all files under directory different directories

How can you find files name 'xyz' under directories name 'abc'? something like this....but its not working. find . -type d -name 'abc' -exec find {} -type f -name 'xyz' \; find . -not -path 'abc' ...
2
votes
1answer
23 views

Find not expanding variable

I tried the following and it didn't work one bit. image=.jpg,.png,.gif find . -type f -iname "*$image" Why? Does find not expand variables?
0
votes
1answer
21 views

OS X: Copying only files without a special string in filename

I have to copy only files from a folder that don't have following string in its filename: NNNNxNNNN (a 3 or 4 digit number followed by the character x followed by a 3 or 4 digit number again -> it's ...
0
votes
1answer
26 views

How to get the time information of the files after find | grep keyword command?

Now I know how to use find | grep keyword to get the file I want. But after that, how should I know the size, create_time info of each file I found? For example, after find | grep tutorial, I got ...
0
votes
2answers
19 views

How to execute files which are found by find

I have some executable files under a directory tree. I want to find them and execute them the most simple way. I've tried this so far: find . -perm 0775 -type f | xargs exec But exec is not an ...
0
votes
2answers
41 views

Windows DOS Command for Finding folder name with specific characters & select it

Trying to write batch file code for copying contents of a folder with path "C:\ABC" to another folder whose exact name is unknown ( its a Profile data folder of firefox) Profiles of Firefox are ...
1
vote
2answers
49 views

Permission denied when attempting to mv (sudo su userName)

I am currently working on a backup script to log into my production server and pull the latest SQL dumps to my staging server. I have no issue pulling the SQL dumps but I do have an issue with moving ...
2
votes
3answers
63 views

In windows, is there a way to count the amount of times a string appears in a file

I am currently trying to write a batch script and at this point, I need to find a string, "null", and determine how many times it is shown in the file. I'm downloading an API from a website ...
1
vote
1answer
53 views

Use 'find' command to search for PNG files, pipe output to imagemagick for batch conversion

I've got a directory with thousands of image files, mostly JPG but some PNG. The files have no extension, they're just numbered. I need to convert all of them to JPG. Using find I can get a list of ...
0
votes
1answer
49 views

Using batch to verify a process is running with WMIC

I am attempting to write a script that will check if a process is running (in my case a virtual machine) @echo off wmic process where name="VirtualBox.exe" | find "GitHubEnterprise" /c > tmpcount ...
0
votes
1answer
31 views

How to capture diff output from find command exec?

I am using Ubuntu (Precise 12.04) I am trying to write some bash script to see if file is changed via awk replace by using diff command. I did a test with the following: #! /bin/bash diff fileA.htm ...
1
vote
4answers
58 views

Linux remove files without giving error

I have this running as cron job /usr/bin/find /backups/* -mtime +5 -exec rm -rf {} \; But it gives me this error on email /usr/bin/find: `/backups/Jun-20-2014': No such file or directory Is ...
0
votes
0answers
11 views

Detect symlink errors in installation

It is my understanding that the Linux Filesystem Hierarchy is supposed to be structured like this: /usr/lib/prog-ver - contains the actual installation of prog (e.g., java) version ver (e.g., ...
1
vote
1answer
39 views

Script bash delete older files on directories with special chracters

I use a script for delete older files on Trash or directories type Junk, or similar. It works fine except when it has special characters or spaces in the names ...
0
votes
2answers
38 views

find: show directories which contain certain subdirectories

I have a list of directories /u2/tip/coy/inter/fcs/ /u2/tip/coy/inter/fcs/devel /u2/tip/coy/inter/fcs/ecom_flink /u2/tip/coy/inter/fcs/totalstable /u2/tip/coy/inter/fcs/develbi ...
1
vote
2answers
74 views

How do you search for a phrase on a page in Chrome? (Not a string match)

I'm using Chrome on a Mac, and want to be able to easily search for a phrase on a page, not an exact string match. For instance, on this page: ...
0
votes
1answer
51 views

Direct errors in find to /dev/null by default

On my OSX command line, find directs errors to STDOUT. I find this very inconvenient, and I also find it annoying to add 2>/dev/null to the end of the command every time. This brings up several ...
0
votes
2answers
43 views

How to List Files greater than particular timestamp?

I have a directory in linux which has a list of log files where log files get auto generated if some job runs. Each log file gets appended with the timestamp like "JobName_TimeStamp" UPDATED: ...
1
vote
1answer
66 views

How do I remove HTML from MS Word 2010 document with Find/Replace Wildcards/Regex?

I found a website to help me choose domain names. I have my shortlist which I can't export, but I need to share the list with some other team members first. It also won't let me copy and paste the ...
0
votes
2answers
50 views

Why doesn't xargs on find work with a series of commands using pushd and popd to walk a directory subtree?

On a Linux Centos 4 machine, I am trying to create a simple bash command line to walk a directory structure below an arbitrary current directory and in each subdirectory touch a file, list the ...
0
votes
1answer
37 views

How to use find to fill in variable in Shell script

I am making simple Shell script form some boring-ever-repeating job. Script changes directory correctly, and now I want to run other scripts based on argument I typed when running script. Other ...
0
votes
2answers
44 views

Is there a way to show “File not found” or a message alike when using the `find` command?

I'm trying to check the existence of several files, without knowing in advance where the files are located. So, I thought of find as the de facto utility to do this... It works as expected, but the ...
1
vote
1answer
26 views

How can I restrict a bash find to only specific sub-sub-directories

I'm trying to list all the files in a specific sub-directory but different directories which are themselves on a different volume. The following works, but only on a fully specific sub-directory (and ...
2
votes
1answer
42 views

find -regex not recognizing \d digit

I have a directory structure that looks like the following: processor0/10 processor0/10.1 processor0/10.2 processor1/10 processor1/10.1 processor1/10.2 ...etc... processor7/10 processor7/10.1 ...
8
votes
2answers
764 views

Why backslash before asterisk in `find`?

In this command: find . -name \*.pyc -delete Why is a backslash needed before *.pyc ?
0
votes
2answers
19 views

Adding logic to 'find' directories containing either [criteria A] or [criteria B]

I have inherited a vast media archive without a unifying organizational scheme. Its contents date back at least 10 years. I have been asked to find a needle in this hay stack, and I have some guesses ...
0
votes
0answers
9 views

remove permission spam for find is not working tcsh enviroment

Hello this question is asked a lot like here: However, my environment on (csh or tcsh) seems to add a space but I can't figure out why. for instance, on bash: find /. -user `whoami` 2>/dev/null ...
0
votes
1answer
17 views

linux find file modiffied past exact hour

I would like to find files that are modiffied past exact hour. example: File Time Modified test1.log 14.45PM test2.log 15.01PM ...
1
vote
4answers
83 views

Find all files where other files with different extension dont already exist

I want to use the find command, to find all files with a certain extension (avi), where the same filename with another extension (mp4) does not already exist. so considering these files: a.avi a.mp4 ...
0
votes
1answer
36 views

I have file called songs and i'm trying to find the longest and shortest song name using AWK

RANK NAME BAND YEAR GENERE DOMESTIC/INTERNATIONAL 206:Reach Out, I'll Be There:The Four Tops:1978:Pop:3/2 207:Bye Bye Love:The Everly Brothers:1950:Classic:3/2 ...
1
vote
1answer
25 views

find . file -/+ size except *.filetype

Alright what I am looking for is a way to do something that can find all files less than size except filenames with an extension or more. May be more than one. find . -type f -size -20M -name /! ...
2
votes
1answer
35 views

find using regexp and echo matches

I have about 50 users in /home/ directory and I have cloned a git repository to everyone: Executed at /home/ as root user: find . -maxdepth 1 -type d ! -name . -prune -exec git clone ...
0
votes
1answer
60 views

Using find and wc -L to find files containing lines longer then 500 characters

I have this command: find . -name "*.php" -exec wc -L '{}' \; And I believe it gives me the count of the longest line for each file. But I'm looking for a way to only print out the count and file ...
2
votes
1answer
41 views

Are there limits to file length piped from find to xargs or using find -exec +

In question [ Find and delete all the directories named "test" in linux ] on this site, the best answer talks about using these two commands: find . -name test -type d -print0|xargs -0 rm ...
4
votes
3answers
81 views

Using Unix's find command to find directories matching name but not subdirectories with same name

Edited: I mistakenly misrepresented my problem. A more accurate example now appears below. I'd like to recursively walk all directories inside a target directory, and stop each recursive call after ...
0
votes
1answer
23 views

How do I extract multiple files at once?

I have a number of rar files stored like so: /torrents/televisionshowS01E0$X/nameoftelevisionshow.rar where $X is a variable ={0,1,2,...,12} I would like to extract them using a single command to ...
0
votes
1answer
42 views

mdfind -onlyin not working in hidden directories recursvily? How to use it properly?

I am trying to find all files named doc.py in one of my virtualevns (called data_science), which are all in hidden directory .virtualenvs under /Users/adni and so I go: mdfind -onlyin data_science ...
0
votes
1answer
43 views

Why result of find command in linux is unsorted?

When I do a find the results are apparently in random order, shouldn't they be sorted by name?
0
votes
1answer
32 views

Two ways - two different results

I ran two seperate commands each one produced a different number. Can anyone help me figure out why? find -type d -name *log* | du -hcs find . -type d -name '*log*' -print0 | xargs -0 du -hcs
0
votes
1answer
100 views

Find & du to calculate total size vs xargs

Can someone confirm that the following one liner will produce the total human readable size of all the directories which FIND locates as having log in the name? find -type d -name *log* | du -hcs
0
votes
1answer
86 views

Find and delete line in .htaccess file

I am trying to figure out how could possible a command do search and delete line from .htaccess file . the following line is the line i want to search and delete RedirectMatch ...
1
vote
2answers
53 views

Find all php files which first or second line has more than N characters

I would like to find all php files on my server which first line or second line has more than N characters. I would like to print both the file name and the line content that was found. How would I ...
1
vote
1answer
41 views

Find word that has more than 50 characters in all php files

I am trying to use find in combination with grep to find all the php files in my web server which have a word (any sequence of characters except whitespace) with more than 50 characters. I have this ...
1
vote
2answers
46 views

How to find files which do not contain their own filename

When using templates to generating files, it's important to include the template's name inside the template. When reading a generated file, it helps you find the template used to generate it. I want ...
0
votes
1answer
24 views

How to find files that contain a string in its content OR the path?

Find and grep does not work afaik because I need to create a list of files that satisfy EITHER requirement, not both. I assume this requires more than a one-liner. Any suggestions?