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

2
votes
2answers
157 views

Grep, find line with minimum x words

Is there a way to find all lines with grep, that contains at least x words?
1
vote
3answers
413 views

How to find files on Linux where only root has read permission

I want to find files in some folder like /home/mike/www/test where only root has read permissions and not any other user. EDIT: I have the sudo and permission but I want to list all files where only ...
0
votes
2answers
6k views

If an Excel row contains particular words, return that row, highlight that row, or give Y/N for that row

I have a sheet containing thousands of cells in a column. These cell contains names of different securities. Some names of these securities contains a particular string such as "C/O". How can I use ...
2
votes
3answers
325 views

count files in a list of directories

I have file with a list of directories that I would like to know how many files are in each directory. .../images/idsuffix/userids/ This will give me the count of files and directories for ...
1
vote
1answer
144 views

how do I write find expression (atime = ctime) (access time = change time).

I want to find a set of files to remove that have not been access since their last inode change. Files in which the last activity happened when they were moved into the directory they are currently ...
1
vote
0answers
185 views

Find vs Findstr results

Per this answer I was attempting to use findstr to locate a string (a name) inside some HL7 log files in a directory. Findstr was getting 0 results, but Find returned plenty. I played around with ...
1
vote
1answer
197 views

Using find and sed to rename several subfolders

What I am trying to do is rename folders that are anywhere in the current tree, not neccessarily directly in the working directory. What I need to do is: "A 1" becomes "A 01" "A 2" becomes "A 02" ...
0
votes
1answer
54 views

Compare lists in excel [duplicate]

Possible Duplicate: Extract values from a range that are missing from another I have two vertical lists. I need to compare the two with each other and get the names that are NOT included in ...
2
votes
2answers
918 views

How to search for ? (question mark) in Excel

When I try to find the question mark character (?) in an Excel sheet, Excel cannot locate the cells containing them. How can I search for ? in Excel?
1
vote
1answer
606 views

'find' is not recognized as an internal or external command operable program or batch file

I am getting this error when I use the FIND function in a nested FOR loop and IF statements in a batch file. 'find' is not recognized as an internal or external command operable program or batch ...
1
vote
2answers
148 views

is there an 'upwards' find?

I found I asked this question on the wrong stackexchange site. To find files starting from a certain path, I can use find <path> .... If I want to find 'upwards', i.e. in the parent directory, ...
1
vote
3answers
390 views

find command behaviour when matching names without quotes

I was looking for differences in the find command with double quotes and without quotes. I found something odd. I have two files: xWrapper.java YWrapper.java and some in the pattern ...
0
votes
1answer
1k views

Unix/Linux: recursively search for files containing a string [duplicate]

Possible Duplicate: How to Combine find and grep for a complex search? ( GNU/linux, find, grep ) I have a directory hierarchy of files (some of which are plaintext and others are binary). ...
1
vote
1answer
94 views

Show files from terminal command results in Finder

I can find original files in a directory (as opposed to hard links) in Terminal with find ./ -type f -links 1 -name file2find How can I view the results in a single Finder window?
0
votes
0answers
61 views

“find” command weird behavior, return different result on same command

I encountered a strange thing with linux find command today. /path/to/folder/ is a network mount with about 900 subdirectories. Each time I run find . -type d while in that directory I get a ...
2
votes
3answers
206 views

How do I create a soft link to all executables in a different directory?

I am trying to create soft links to mingw's binaries in cygwin. So far I have: find /cygdrive/c/MinGW/bin/ -name "*.exe" -exec ln -s {} basename {} \; but I get: ln: target ...
3
votes
3answers
172 views

Find out where $PATH is defined

I recently installed an Arch-Linux System. If I type echo $PATH it points (among others) to a directory inside my /home/user/dir I can remember I set up somewhere. I have it as root user also, so ...
0
votes
1answer
151 views

Exclude all hidden directories in UNIX find

