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

3
votes
1answer
23 views

Trying to create a shell script to move all files with a certain year in their name to a year based directory

Here is the block of code that I have so far. No matter what I do with the find command, I can't seem to get it to function as I want. Trying to move all files with these long year names into their ...
0
votes
1answer
20 views

How to grep in Windows for for eval code?

I have written this code in Linux, How can I achieve the same in Windows server ? find "dirname" -name "*.php" -exec grep -PHl "(eval\(.*\);)" {} \; Basically I want to find out this pattern ...
1
vote
3answers
990 views

Find directories containing a certain number of files

Was hoping I would be able to do this with the find command but I can see no test in the manual for doing what I want. I would like to be able to find any directories in the working directory that ...
2
votes
2answers
17 views

How can I find a particular named file within a particular named directory that could be anywhere in file system?

I am trying to find a file within a directory where both the name of the file and the name of the directory are known. For example, say I want to find "...don't know this part of file path ...
1
vote
3answers
4k views

Find directories with all files inside older than X?

Is it possible on linux to find directories where all contained files and directories (and sub-directories' files etc.) are older than a given age? In other words, if a directory has one or more files ...
1
vote
2answers
20 views

Finding php files that have numbers in the filename

Can someone help me with a command line to find all .php files on a server with a number in the filename? I have searched, as best I can, for other answers, but they typically show for a specific ...
24
votes
4answers
15k views
0
votes
0answers
14 views

Start text search from focus point in chrome

In chrome, when I start typing for a text search, it searches from the beginning of the document rather than from where I am looking in the document. Is there a way to do the latter? (currently I have ...
5
votes
1answer
26 views

How is the command line built for find -exec command {} +

I find the manual explanation for find to be a little unclear. What is the meaning of "but the command line is built by appending each selected file at the end; the total number of invocations of the ...
9
votes
5answers
12k views

How to move only files in Unix

How can I move only the plain files (not the directories) from one folder in Linux to another folder using the mv command? I have tried mv * ~/, but it copied everything including the directories.
2
votes
1answer
18 views

Why does the behaviour of find(1) differ when explicitly adding -print?

The man page for find(1) says: If the expression contains no actions other than -prune, -print is performed on all files for which the expression is true. However, there seems to be a ...
55
votes
12answers
71k views

Unix/Linux find and sort by date modified

How can I do a simple find which would order the results by most recently modified? Here is the current find I am using (I am doing a shell escape in PHP, so that is the reasoning for the variables): ...
0
votes
2answers
18 views

Find files to find multiple instances of the same code with Notepad++

I might have inserted <meta charset="UTF-8"> twice in some HTML files, and there are too many of them to check manually. Is there a regular expression I can use with Notepad++ to search for ...
3
votes
2answers
2k views

How can I use sed to alter the results of find and pass the results to cp?

In solaris, I'd like to copy all files found by the find command to a slightly different path. The following script basically executes cp for each file found by find. For example: cp ...
0
votes
1answer
12 views

find certain item of a file by using command line tool in windows 7

recently I used findstr "ItemThatIsBeeingSearchedFor" C:\Windows\System32\drivers\etc\hosts > J:\documents\HostsFile\ResultOfSearch.txt in order to output a certain entry of the hosts file into ...
0
votes
2answers
54 views

find/xargs, filenames with spaces, and quotes

I'm looking for a way to get find and xargs (GNUWin32, under Win7, both programs at version 4.1) to play along, with filenames that contain spaces. Getting the filenames into xargs as one was one ...
0
votes
0answers
73 views

ZFS on Linux - is the .zfs special directory incompatible with find?

My ZFS pool has a number of datasets with snapshots that contain junk. I'm copying the valuable files to a new dataset so that I can then delete the snapshots. The basic approach I'm taking is to ...
1
vote
0answers
15 views

find command operator associativity and its effect to execution speed

Let's say in a folder structure there are files of extensions ext1, ext2, ext3 (in the decreasing order of number of files in each type), and some other files that we don't really care (in total, ...
1
vote
2answers
22 views

Compare list of files from a database using find to locate missing files

I have a list of 2000 files from a database that looks like this: ./aa/0f/unique-string/IMG_0987.JPG ./ab/cf/unique-string/IMG_0987.JPG I want to compare that list to the actual directory contents ...
0
votes
2answers
188 views

Copy a file from source directory to target base directory and maintain source path

Forgive me, I am probably not using the right terms to describe the problem and misunderstanding the most basic usage for a couple of common commands. I have a simple find statement that is ...
15
votes
4answers
13k views

Find files filtered by multiple extensions

What is the correct syntax for: find . -type f -name \*.\(shtml\|css\) This works, but is inelegant: find . -type f -name \*.shtml > f.txt && find . -type f -name \*.css >> f.txt ...
6
votes
6answers
6k views

Is there a smarter Find files utility for Windows 8 than Windows key + F? [closed]

Is there any utility for Windows 8 that will basically do the same thing the old "Find" dialog in Explorer did? Often times (many times a day) I need to find a particular file, and I don't know the ...
2
votes
1answer
83 views

bash script to compare dates within a diven dir (incl. subdirs)

I would like to write a bash script (or just use a command in the CLI) to find all the instances within a given directory and its subdirectories for a given time period copy those files into a ...
3
votes
5answers
17k views

Find document files and copy them to another directory

This is a bit of a basic question but I'm trying to copy all .doc files I find in a directory and copy them to another directory. I know each command: find -name '*.doc' . and: cp filename ...
0
votes
1answer
25 views

Search directories listed in the PATH environment variable

I am trying to find and remove any instance of a .dll that appears in any directory that's on the PATH environment variable in windows. Is there an easy way to do this from the CMD window?
7
votes
7answers
6k views

find command in Linux to locate pdf files

My goal is to find all pdf files on a remote machine, so I resort to the useful command find. So I type find ~ *.pdf or find ~ "*.pdf" and I get nothing. I do the same on my machine and I get nothing. ...
0
votes
0answers
8 views

Error trying to copy files with find and cpio

I have a bash script that I use to periodically make a backup of proofs (PDFs & JPGs) from a server I work on. I put together the script a couple of years ago and it used to work however the ...
6
votes
4answers
4k views

How do I run this `find` command, but only on non-binary files?

I want to remove trailing whitespace from all the files in a recursive directory hierarchy. I use this: find * -type f -exec sed 's/[ \t]*$//' -i {} \; This works, but will also remove trailing ...
1
vote
1answer
23 views

How to quickly move focus from the “Find” navigation pane to the beginning of the first found item

How can I most easily go from finding some text in the Navigation Pane to having the focus back on the beginning of first found instance of that text in the document? I am going through long documents ...
2
votes
6answers
9k views

list/find all regular files in all subdirectories excluding binary files

In Linux. I know I can do find . -type f, but that includes binary file and I couldn't find a way to exclude them with find
0
votes
1answer
29 views

Use the same “find bar” in all tabs in Firefox

Before, the "find bar" (what you get by pressing ctrl-F) was the same for all tabs. But now it is separate per tab. That is, if I write a word (e.g., "hello") in the bar, I go to another tab and I ...
0
votes
2answers
929 views

Copying all files inside subdirectories and renaming instead of overwriting

I have a number of images inside subdirectories of another directory which I'd like to copy to one single directory so all the images are in one place. After a bit of searching, I found and then ...
0
votes
2answers
8k views

How to search contents of files in folder?

In Win 7, how can I search for a word in the contents of all files in a specific folder. In XP this was easy. All you had to do was type the word into the "A word or phrase in file" text box on the ...
39
votes
4answers
37k views

How can I recursively copy files by file extension, preserving directory structure?

At the Linux command line, I'd like to copy a (very large) set of .txt files from one directory (and its subdirectories) to another. I need the directory structure to stay intact, and I need to ...
12
votes
4answers
11k views

How can I search a file by its name and partial path?

Often I have a file name and it's partial path, e.g. "content/docs/file.xml". Is there a simple way to search for that file, without manually cutting into parts its name to provide directory name ...
0
votes
1answer
21 views

Find next in vimperator?

I'm new to vimperator. Like it for the most part, but a major problem for me is the inability to find next/previous using n and N. After I do /search_term, pressing n or N only adds to the search term ...
10
votes
3answers
8k views

Equivalent of Unix find command on Windows

What is the equivalent of the Unix find command on Windows? I see that the find.exe on Windows is more like a grep. I am especially interested in the equivalent of find . -name [filename]
0
votes
1answer
25 views

Sublime Text - Find next - go back to beggining of file like Chrome does

In Google Chrome, when you search for a string and you keep pressing the "down arrow", if you are at the last string found, and you click again the down arrow, if goes back to the first string found ...
2
votes
2answers
38 views

Way to get Microsoft Word to remember “Find and Replace” entries for auto complete the next time after closing Word?

After you use “find what”, or “replace with”, the entry will be remembered for auto complete the next time. When you quit Microsoft Word, the suggestions are no longer remembered. Is there a way to ...
2
votes
1answer
39 views

mac find -name *.png does not work [duplicate]

I am trying to recursively search for a filename ending in .png My find command works fine for *.js, but not for *.png. ~ >find dev -name *.png ~ >find dev -name bluerightarrow.png ...
0
votes
2answers
38 views

How to search using find command in external hard disk

I have an external hard disk. I have to search for a folder called Visa in that external Hard disk named ASTUTE. There might be multiple VISA folder but I want to search for all of them. I navigated ...
1
vote
4answers
92 views

Find directories that contain more than one file of the same extension

I’m using Debian 8.0 and would like for example to find directories that contain more than 1 .mkv file. I tried this and it failed: find -type d -exec find {} -name '*.mkv' | wc -l\; There is a ...
0
votes
1answer
4 views

Define path exclusions for find globally

I have 2 directories that I want to exclude from all my find searches: .git and node_modules I've been trying to define an alias that would do it, but haven't been successful. Something similar to ...
0
votes
1answer
21 views

Using grep for text search

I need to search the filesystem for text strings that match some string. I'm trying to get where the commands are used, meaning in which files they are called or used. I need to find every file where ...
0
votes
1answer
58 views

Linux Bash: Moving/Copying files/directories by timestamp

This is the command I am using: find absolute-path -name "*" -amin -120 -exec cp -f absolute-destination {} \; I’m trying to copy a lot of directories from a directory to another directory, but ...
30
votes
5answers
2k views

Deleting millions of files

I had a dir fill up with millions of gif images. Too many for rm command. I have been trying the find command like this: find . -name "*.gif" -print0 | xargs -0 rm Problem is, it bogs down my ...
2
votes
1answer
46 views

find: missing argument to `-exec' when using + form of find

I want to execute a command on the paths found with the find command and I want to use + to reduce the number of times the external command is launched. Critically, the command has a fixed value ...
0
votes
1answer
17 views

how can I enable “higher elevation” in windows 7?

each time I try to save a file from Open Office or any program like it, I get requires higher elevation. I have tried to search for the file but nothing comes up and I not knowledgeable enough to know ...
0
votes
2answers
39 views

Zero out files in folder(s) that have space in file name

I'm trying to zero out (truncate) all the files in a folder or subtree that match a wildcard. Another post recommended using the find … -exec method over for variable in wildcard, which received high ...
5
votes
1answer
3k views

Bash Find Files with zero size and delete files with different extensions

This command will find files of zero size: find . -size 0 A filename returned might be filename.001 I am looking for a one liner that will delete files found with this, plus any that have the ...