I'm doing a word search using the following command: find . -exec grep -q [some_word] '{}' \; -print -o -name .svn -prune -o -name .ssh -prune -o -name .boneyard -o -name log -prune -prune -o -name ...
0
votes
2answers
972 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 ...
2
votes
5answers
535 views

Grep all files in a directory and print matches with filename

I have a list of log files that I create as part of a video encoding script that I wrote. I would like to search all of them and print out certain statistics from the encode - how fast they were ...
1
vote
6answers
484 views

UNIX “find” command, match literal “dot”

I need files ending with ".pdf" or ".png"; here's my attempt: find /Users/robottinosino/Desktop/_PublishMe_ -type f -regex '.*[pdf|png]' this incorrectly includes files ending with "Apdf", "Zpdf", ...
1
vote
2answers
141 views

find files where group permissions equal user permissions

Is it possible to do something like find -perm g=u? I say "like" because -perm mode requires mode to specify all the bits, not just g, and because I can't put u on the right side of the =, like I can ...
2
votes
2answers
126 views

How can I repair a corrupted “find” binary on CentOS?

When I try using "find" on my system, here's what I get: $ find Segmentation fault (core dumped) I assume the binary got corrupted somehow. How can I repair it? I don't have any other installation ...
2
votes
1answer
91 views

Linux “find -regex” doesn't handle binding

I have the following files, and need to match them like: ./foo.bar1.sh -match ./qux/foo.bar2.sh -match ./foo.sh -match ./baz.sh -no match ./foo.bar3 -no ...
3
votes
2answers
197 views

How can I retain grep's match highlighting when piping find into grep?

If I run grep foo bar.txt, grep highlights each occurrence of "foo" in bar.txt. But sometimes I want to use find to determine which files grep searches. So I do something like this: find . -iname ...
1
vote
2answers
82 views

How can I avoid descending certain directories with 'find'?

Currently I have this find command which avoids descending particular directories: find . \! \( -name ".hg" -prune \) \! \( -name "localhost" -prune \) \! \( -name "logs" -prune \) -type f The ...
0
votes
3answers
212 views

Why does Find in Excel give unexpected results?

I would like to find all cells containing the number 18 in an Excel 2007 worksheet where the numbers are in a column with entries in General format (both numbers and strings). When I use the Find ...
-2
votes
2answers
370 views

Can't find the path to proxy.pac file in OS X

I need to control my proxy.pac file in OS X, but I couldn't find it anywhere. I used whereis proxy.pac from terminal too — the whole story short: I want to find the path to a file in Mac OSX.
2
votes
4answers
385 views

Finding subdirectories inside all directories with the same name

I want to run a command to: Find all directories named "inc" under a folder "X". List all the subdirectories under each "X/.../inc/". Redirect the output to a file named "list" I tried various ...
-1
votes
3answers
199 views

Only output part after last “/” with find

This command: find ./ -name "mybinaryrpm-1.0.24-1.1.i586.rpm" gives the output: ./DirectoryName/SubDirectory/mybinaryrpm-1.0.24-1.1.i586.rpm but I only want the output: ...
1
vote
2answers
416 views

How can I clear the contents of every file in a subdirectory without changing ownership / permissions?

I can find the list of files using something like: find /path/to/files -type f And I can clear the contents of a single file with any of: > filename echo -n > filename cat /dev/null > ...
4
votes
3answers
933 views

Using `find` for multiple file extensions

I am using the following command for counting the lines of text in JAVA files: find . -name '*.java' | xargs wc -l How can I modify the find command parameters to match more than one file ...
2
votes
1answer
1k views

Using find -mmin to find files with modification time in the future

I can use find . -mmin -5 to find files changed in last 5 minutes. However if I try to find files with modification time in the future by giving negative number find refuses to do it: find . -mmin ...
0
votes
2answers
195 views

recursively delete but keep .gitignore file

I've been trying out several methods from SU but I have been unable to do this: I got a folder (example: /var/www/tmp/) which contains several files and directories. I'd like to delete all the files ...
0
votes
2answers
81 views

Generate a files list and truncate it in 2 list of X Mb of files each

I need to generate a list of all files in a certain dir, and truncate it in X lists containing each one a fixed amount of data of files. E.g. I have 95 Gb of data. generate the file list ...
0
votes
2answers
242 views

grep doesn't produce the correct output when run on find command

My task was to print the number of files in the current directory without using ls and wc commands. I had typed the following lines in the script: #!/bin/bash find . -maxdepth 1 -type f \( ! -iname ...
2
votes
2answers
284 views

Search all files containing text

With Busybox, how do you search for an expression within a bunch of files recursively through a bunch of directories, but only look through text files? We don't know what the file's suffix is going ...
1
vote
2answers
2k views

How to use command “find” to list files with specific filename length?

In my folder I got files like /data/filename.log /data/filename.log.1 /data/filename.log.2 /data/filenamefilenamefilename.log /data/filenamefilenamefilename.log.2 I wish to use "find" command to ...
2
votes
1answer
531 views

Subshell arguments in -exec parameter for find(1)

Why doesn't find . -type f -exec echo $(file={}; echo ${file:0:5}) \; give the first five characters of the file, while this works: find . -type f -exec bash -c 'echo ${1:0:5}' funcname {} \; ...
0
votes
1answer
388 views

escape file and directory names from find

How can I escape spaces and other symbols from the results of a find command? For example, this doesn't work if there are spaces and other symbols in the results: find -maxdepth 5 -type d -print | ...
7
votes
4answers
2k views

How do I parse the output of the find command when filenames have spaces in them?

Using a loop such as for i in `find . -name \*.txt` will break if some filenames have spaces in them. What technique can I use to avoid this problem?
0
votes
5answers
846 views

Using find command to list top 5 image files by size

All, I want to list the top 5 image files (png,jpg) in a given folder.What's the best approach? I'm using the following currently but it doesn't give the right output: find . \( -iname \*.png -o ...
3
votes
5answers
106 views

BASH: Adding existing filecontent to an existing file

I've to add the content of a file to the end of every prefs.js file. Tried it with find -name 'prefs.js' -exec more filecontent >> '{}' \; but it didn't work.
1
vote
1answer
73 views

What `find` command deletes everything in a directory except for CVS folders?

I have a dir: $ tree . |-- CVS | |-- Entries | |-- Entries.Log | |-- Repository | `-- Root |-- dirA | |-- CVS | | |-- Entries | | |-- Repository | | `-- Root | |-- file1 | ...
0
votes
1answer
183 views

ls link count seems incorrect - how do I ensure I'm not deleting the inode contents?

ls -lai on a file gives me a link count of 2: 16508 -rw-rw-rw- 2 ... Then looking for all the filenames returns only one: find "$dir" -inum 16508 This lists only the original file, not two. ...
0
votes
1answer
87 views

How to find files, print some standard info about those files, plus print the alpha char count of each filename?

I want something like this: find "$dir" -type f -printf '%i:<alpha_char_count_of_base_filename>:%d:%p\n' Then I want to sort first on inode number, then on alpha_char_count_of_base_filename. ...
0
votes
1answer
34 views

Speeding up file search with a shell

Do you know any way to speed up file searching with a shell? There is a lot of possibilities: find, which, whereis, ... find seems to be the most useful, but it's very slow. Perhaps, I don't know ...
3
votes
2answers
1k views

Equivalent of unix find command on windows

What is the equivalent of unix find command on windows? I see that the "find" on windows is more like a grep. I am especially interested in the equivalent of "find . -name [filename]". Many thanks in ...
3
votes
3answers
969 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 ...
1
vote
2answers
130 views

How to use *nix find command to search for specific files with regular expression

In my centOS there is a lot of log files in my folder /log /log/log.20120308 /log/log.20120308.1 /log/log.20120308.2 /log/log.20120308.3 /log/log.20120308.error /log/log.20120308.error.1 Apparently ...

1 2 3 4 5 9